|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.plugin.pc.ScheduledJobInvocationContext
public class ScheduledJobInvocationContext
A scheduled job's invocation method can take a single argument of this type. If this is the case, the scheduled job's method will be passed an object of this type enabling the job being invoked to be given information about the invocation.
When a job is not marked for concurrent execution, it can store data in the context in the form of key/value properties. These properties will be persisted across invocations of the job. If the job is marked to as clustered, the job data will persist across server restarts as well. Lastly, if the job is marked to run concurrently, the methods for accessing/updating properties will throw an exception.
| Constructor Summary | |
|---|---|
ScheduledJobInvocationContext(ScheduledJobDefinition jobDefinition,
ServerPluginContext pluginContext,
ServerPluginComponent serverPluginComponent)
|
|
| Method Summary | |
|---|---|
boolean |
containsKey(String key)
Checks to see whether or not the property key is stored in the context. |
String |
get(String key)
Retrieves a property value from the context. |
Map<String,String> |
getJobData()
Returns a read-only view of the properties stored in the context. |
ScheduledJobDefinition |
getJobDefinition()
The definition of the triggered job that owns this context object. |
ServerPluginComponent |
getServerPluginComponent()
If the job's plugin has a plugin component defined, this will return the instance of that component. |
ServerPluginContext |
getServerPluginContext()
General information for the job's plugin. |
void |
put(String key,
String value)
Adds a property to the context that is persisted across invocations of the job. |
String |
remove(String key)
Removes the property value associated with the specified key |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ScheduledJobInvocationContext(ScheduledJobDefinition jobDefinition,
ServerPluginContext pluginContext,
ServerPluginComponent serverPluginComponent)
| Method Detail |
|---|
public ScheduledJobDefinition getJobDefinition()
public ServerPluginContext getServerPluginContext()
public ServerPluginComponent getServerPluginComponent()
null if
there is no plugin component for the plugin
public void put(String key,
String value)
key - The property namevalue - The property value
UnsupportedOperationException - if the job is marked for concurrent executionpublic String get(String key)
key - The property key
null if the key is not found
- Throws:
UnsupportedOperationException - if the job is marked for concurrent executionpublic String remove(String key)
key - The property key
null if the key is present in the context
UnsupportedOperationException - if the job is marked for concurrent executionpublic boolean containsKey(String key)
key - The property key
true if the key is found, false otherwise.
UnsupportedOperationException - if the job is marked for concurrent executionpublic Map<String,String> getJobData()
UnsupportedOperationException - if the job is marked for concurrent execution
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||