public interface LaunchManager
This interface is not intended to be implemented by clients.
MDWorkbenchServer.getLaunchManager()
Modifier and Type | Field and Description |
---|---|
static String |
OPTION_EVALUATION_DIRECTORY
Option to query the path where files can be generated by the executed service, e.g.:
|
static String |
OPTION_HTTP_REQUEST
Option to query the launch context to retrieve the originating
HttpServletRequest . |
static String |
OPTION_HTTP_REQUEST_URI
Option to query the launch context to retrieve the originating servlet request URL.
|
static String |
OPTION_SERVICE
Option to query the evaluation context to retrieve the executed service, e.g.:
|
static 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.
|
Modifier and Type | Method and Description |
---|---|
void |
addLaunchInterceptor(LaunchInterceptor interceptor)
Registers a new launch interceptor that listens for a launch at various steps of its execution.
|
Launch |
createLaunch(Service service,
PropertySet launchProperties)
Creates a new launch for the specified service and launch properties.
|
Launch |
getLaunch(String id)
Returns the launch associated with the specified identifier.
|
void |
removeLaunchInterceptor(LaunchInterceptor interceptor)
Unregisters a launch interceptor previously registered on this manager.
|
static final String OPTION_SERVICE
Service service = (Service) ScriptContainer.context.getProperty(LaunchManager.OPTION_SERVICE);
static final String OPTION_HTTP_REQUEST
HttpServletRequest
.
Querying the servlet request shall typically be done in the LaunchInterceptor.launchScheduled()
method. Note it is not suitable
for the launchStarted()
and launchCompleted()
methods, as those are executed in a different thread and the
HttpServletRequest
instance 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 a LaunchInterceptor
not to assume this option is always
present.
static final String OPTION_HTTP_REQUEST_URI
static final String OPTION_STATUS
The com.sodius.mdw.core.util.PropertySet
instance associated to this option is guaranteed to exist to in the evaluation context.
static final String OPTION_EVALUATION_DIRECTORY
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.
Launch getLaunch(String id)
id
- the launch identifiernull
if none.Launch.getId()
Launch createLaunch(Service service, PropertySet launchProperties) throws CoreException
service
- the service to execute.launchProperties
- the properties to create the launch, with a value associated to each service declared parameter.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.void addLaunchInterceptor(LaunchInterceptor interceptor)
interceptor
- a new launch interceptor.void removeLaunchInterceptor(LaunchInterceptor interceptor)
interceptor
- a launch interceptor to unregister.