de.danet.an.workflow.spis.rms
Class ResourceSupport

java.lang.Object
  extended byde.danet.an.workflow.spis.rms.ResourceSupport
All Implemented Interfaces:
Serializable, WfObject, WfResource

public abstract class ResourceSupport
extends Object
implements WfResource, Serializable

This class provides the standard implementation of the WfResource methods workItems, isMemberOfWorkItems and release. The class uses the ResourceAssignmentServiceFactory as described in de.danet.an.workflow.spis.rms. The class caches the resource factory obtained from the first call to ResourceAssignmentServiceFactory.newInstance().

See Also:
Serialized Form

Constructor Summary
protected ResourceSupport(ResourceAssignmentService assignSvc)
          The constructor.
 
Method Summary
 boolean isMemberOfWorkItems(WfAssignment assignment)
          Checks if a given WfAssignment is associated with this resource.
 void release(WfAssignment fromAssignment, String releaseInfo)
          Signals to the resource that it is no longer needed for a specific assignment.
 Collection workItems()
          This method returns the WfAssignmentss associated with a resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.danet.an.workflow.omgcore.WfResource
resourceKey, resourceName
 

Constructor Detail

ResourceSupport

protected ResourceSupport(ResourceAssignmentService assignSvc)
The constructor. It asures that a valid factory exists.

Parameters:
assignSvc - the resource assignment service.
Method Detail

workItems

public Collection workItems()
                     throws RemoteException,
                            IllegalStateException
This method returns the WfAssignmentss associated with a resource.

Specified by:
workItems in interface WfResource
Returns:
the associated WfAssignmentss.
Throws:
RemoteException - if a system-level error occurs.
IllegalStateException - if the resource has become invalid. This is actually a remapping of the NoSuchResourceException thrown by ResourceAssignmentService.workItems(). It must be remapped because this method's signature is specified by WfResource.workItems().

isMemberOfWorkItems

public boolean isMemberOfWorkItems(WfAssignment assignment)
                            throws RemoteException,
                                   IllegalStateException
Checks if a given WfAssignment is associated with this resource.

Specified by:
isMemberOfWorkItems in interface WfResource
Parameters:
assignment - the assignment in question.
Returns:
true if the association exists.
Throws:
RemoteException - if a system-level error occurs. This is actually a remapping of the NoSuchResourceException thrown by ResourceAssignmentService.isMemberOfWorkItems(...). It must be remapped because this method's signature is specified by WfResource.isMemberOfWorkItems(...).
IllegalStateException - if the resource has become invalid.

release

public void release(WfAssignment fromAssignment,
                    String releaseInfo)
             throws RemoteException,
                    NotAssignedException
Signals to the resource that it is no longer needed for a specific assignment. The default implementation calls removeAssignment on the activity.

Specified by:
release in interface WfResource
Parameters:
fromAssignment - the specific assignment.
releaseInfo - specifies additional information on the reason for realizing the resource as input.
Throws:
NotAssignedException - if the resource is not associated with the given assignment.
RemoteException - if a system-level error occurs.