IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.datagrid
Interface AgentManager


public interface AgentManager

The AgentManager is the primary interface for submitting MapGridAgent or ReduceGridAgent instances to the ObjectGrid. Every ObjectMap has an AgentManager and is retrieved using the ObjectMap.getAgentManager() method.

When security is enabled, these methods require permission: com.ibm.websphere.objectgrid.security.AgentPermission. The name of the AgentPermission is the full map name, and the actions are the agent implementation classes or packages. Refer to AgentPermission for more permission details.

Agents run in a transaction separate from the client transaction. Client transactions that are active when invoking the AgentManager methods are rolled-back when any exception occurs.

The MapGridAgent instance may include additional state, such as a query string or parameters, to eliminate some entries.

Since:
WAS XD 6.1

Method Summary
 Map callMapAgent(MapGridAgent agent)
          Routes the MapGridAgent instance and invokes the MapGridAgent.processAllEntries(com.ibm.websphere.objectgrid.Session, ObjectMap) method on all ObjectGrid server partitions and returns each result key and value in a map.
 Map callMapAgent(MapGridAgent agent, Collection keys)
          Routes the MapGridAgent instance and invokes the MapGridAgent.process(com.ibm.websphere.objectgrid.Session, ObjectMap, Object) method on each ObjectGrid server partition associated with the input keys and returns each result key and value in a Map.
 Object callReduceAgent(ReduceGridAgent agent)
          This performs performs a multi-level reduce operation on data in a map.
 Object callReduceAgent(ReduceGridAgent agent, Collection keys)
          This method performs a multi-level reduce operation on data in a map.
 

Method Detail

callMapAgent

Map callMapAgent(MapGridAgent agent,
                 Collection keys)
Routes the MapGridAgent instance and invokes the MapGridAgent.process(com.ibm.websphere.objectgrid.Session, ObjectMap, Object) method on each ObjectGrid server partition associated with the input keys and returns each result key and value in a Map.

Required Permission: AgentPermission

Parameters:
agent - The MapGridAgent instance to invoke on select partitions.
keys - The collection of keys. Each key determines which ObjectGrid server partition to route and invoke the agent.
Returns:
A Map holding the result for each processed key. A map entry value result may be of the type: EntryErrorValue if there was an error generating a result.

callMapAgent

Map callMapAgent(MapGridAgent agent)
Routes the MapGridAgent instance and invokes the MapGridAgent.processAllEntries(com.ibm.websphere.objectgrid.Session, ObjectMap) method on all ObjectGrid server partitions and returns each result key and value in a map.

Required Permission: AgentPermission

Parameters:
agent - The MapGridAgent instance to invoke on each partition.
Returns:
A Map holding the result for each processed key. A map entry value result may be of the type: EntryErrorValue if there was an error generating a result.

callReduceAgent

Object callReduceAgent(ReduceGridAgent agent,
                       Collection keys)
This method performs a multi-level reduce operation on data in a map. The ReduceGridAgent instance is routed to and the ReduceGridAgent.reduce(com.ibm.websphere.objectgrid.Session, ObjectMap, Collection) method is invoked on each ObjectGrid server partition associated with the input keys. The data may be further reduced using the ReduceGridAgent.reduceResults(Collection) method.

Required Permission: AgentPermission

Parameters:
agent - The ReduceGridAgent instance to invoke on select partitions.
keys - The collection of keys holding data to reduce.
Returns:
The reduced result, or EntryErrorValue

callReduceAgent

Object callReduceAgent(ReduceGridAgent agent)
This performs performs a multi-level reduce operation on data in a map. The ReduceGridAgent instance is routed and the ReduceGridAgent.reduce(com.ibm.websphere.objectgrid.Session, ObjectMap) method is invoked on all ObjectGrid server partitions. The data may be further reduced using the ReduceGridAgent.reduceResults(Collection) method.

The ReduceGridAgent instance may include additional state, such as a query string or parameters, to eliminate some entries.

Required Permission: AgentPermission

Parameters:
agent - The ReduceGridAgent instance to invoke.
Returns:
The reduced result, or EntryErrorValue

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.