com.sun.xml.ws.tx.coordinator
Class CoordinationManager

java.lang.Object
  extended by com.sun.xml.ws.tx.coordinator.CoordinationManager

public final class CoordinationManager
extends java.lang.Object

This singleton class is responsible for managing coordinated activities for the entire appserver.

Whenever a new coordinated activity is started, a new Coordinator object is constructed and managed by this class.

Since:
1.0

Method Summary
 Coordinator getCoordinator(java.lang.String id)
          Get the Coordinator object with the given coordination id
static CoordinationManager getInstance()
          Return the singleton instance of CoordinationManager.
 Coordinator lookupOrCreateCoordinator(CoordinationContextInterface context)
          Lookup if coordinator exists for context, if not, create a Coordinator object from the given coordination context and add it to the list of managed activities.
 Coordinator lookupOrCreateCoordinator(CreateCoordinationContextType contextRequest)
          Create a Coordinator object from the incoming request and add it to the list of managed activities.
 void putCoordinator(Coordinator coordinator)
          Add the specified Coordinator object to the list of managed activities.
 void removeCoordinator(java.lang.String id)
          Remove the specified Coordinator object from the list of managed activities.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CoordinationManager getInstance()
Return the singleton instance of CoordinationManager.

Returns:
the CoordinationManager instance

getCoordinator

@Nullable
public Coordinator getCoordinator(@NotNull
                                           java.lang.String id)
Get the Coordinator object with the given coordination id

Parameters:
id - the coordination context id
Returns:
the Coordinator object or null if the id doesn't exist

putCoordinator

public void putCoordinator(Coordinator coordinator)
Add the specified Coordinator object to the list of managed activities.

TODO: what about duplicate keys or entries?

Parameters:
coordinator - coordinator

removeCoordinator

public void removeCoordinator(@NotNull
                              java.lang.String id)
Remove the specified Coordinator object from the list of managed activities.

Parameters:
id - activity id

lookupOrCreateCoordinator

@NotNull
public Coordinator lookupOrCreateCoordinator(@NotNull
                                                     CreateCoordinationContextType contextRequest)
Create a Coordinator object from the incoming request and add it to the list of managed activities. The actual type of the Coordinator object created will depend on the Protocol specified in the contextRequest parameter.

This method is invoked when we receive a createCoordinationContext soap request.

Parameters:
contextRequest - the incoming wscoor:createCoordinationContext message
Returns:
the coordinator

lookupOrCreateCoordinator

@NotNull
public Coordinator lookupOrCreateCoordinator(@NotNull
                                                     CoordinationContextInterface context)
Lookup if coordinator exists for context, if not, create a Coordinator object from the given coordination context and add it to the list of managed activities. The actual type of the Coordinator object created will depend on the protocol identifier contained in the context.

This method is used for direct private invocation within the appserver.

Parameters:
context - the coordination context
Returns:
the coordinator