Package com.sodius.mdw.server.launch
Interface LaunchManager
-
public interface LaunchManagerManages the launch executions. A launch is the execution of a service on the server. A launch provides information on its state and on the result of the execution.This interface is not intended to be implemented by clients.
- See Also:
MDWorkbenchServer.getLaunchManager()
-
-
Field Summary
Fields Modifier and Type Field Description static StringOPTION_EVALUATION_DIRECTORYOption to query the path where files can be generated by the executed service, e.g.:static StringOPTION_HTTP_REQUESTOption to query the launch context to retrieve the originatingHttpServletRequest.static StringOPTION_HTTP_REQUEST_URIOption to query the launch context to retrieve the originating servlet request URL.static StringOPTION_SERVICEOption to query the evaluation context to retrieve the executed service, e.g.:static StringOPTION_STATUSOption to query the evaluation context to retrieve the launch status custom properties, so that a service developer can send information to the caller of the execution.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddLaunchInterceptor(LaunchInterceptor interceptor)Registers a new launch interceptor that listens for a launch at various steps of its execution.LaunchcreateLaunch(Service service, PropertySet launchProperties)Creates a new launch for the specified service and launch properties.LaunchgetLaunch(String id)Returns the launch associated with the specified identifier.voidremoveLaunchInterceptor(LaunchInterceptor interceptor)Unregisters a launch interceptor previously registered on this manager.
-
-
-
Field Detail
-
OPTION_SERVICE
static final String OPTION_SERVICE
Option to query the evaluation context to retrieve the executed service, e.g.:Service service = (Service) ScriptContainer.context.getProperty(LaunchManager.OPTION_SERVICE);
-
OPTION_HTTP_REQUEST
static final String OPTION_HTTP_REQUEST
Option to query the launch context to retrieve the originatingHttpServletRequest.Querying the servlet request shall typically be done in the
LaunchInterceptor.launchScheduled()method. Note it is not suitable for thelaunchStarted()andlaunchCompleted()methods, as those are executed in a different thread and theHttpServletRequestinstance might contain incomplete information. Also note that such option is not available when the launch was scheduled and resumed on server restart. Therefore it is important for aLaunchInterceptornot to assume this option is always present.
-
OPTION_HTTP_REQUEST_URI
static final String OPTION_HTTP_REQUEST_URI
Option to query the launch context to retrieve the originating servlet request URL. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.
-
OPTION_STATUS
static final String OPTION_STATUS
Option to query the evaluation context to retrieve the launch status custom properties, so that a service developer can send information to the caller of the execution.The
com.sodius.mdw.core.util.PropertySetinstance associated to this option is guaranteed to exist to in the evaluation context.
-
OPTION_EVALUATION_DIRECTORY
static final String OPTION_EVALUATION_DIRECTORY
Option to query the path where files can be generated by the executed service, e.g.:String directory = (String) context.getProperty(LaunchManager.OPTION_EVALUATION_DIRECTORY);
This is notably useful for services implemented with an Operation, as ones implemented with a Ruleset are recommended to generate files through text templates. Files generated in this directory will be available as result of the launch.- Since:
- 2.3.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLaunch
Launch getLaunch(String id)
Returns the launch associated with the specified identifier.- Parameters:
id- the launch identifier- Returns:
- the launch associated with the specified identifier,
nullif none. - See Also:
Launch.getId()
-
createLaunch
Launch createLaunch(Service service, PropertySet launchProperties) throws CoreException
Creates a new launch for the specified service and launch properties. The created launch is added in the queue and executed as soon as possible.- Parameters:
service- the service to execute.launchProperties- the properties to create the launch, with a value associated to each service declared parameter.- Returns:
- the new launch.
- Throws:
CoreException- if the launch cannot be created, for example if the server is in maintenance mode or if a value is not set for a service parameter in the launch properties.- Since:
- 2.3.0
-
addLaunchInterceptor
void addLaunchInterceptor(LaunchInterceptor interceptor)
Registers a new launch interceptor that listens for a launch at various steps of its execution.- Parameters:
interceptor- a new launch interceptor.- Since:
- 2.3.0
-
removeLaunchInterceptor
void removeLaunchInterceptor(LaunchInterceptor interceptor)
Unregisters a launch interceptor previously registered on this manager.- Parameters:
interceptor- a launch interceptor to unregister.- Since:
- 2.3.0
-
-