CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.coherence.commonj
Class WorkManager.RemoteWorkManager

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.coherence.commonj.WorkManager.RemoteWorkManager
All Implemented Interfaces:
commonj.work.WorkManager
Enclosing class:
WorkManager

protected class WorkManager.RemoteWorkManager
extends Base
implements commonj.work.WorkManager

RemoteWorkManager is a delegating WorkManager wrapper.


Field Summary
protected  Member m_memberPinned
          The service Member this RemoteWorkManager is pinned to.
 
Fields inherited from interface commonj.work.WorkManager
IMMEDIATE, INDEFINITE
 
Constructor Summary
WorkManager.RemoteWorkManager(Member memberPinned)
           
 
Method Summary
 commonj.work.WorkItem schedule(commonj.work.Work work)
          Dispatches a Work asynchronously.
 commonj.work.WorkItem schedule(commonj.work.Work work, commonj.work.WorkListener workListener)
          Dispatches a Work asynchronously.
protected  commonj.work.WorkItem schedule(commonj.work.Work work, commonj.work.WorkListener workListener, Member member)
          Accepts a Work instance for processing at the specified Member.
 boolean waitForAll(Collection collWorkItems, long lTimeoutMillis)
           
 Collection waitForAny(Collection collWorkItems, long lTimeoutMillis)
           
 

Field Detail

m_memberPinned

protected Member m_memberPinned
The service Member this RemoteWorkManager is pinned to.

Constructor Detail

WorkManager.RemoteWorkManager

public WorkManager.RemoteWorkManager(Member memberPinned)
Method Detail

schedule

public commonj.work.WorkItem schedule(commonj.work.Work work)
                               throws commonj.work.WorkException,
                                      IllegalArgumentException
Dispatches a Work asynchronously. The work is dispatched and the method returns immediately.

If a JVM that this pinned WorkManager represents has failed then a WorkRejectedException will be thrown even if the remote JVM restarts. The pinned WorkManager must be refreshed by using a normal WorkManager and then acquiring a new pinned WorkManager.

Specified by:
schedule in interface commonj.work.WorkManager
Parameters:
work - the Work to execute
Returns:
the WorkItem representing the asynchronous work; since the Work must be serializable, a RemoteWorkItem is always returned
Throws:
commonj.work.WorkException - thrown if queuing this up results in an exception
IllegalArgumentException

schedule

public commonj.work.WorkItem schedule(commonj.work.Work work,
                                      commonj.work.WorkListener workListener)
                               throws commonj.work.WorkException,
                                      IllegalArgumentException
Dispatches a Work asynchronously. The work is dispatched and the method returns immediately.

If a JVM that this pinned WorkManager represents has failed then a WorkRejectedException will be thrown even if the remote JVM restarts. The pinned WorkManager must be refreshed by using a normal WorkManager and then acquiring a new pinned WorkManager.

Specified by:
schedule in interface commonj.work.WorkManager
Parameters:
work - the Work to execute
Returns:
the WorkItem representing the asynchronous work; since the Work must be serializable, a RemoteWorkItem is always returned
Throws:
commonj.work.WorkException - thrown if queuing this up results in an exception
IllegalArgumentException

schedule

protected commonj.work.WorkItem schedule(commonj.work.Work work,
                                         commonj.work.WorkListener workListener,
                                         Member member)
                                  throws commonj.work.WorkException
Accepts a Work instance for processing at the specified Member.

Throws:
commonj.work.WorkException

waitForAll

public boolean waitForAll(Collection collWorkItems,
                          long lTimeoutMillis)
                   throws InterruptedException,
                          IllegalArgumentException
Specified by:
waitForAll in interface commonj.work.WorkManager
Throws:
InterruptedException
IllegalArgumentException
See Also:
WorkManager.waitForAll(java.util.Collection, long)

waitForAny

public Collection waitForAny(Collection collWorkItems,
                             long lTimeoutMillis)
                      throws InterruptedException,
                             IllegalArgumentException
Specified by:
waitForAny in interface commonj.work.WorkManager
Throws:
InterruptedException
IllegalArgumentException
See Also:
WorkManager.waitForAny(java.util.Collection, long)

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation