csip.annotations.Resource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of csip-core Show documentation
Show all versions of csip-core Show documentation
The Cloud Services Integration Platform is a SoA implementation to offer a Model-as-a-Service framework, Application Programming Interface, deployment infrastructure, and service implementations for environmental modeling.
/*
* $Id: Resource.java b4f72775f9d1 2019-11-22 [email protected] $
*
* This file is part of the Cloud Services Integration Platform (CSIP),
* a Model-as-a-Service framework, API and application suite.
*
* 2012-2019, Olaf David and others, OMSLab, Colorado State University.
*
* OMSLab licenses this file to you under the MIT license.
* See the LICENSE file in the project root for more information.
*/
package csip.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Resource definition.
*
* @author od
*/
@Repeatable(Resources.class)
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Inherited
public @interface Resource {
/**
* The path to the file within the war file or file system.
*
* @return the relative path to the file in the war or on the absolute path in
* the file system.
*/
String file() default "";
/**
* The type of the resource.
*
* @return the specific type of the resource.
*/
ResourceType type() default ResourceType.FILE;
/**
* The id of that resource. Set it only if you want to access the resource.
*
* @return the id of that resource
* @see csip.ServiceResources#getExe(java.lang.String)
* @see csip.ServiceResources#getFile(java.lang.String)
*/
String id() default "";
/**
* Should the file executed via wine.
*
* @return true if executed via wine, false otherwise.
*/
boolean wine() default false;
/**
* Default executable arguments, separated by space.
*
* @return the executable arguments
*/
String args() default "";
/**
* environment variables to be used for execution. ("env1=abc", "env2=def"}
*
* @return the environment variables.
*/
String[] env() default {};
/**
* Allows for resource 'inheritance'.
*
* @return the class to use/inherit the resources from
*/
Class> from() default Object.class;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy