Fields Summary |
---|
private com.sun.xml.ws.tx.webservice.member.coord.RegisterType | registerRequest |
private final Coordinator | parent |
private final com.sun.xml.ws.api.tx.Protocol | protocol |
private EndpointReference | coordinatorProtocolService |
private static long | nextId |
private final com.sun.xml.ws.tx.common.RegistrantIdentifier | id |
private static com.sun.xml.ws.tx.common.TxLogger | logger |
private Boolean | registrationCompleted |
private Semaphore | registrationCompletedGate |
protected static final Map | outstandingRegistrants |
private boolean | remoteCPS |
Methods Summary |
---|
public abstract void | forget()Forget all resources associated with this Registrant
|
public Coordinator | getCoordinator()Get the parent coordinator for this Registrant
return parent;
|
public synchronized javax.xml.ws.EndpointReference | getCoordinatorProtocolService()
return coordinatorProtocolService;
|
public com.sun.xml.ws.tx.common.Identifier | getId()
return id;
|
public java.lang.String | getIdValue()
return id.getValue();
|
public abstract javax.xml.ws.EndpointReference | getLocalParticipantProtocolService()
|
public static com.sun.xml.ws.tx.coordinator.Registrant | getOutstandingRegistrant(java.lang.String id)Lookup outstanding registrant by id
return outstandingRegistrants.get(id);
|
public javax.xml.ws.EndpointReference | getParticipantProtocolService()
return (registerRequest == null) ?
getLocalParticipantProtocolService() :
registerRequest.getParticipantProtocolService();
|
public com.sun.xml.ws.api.tx.Protocol | getProtocol()Get the protocol for this registrant
return protocol;
|
private java.lang.String | getProtocolIdentifier()
switch (protocol) {
case COMPLETION:
return COMPLETION.getUri();
case DURABLE:
return DURABLE.getUri();
case VOLATILE:
return VOLATILE.getUri();
default:
return UNKNOWN.getUri();
}
|
public com.sun.xml.ws.tx.webservice.member.coord.RegisterType | getRegisterRequest()Get the SOAP register request
return registerRequest;
|
public boolean | isRegistrationCompleted()
return registrationCompleted;
|
public boolean | isRemoteCPS()
return remoteCPS;
|
public void | register()
RegistrationManager.getInstance().register(parent, this);
|
public static com.sun.xml.ws.tx.coordinator.Registrant | removeOutstandingRegistrant(java.lang.String id)Remove outstanding registrant by its id.
return outstandingRegistrants.remove(id);
|
public synchronized void | setCoordinatorProtocolService(javax.xml.ws.EndpointReference cps)Set the coordinator protocol service received by coor:registerResponse.
coordinatorProtocolService = cps;
setRegistrationCompleted(true);
|
public void | setParticpantProtocolService(javax.xml.ws.EndpointReference pps)
if (registerRequest == null) {
registerRequest = new RegisterType();
}
registerRequest.setProtocolIdentifier(this.getProtocolIdentifier());
registerRequest.setParticipantProtocolService((MemberSubmissionEndpointReference) pps);
|
public synchronized void | setRegistrationCompleted(boolean value)
registrationCompleted = value;
if (isRemoteCPS()) {
if (logger.isLogging(Level.FINEST)) {
logger.finest(
"setRegistrationCompleted(" + value + ")",
"semaphore has " + registrationCompletedGate.availablePermits() + " permits.");
}
if (value) {
assert (registrationCompletedGate.availablePermits() <= 0);
registrationCompletedGate.release();
if (logger.isLogging(Level.FINEST)) {
logger.finest(
"setRegistrationCompleted(" + value + ")",
"released a permit, semaphore now has " + registrationCompletedGate.availablePermits() + " permits.");
}
}
}
|
public void | setRemoteCPS(boolean value)
remoteCPS = value;
|
public boolean | waitForRegistrationResponse()wait for a registerResponse to arrive - this method is only used with remote CPSs
try {
if(logger.isLogging(Level.FINEST)) {
logger.finest("waitForRegistrationResponse", "semaphore should have 0 permits. actual available permits: " + registrationCompletedGate.availablePermits());
assert (registrationCompletedGate.availablePermits() <= 0);
logger.finest("waitForRegistrationResponse", "Waiting for registration response. Calling tryAcquire()...");
}
return !registrationCompletedGate.tryAcquire(1, 40, TimeUnit.SECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
return false;
}
|