Package net.sf.basedb.opengrid.service
Class OpenGridSignalHandlerFactory
java.lang.Object
net.sf.basedb.opengrid.service.OpenGridSignalHandlerFactory
- All Implemented Interfaces:
ActionFactory<SignalHandler>
Signal handler implementation for Open Grid Scheduler clusters.
Jobs that are started on a cluster should be registered in BASE
with an external id equal to the job id on the cluster,
ExtensionSignalTransporter
as the signal transporter implementation
and the URI from getSignalUri(JobIdentifier)
as the
signal transporter parameter.
Signal URI:s have the form:
ogx://cluster-id/?ABORT,STATUS#job-id
where cluster-id is the username, ip-address and port of the cluster.-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
Signal handler implementation. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The ID of the signal handler extension.private static final ExtensionsLogger
static final Collection<Signal>
Minimal set of supported signals that should always be supported by all engines.static final Collection<Signal>
Supports PAUSE in addition to ABORT and STATUS.static final Collection<Signal>
Supports RESUME in addition to ABORT and STATUS.static final Collection<Signal>
All supported signals by this signal handler. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetActions
(InvokationContext<? super SignalHandler> context) static String
getSignalUri
(JobIdentifier jobId) Deprecated.In 1.15, signals may depend on cluster engine and job status.static String
getSignalUri
(JobIdentifier jobId, Collection<Signal> signals) Generate a signal URI that is used to send signals to a given job on a cluster.boolean
prepareContext
(InvokationContext<? super SignalHandler> context) If the signal schema is "ogx" this factory should handle it.
-
Field Details
-
ID
The ID of the signal handler extension.- Since:
- 1.10
- See Also:
-
SUPPORTED_SIGNALS
All supported signals by this signal handler. Note that not all signals (eg. PAUSE and RESUME) may be supported by the underlying engine. -
MINIMAL
Minimal set of supported signals that should always be supported by all engines. ABORT and STATUS.- Since:
- 1.15
-
PAUSABLE
Supports PAUSE in addition to ABORT and STATUS.- Since:
- 1.15
-
RESUMABLE
Supports RESUME in addition to ABORT and STATUS.- Since:
- 1.15
-
logger
-
-
Constructor Details
-
OpenGridSignalHandlerFactory
public OpenGridSignalHandlerFactory()
-
-
Method Details
-
getSignalUri
Deprecated.In 1.15, signals may depend on cluster engine and job status. UseClusterEngine#getSupportedSignals(net.sf.basedb.core.Job.Status)
andgetSignalUri(JobIdentifier, Collection)
insteadGenerate a signal URI that is used to send signals to a given job on a cluster.- Parameters:
jobId
- The job identifier
-
getSignalUri
Generate a signal URI that is used to send signals to a given job on a cluster.- Parameters:
jobId
- The job identifiersignals
- The supported signals
-
prepareContext
If the signal schema is "ogx" this factory should handle it.- Specified by:
prepareContext
in interfaceActionFactory<SignalHandler>
-
getActions
- Specified by:
getActions
in interfaceActionFactory<SignalHandler>
-