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

java.lang.Object
  extended by com.sun.xml.ws.tx.coordinator.Registrant
Direct Known Subclasses:
ATCompletion, ATParticipant

public abstract class Registrant
extends java.lang.Object

This class encapsulates a coordination registrant.

The coordination protocol implementations will extend this class and add protocol specific functionality.

Since:
1.0

Field Summary
protected static java.util.Map<java.lang.String,Registrant> outstandingRegistrants
           
 
Constructor Summary
protected Registrant(Coordinator parent, Protocol protocol)
          Create a Registratant with its coordinator parent for protocol.
  Registrant(Coordinator parent, RegisterType registerRequest)
          Create a new registrant
protected Registrant(Coordinator parent, java.lang.String protocolId)
           
 
Method Summary
abstract  void forget()
          Forget all resources associated with this Registrant
 Coordinator getCoordinator()
          Get the parent coordinator for this Registrant
 javax.xml.ws.EndpointReference getCoordinatorProtocolService()
           
 Identifier getId()
           
 java.lang.String getIdValue()
           
abstract  javax.xml.ws.EndpointReference getLocalParticipantProtocolService()
           
static Registrant getOutstandingRegistrant(java.lang.String id)
          Lookup outstanding registrant by id
 javax.xml.ws.EndpointReference getParticipantProtocolService()
           
 Protocol getProtocol()
          Get the protocol for this registrant
 RegisterType getRegisterRequest()
          Get the SOAP register request
 boolean isRegistrationCompleted()
           
 boolean isRemoteCPS()
           
 void register()
           
static Registrant removeOutstandingRegistrant(java.lang.String id)
          Remove outstanding registrant by its id.
 void setCoordinatorProtocolService(javax.xml.ws.EndpointReference cps)
          Set the coordinator protocol service received by coor:registerResponse.
 void setParticpantProtocolService(javax.xml.ws.EndpointReference pps)
           
 void setRegistrationCompleted(boolean value)
           
 void setRemoteCPS(boolean value)
           
 boolean waitForRegistrationResponse()
          wait for a registerResponse to arrive - this method is only used with remote CPSs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outstandingRegistrants

protected static final java.util.Map<java.lang.String,Registrant> outstandingRegistrants
Constructor Detail

Registrant

public Registrant(@NotNull
                  Coordinator parent,
                  @NotNull
                  RegisterType registerRequest)
Create a new registrant

Parameters:
registerRequest - request
parent - parent coordinator

Registrant

protected Registrant(Coordinator parent,
                     java.lang.String protocolId)

Registrant

protected Registrant(@NotNull
                     Coordinator parent,
                     @NotNull
                     Protocol protocol)
Create a Registratant with its coordinator parent for protocol.

Parameters:
parent - parent coordinator
protocol - activity protocol
Method Detail

setParticpantProtocolService

public void setParticpantProtocolService(@NotNull
                                         javax.xml.ws.EndpointReference pps)

getParticipantProtocolService

@NotNull
public javax.xml.ws.EndpointReference getParticipantProtocolService()

getRegisterRequest

@Nullable
public RegisterType getRegisterRequest()
Get the SOAP register request

Returns:
the SOAP register message

getProtocol

@NotNull
public Protocol getProtocol()
Get the protocol for this registrant

Returns:
the protocol identifier

getCoordinator

@NotNull
public Coordinator getCoordinator()
Get the parent coordinator for this Registrant

Returns:
the parent coordinator

getCoordinatorProtocolService

@NotNull
public javax.xml.ws.EndpointReference getCoordinatorProtocolService()

setCoordinatorProtocolService

public void setCoordinatorProtocolService(@NotNull
                                          javax.xml.ws.EndpointReference cps)
Set the coordinator protocol service received by coor:registerResponse.

Parameters:
cps - cps epr

register

public void register()

getId

@NotNull
public Identifier getId()

getIdValue

@NotNull
public java.lang.String getIdValue()

getOutstandingRegistrant

@Nullable
public static Registrant getOutstandingRegistrant(java.lang.String id)
Lookup outstanding registrant by id

Parameters:
id - registrant id
Returns:
the outstanding registrant or null if it doesn't exist

removeOutstandingRegistrant

@Nullable
public static Registrant removeOutstandingRegistrant(java.lang.String id)
Remove outstanding registrant by its id.

Parameters:
id - registrant id
Returns:
the outstanding registrant or null if it doesn't exist

setRemoteCPS

public void setRemoteCPS(boolean value)

isRemoteCPS

public boolean isRemoteCPS()

isRegistrationCompleted

public boolean isRegistrationCompleted()

setRegistrationCompleted

public void setRegistrationCompleted(boolean value)

waitForRegistrationResponse

public boolean waitForRegistrationResponse()
wait for a registerResponse to arrive - this method is only used with remote CPSs

Returns:
true if <RegistrationResponse> was received, false if there was a timeout.

getLocalParticipantProtocolService

public abstract javax.xml.ws.EndpointReference getLocalParticipantProtocolService()

forget

public abstract void forget()
Forget all resources associated with this Registrant