Methods Summary |
---|
public static CoordinationContextInterface | createContext(java.lang.String coordType, long expires)Create a new {@link CoordinationContextInterface} of the appropriate type based on
the coordination type namespace uri.
if (logger.isLogging(Level.FINER)) {
logger.entering("ContextFactory.createContext: coordType=" + coordType + " expires=" + expires);
}
CoordinationContextInterface context;
if (WSAT_2004_PROTOCOL.equals(coordType)) {
context = new CoordinationContext200410();
context.setCoordinationType(coordType);
context.setExpires(expires);
activityId = UUID.randomUUID().toString();
context.setIdentifier("uuid:WSCOOR-SUN-" + activityId);
// bake the activity id as <wsa:ReferenceParameters> into the registration service EPR, so we can
// identify the activity when the <register> requests come in.
context.setRegistrationService(
RegistrationManager.newRegistrationEPR(
new ActivityIdentifier(context.getIdentifier())));
} else if (WSAT_OASIS_NSURI.equals(coordType)) {
throw new UnsupportedOperationException(
LocalizationMessages.OASIS_UNSUPPORTED_3000()
);
} else {
throw new UnsupportedOperationException(
LocalizationMessages.UNRECOGNIZED_COORDINATION_TYPE_3001(coordType)
);
}
if (logger.isLogging(Level.FINER)) {
logger.exiting("ContextFactory.createContext: created context for activity id: " + context.getIdentifier());
}
return context;
|
public static CoordinationContextInterface | createContext(com.sun.xml.ws.tx.webservice.member.coord.CreateCoordinationContextType contextRequest)Create a context from the incoming message
return createContext(contextRequest.getCoordinationType(), contextRequest.getExpires().getValue());
|
static CoordinationContextInterface | createTestContext(java.lang.String coordType, long expires)
CoordinationContextInterface context;
if (WSAT_2004_PROTOCOL.equals(coordType)) {
context = new CoordinationContext200410();
context.setCoordinationType(coordType);
context.setExpires(expires);
activityId = UUID.randomUUID().toString();
context.setIdentifier("uuid:WSCOOR-SUN-" + activityId);
// we can't unit test the normal creation of an EPR this way because
// it requires the use of injected stateful webservice managers on
// the port type impls. So set a dummy EPR instead.
//
// ActivityIdentifier activityId = new ActivityIdentifier(context.getIdentifier());
// context.setRegistrationService(RegistrationManager.newRegistrationEPR(activityId));
context.setRegistrationService(new MemberSubmissionEndpointReference());
} else if (WSAT_OASIS_NSURI.equals(coordType)) {
throw new UnsupportedOperationException(
LocalizationMessages.OASIS_UNSUPPORTED_3000()
);
} else {
throw new UnsupportedOperationException(
LocalizationMessages.UNRECOGNIZED_COORDINATION_TYPE_3001(coordType)
);
}
return context;
|