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

com.tangosol.net
Interface InvocationService

All Superinterfaces:
ClassLoaderAware, Controllable, Service

public interface InvocationService
extends Service

The InvocationService is a Service for delivering executable objects to cluster members for distributed invocation. The executable objects must implement the Invocable interface, which extends the Java Runnable interface. Using this interface, application code can cause execution of an Invocable object to occur on any one, any set of, or all cluster members that are running the InvocationService.

Note: The InvocationService is a feature of the Coherence Application Edition or Grid Edition. This service cannot be used in a Coherence Standard Edition cluster.

Since:
Coherence 2.1
Author:
cp 2003-01-05

Field Summary
static String TYPE_DEFAULT
          Invocation service type constant.
static String TYPE_REMOTE
          Remote invocation service type constant.
 
Method Summary
 void execute(Invocable task, Set setMembers, InvocationObserver observer)
          Asynchronously invoke the specified task on each of the specified members.
 Map query(Invocable task, Set setMembers)
          Synchronously invoke the specified task on each of the specified members.
 
Methods inherited from interface com.tangosol.net.Service
addMemberListener, getCluster, getInfo, getUserContext, removeMemberListener, setUserContext
 
Methods inherited from interface com.tangosol.util.Controllable
configure, getContextClassLoader, isRunning, setContextClassLoader, shutdown, start, stop
 

Field Detail

TYPE_DEFAULT

static final String TYPE_DEFAULT
Invocation service type constant.

See Also:
Cluster.ensureService(String, String), Constant Field Values

TYPE_REMOTE

static final String TYPE_REMOTE
Remote invocation service type constant.

See Also:
Cluster.ensureService(String, String), Constant Field Values
Method Detail

execute

void execute(Invocable task,
             Set setMembers,
             InvocationObserver observer)
Asynchronously invoke the specified task on each of the specified members. This method may return before the task is executed, or before it finishes executing, or after it finishes executing, or any of the above; however, it is expected that aggressive implementations will attempt to return as quickly as possible.

Parameters:
task - the Invocable object to distribute to the specified members in order to be invoked on those members
setMembers - (optional) a set of cluster members to which the Invocable object will be distributed; if null, the Invocable object will be distributed to all cluster members that are running this service
observer - (optional) the InvocationObserver object that will receive notifications related to the Invocable object

query

Map query(Invocable task,
          Set setMembers)
Synchronously invoke the specified task on each of the specified members. This method will not return until the specified members have completed their processing, failed in their processing, or died trying.

Members that are specified but are not currently running the InvocationService will not invoke the specified Invocable object. Members that leave (gracefully or otherwise) before the invocation completes will not register a result, and the amount of processing that completed is indeterminate. Members that encounter an exception during invocation will not be retried; whatever result has been registered by that point by that member for that Invocable object will be returned. Specifically, the result for a given member will be not be present under the following conditions:

Parameters:
task - the Invocable object to distribute to the specified members in order to be invoked on those members
setMembers - (optional) a set of cluster members to which the Invocable object will be distributed; if null, the Invocable object will be distributed to all cluster members that are running this service
Returns:
a Map of result objects keyed by Member object

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