A WorkItem describes an event that has arrived for the application to process.
The Notifier is invoked when one or more WorkItems become available for processing.
The type of the Object returned by getParams is determined by the WorkItemType and described below.
WorkItem Type | Description |
---|---|
AGENT_ADDED: | When the QMF Console receives the first heartbeat from an Agent, an AGENT_ADDED WorkItem is pushed onto the work-queue. The getParams() method returns a map which contains a reference to the new Console Agent instance. The reference is indexed from the map using the key string "agent". There is no handle associated with this WorkItem. Note: If a new Agent is discovered as a result of the Console findAgent() method, then no AGENT_ADDED WorkItem is generated for that Agent. Use AgentAddedWorkItem to enable neater access. |
AGENT_DELETED: | When a known Agent stops sending heartbeat messages the Console will time out that Agent. On Agent timeout, an AGENT_DELETED WorkItem is pushed onto the work-queue. The getParams() method returns a map which contains a reference to the Agent instance that has been deleted. The reference is indexed from the map using the key string "agent". There is no handle associated with this WorkItem. The Console application must release all saved references to the Agent before returning the WorkItem. Use AgentDeletedWorkItem to enable neater access. |
AGENT_RESTARTED: | Sent when the QMF Console detects an Agent was restarted, an AGENT_RESTARTED WorkItem is pushed onto the work-queue. The getParams() method returns a map which contains a reference to the Console Agent instance. The reference is indexed from the map using the key string "agent". There is no handle associated with this WorkItem. Use AgentRestartedWorkItem to enable neater access. |
AGENT_HEARTBEAT: | When the QMF Console receives heartbeats from an Agent, an AGENT_HEARTBEAT WorkItem is pushed onto the work-queue. The getParams() method returns a map which contains a reference to the Console Agent instance. The reference is indexed from the map using the key string "agent". There is no handle associated with this WorkItem. Note: the first heartbeat results in an AGENT_ADDED WorkItem for Agent not an AGENT_HEARTBEAT. Use AgentHeartbeatWorkItem to enable neater access. |
NEW_PACKAGE: | TBD |
NEW_CLASS: | TBD |
OBJECT_UPDATE: | The OBJECT_UPDATE WorkItem is generated in response to an asynchronous refresh made by a QmfConsoleData object. The getParams() method will return a QmfConsoleData. The getHandle() method returns the reply handle provided to the refresh() method call. This handle is merely the handle used for the asynchronous response, it is not associated with the QmfConsoleData in any other way. Use ObjectUpdateWorkItem to enable neater access. |
METHOD_RESPONSE: | The METHOD_RESPONSE WorkItem is generated in response to an asynchronous invokeMethod made by a QmfConsoleData object. The getParams() method will return a MethodResult object. The getHandle() method returns the reply handle provided to the refresh() method call. This handle is merely the handle used for the asynchronous response, it is not associated with the QmfConsoleData in any other way. Use MethodResponseWorkItem to enable neater access. |
EVENT_RECEIVED: | When an Agent generates a QmfEvent an EVENT_RECEIVED WorkItem is pushed onto the work-queue. The getParams() method returns a map which contains a reference to the Console Agent instance that generated the Event and a reference to the QmfEvent itself. The Agent reference is indexed from the map using the key string "agent, The QmfEvent reference is indexed from the map using the key string "event". There is no handle associated with this WorkItem. Use EventReceivedWorkItem to enable neater access. |
SUBSCRIBE_RESPONSE: | The SUBSCRIBE_RESPONSE WorkItem returns the result of a subscription request made by this Console. This WorkItem is generated when the Console's createSubscription() is called in an asychronous manner, rather than pending for the result. The getParams() method will return an instance of the SubscribeParams class. The SubscriptionId object must be used when the subscription is refreshed or cancelled. It must be passed to the Console's refresh_subscription() and cancelSubscription() methods. The value of the SubscriptionId does not change over the lifetime of the subscription. The console handle will be provided by the Agent on each data indication event that corresponds to this subscription. It should not change for the lifetime of the subscription. The getHandle() method returns the reply handle provided to the createSubscription() method call. This handle is merely the handle used for the asynchronous response, it is not associated with the subscription in any other way. Once a subscription is created, the Agent that maintains the subscription will periodically issue updates for the subscribed data. This update will contain the current values of the subscribed data, and will appear as the first SUBSCRIPTION_INDICATION WorkItem for this subscription. Use SubscribeResponseWorkItem to enable neater access. |
SUBSCRIPTION_INDICATION: | The SUBSCRIPTION_INDICATION WorkItem signals the arrival of an update to subscribed data from the Agent. The getParams() method will return an instance of the SubscribeIndication class. The getHandle() method returns null. Use SubscriptionIndicationWorkItem to enable neater access. |
RESUBSCRIBE_RESPONSE: | The RESUBSCRIBE_RESPONSE WorkItem is generated in response to a subscription refresh request made by this Console. This WorkItem is generated when the Console's refreshSubscription() is called in an asychronous manner, rather than pending for the result. The getParams() method will return an instance of the SubscribeParams class. The getHandle() method returns the reply handle provided to the refreshSubscription() method call. This handle is merely the handle used for the asynchronous response, it is not associated with the subscription in any other way. Use ResubscribeResponseWorkItem to enable neater access. |
METHOD_CALL: | The METHOD_CALL WorkItem describes a method call that must be serviced by the application on behalf of this Agent. The getParams() method will return an instance of the MethodCallParams class. Use MethodCallWorkItem to enable neater access. |
QUERY: | The QUERY WorkItem describes a query that the application must service. The application should call the queryResponse() method for each object that satisfies the query. When complete, the application must call the queryComplete() method. If a failure occurs, the application should indicate the error to the agent by calling the query_complete() method with a description of the error. The getParams() method will return an instance of the QmfQuery class. The getHandle() WorkItem method returns the reply handle which should be passed to the Agent's queryResponse() and queryComplete() methods. Use QueryWorkItem to enable neater access. |
SUBSCRIBE_REQUEST: | The SUBSCRIBE_REQUEST WorkItem provides a query that the agent application must periodically publish until the subscription is cancelled or expires. On receipt of this WorkItem, the application should call the Agent subscriptionResponse() method to acknowledge the request. On each publish interval, the application should call Agent subscriptionIndicate(), passing a list of the objects that satisfy the query. The subscription remains in effect until an UNSUBSCRIBE_REQUEST WorkItem for the subscription is received, or the subscription expires. The getParams() method will return an instance of the SubscriptionParams class. The getHandle() WorkItem method returns the reply handle which should be passed to the Agent's subscriptionResponse() method. Use SubscribeRequestWorkItem to enable neater access. |
RESUBSCRIBE_REQUEST: | The RESUBSCRIBE_REQUEST is sent by a Console to renew an existing subscription. The Console may request a new duration for the subscription, otherwise the previous lifetime interval is repeated. The getParams() method will return an instance of the ResubscribeParams class. The getHandle() WorkItem method returns the reply handle which should be passed to the Agent's subscriptionResponse() method. Use ResubscribeRequestWorkItem to enable neater access. |
UNSUBSCRIBE_REQUEST: | The UNSUBSCRIBE_REQUEST is sent by a Console to terminate an existing subscription. The Agent application should terminate the given subscription if it exists, and cancel sending any further updates against it. The getParams() method will return a String holding the subscriptionId. The getHandle() method returns null. Use UnsubscribeRequestWorkItem to enable neater access. |
The following diagram illustrates the QMF2 WorkItem class hierarchy.
@author Fraser Adams
WorkItemHandler
for execution. Whenever a work item is completed (or whenever the work item cannot be executed and should be aborted), the work item manager should be notified. For example, a work item could be created whenever an email needs to be sent. This work item would have a name that represents the type of work that needs to be executed (e.g. "Email") and parameters related to its execution (e.g. "From" = "me@mail.com", "To" = ..., "Body" = ..., ...). Result parameters can contain results related to the execution of this work item (e.g. "Success" = true).
@see org.drools.runtime.process.WorkItemHandler
@see org.drools.runtime.process.WorkItemManager
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|