Methods Summary |
---|
private Coordinator | createCoordinator(CoordinationContextInterface context, com.sun.xml.ws.tx.webservice.member.coord.CreateCoordinationContextType contextRequest)create a {@link Coordinator} from either the given context or the given request.
One of these parameters MUST be null, one of them MUST be non-null.
assert((context == null) ^ (contextRequest == null)); // xor
if (logger.isLogging(Level.FINER)) {
logger.entering("CoordinationManager.createCoordinator");
}
final String coordType;
if (contextRequest == null) {
coordType = context.getCoordinationType();
} else {
coordType = contextRequest.getCoordinationType();
}
if (WSAT_2004_PROTOCOL.equals(coordType)) {
final Coordinator coord;
if (contextRequest == null) {
coord = context.getRootRegistrationService() == null ?
new ATCoordinator(context) : new ATSubCoordinator(context);
} else {
coord = contextRequest.getCurrentContext() == null ?
new ATCoordinator(ContextFactory.createContext(contextRequest), contextRequest) :
new ATSubCoordinator(ContextFactory.createContext(contextRequest), contextRequest);
}
if (logger.isLogging(Level.FINEST)) {
logger.finest("CoordinationManager.createCoordinator id=", coord.getIdValue());
}
if (logger.isLogging(Level.FINER)) {
logger.exiting("CoordinationManager.createCoordinator");
}
return coord;
} else if (WSAT_OASIS_NSURI.equals(coordType)) {
throw new UnsupportedOperationException(
LocalizationMessages.OASIS_UNSUPPORTED_3000()
);
} else {
throw new UnsupportedOperationException(
LocalizationMessages.UNRECOGNIZED_COORDINATION_TYPE_3001(coordType)
);
}
|
private Coordinator | createSubordinateCoordinator(CoordinationContextInterface context, com.sun.xml.ws.tx.webservice.member.coord.CreateCoordinationContextType contextRequest)Create a {@link Coordinator} that delegates to a root coordinator that is probably on a remote
system not under our control.
One of these parameters MUST be null, one of them MUST be non-null.
assert((context == null) ^ (contextRequest == null)); // xor
if (logger.isLogging(Level.FINER)) {
logger.entering("CoordinationManager.createSubordinateCoordinator");
}
if (context == null) {
if (logger.isLogging(Level.FINER)) {
logger.exiting("CoordinationManager.createSubordinateCoordinator");
}
// in this case, the context should already have the registration EPRs initialized
// properly, so we don't have to swap - just create a new coordinator
return createCoordinator(null, contextRequest);
} else {
// replace the registration service EPR with our own, but remember the EPR of the
// root coordinator's registration EPR for delegation.
context.setRootCoordinatorRegistrationService(context.getRegistrationService());
// delegate
final Coordinator coord = createCoordinator(context, null);
context.setRegistrationService(RegistrationManager.newRegistrationEPR((ActivityIdentifier) coord.getId()));
if (logger.isLogging(Level.FINER)) {
logger.exiting("CoordinationManager.createSubordinateCoordinator");
}
return coord;
}
|
public Coordinator | getCoordinator(java.lang.String id)Get the {@link Coordinator} object with the given coordination id
return coordinators.get(id);
|
public static com.sun.xml.ws.tx.coordinator.CoordinationManager | getInstance()Return the singleton instance of CoordinationManager.
return instance;
|
public Coordinator | lookupOrCreateCoordinator(com.sun.xml.ws.tx.webservice.member.coord.CreateCoordinationContextType contextRequest)Create a {@link Coordinator} object from the incoming request and
add it to the list of managed activities. The actual type of the
{@link Coordinator} object created will depend on the
{@link com.sun.xml.ws.api.tx.Protocol} specified in the contextRequest
parameter.
This method is invoked when we receive a createCoordinationContext soap
request.
Coordinator c;
if (contextRequest.getCurrentContext() == null) {
c = createCoordinator(null, contextRequest);
} else {
c = createSubordinateCoordinator(null, contextRequest);
}
putCoordinator(c);
return c;
|
public Coordinator | lookupOrCreateCoordinator(CoordinationContextInterface context)Lookup if coordinator exists for context, if not, create a {@link Coordinator} object from the given coordination
context and add it to the list of managed activities. The actual
type of the {@link Coordinator} object created will depend on the
protocol identifier contained in the context.
This method is used for direct private invocation within the
appserver.
Coordinator c = getCoordinator(context.getIdentifier());
if (c == null) {
// If registration service EPR is not created locally, make this a subordinate coordinator
if (RegistrationManager.getRegistrationCoordinatorStatefulWebServiceManager().resolve(context.getRegistrationService()) == null) {
c = createSubordinateCoordinator(context, null);
} else {
c = createCoordinator(context, null);
}
}
putCoordinator(c);
return c;
|
public void | putCoordinator(Coordinator coordinator)Add the specified {@link Coordinator} object to the list of managed
activities.
TODO: what about duplicate keys or entries?
coordinators.put(coordinator.getIdValue(), coordinator);
if (logger.isLogging(Level.FINEST)) {
logger.finest("putCoordinator", "add activity id:" + coordinator.getIdValue());
}
|
public void | removeCoordinator(java.lang.String id)Remove the specified {@link Coordinator} object from the list of managed
activities.
final Coordinator c = coordinators.remove(id);
if(c!=null) {
c.forget();
}
if (logger.isLogging(Level.FINEST)) {
logger.finest("removeCoordinator", "remove activity id:" + id);
}
|