Interface SequenceManager
-
- All Superinterfaces:
com.sun.xml.ws.commons.MOMRegistrationAware,TimeSynchronizer
- All Known Implementing Classes:
InVmSequenceManager,PersistentSequenceManager
@ManagedObject @Description("Reliable Messaging Sequence Manager") @AMXMetadata(type="WSRMSequenceManager") public interface SequenceManager extends TimeSynchronizer, com.sun.xml.ws.commons.MOMRegistrationAware- Author:
- Marek Potociar (marek.potociar at sun.com)
-
-
Field Summary
Fields Modifier and Type Field Description static StringMANAGED_BEAN_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbindSequences(String referenceSequenceId, String boundSequenceId)Binds two sequences together.Map<String,String>boundSequences()SequencecloseSequence(String sequenceId)Closes an existing sequence.longconcurrentlyOpenedInboundSequencesCount()SequencecreateInboundSequence(String sequenceId, String strId, long expirationTime)Creates a new inbound sequence objectSequencecreateOutboundSequence(String sequenceId, String strId, long expirationTime)Creates a new outbound sequence object with a given Id.voiddispose()Tells theSequenceManagerthat it is going to be disposed.StringgenerateSequenceUID()Generates a unique identifier of a sequenceSequencegetBoundSequence(String referenceSequenceId)Retrieves a sequence previously bound to the reference sequenceSequencegetInboundSequence(String sequenceId)Retrieves an existing inbound sequence from the internal sequence storageSequencegetOutboundSequence(String sequenceId)Retrieves an existing outbound sequence from the internal sequence storageSequencegetSequence(String sequenceId)Retrieves an existing sequence from the internal sequence storagevoidinvalidateCache()Instructs theSequenceManagerinstance to invalidate it's local cache.booleanisValid(String sequenceId)Provides information on whether the sequence identifier is a valid identifier that belongs to an existing sequence registered with the sequence manager.booleanonMaintenance()Terminates all sequences that became expired in the meantime and removes all previously terminated sequences that were terminated sooner than a pre-configured period of time.booleanpersistent()Map<String,Sequence>sequences()SequenceterminateSequence(String sequenceId)Terminates an existing sequence by calling theSequence.preDestroy()method.StringuniqueEndpointId()-
Methods inherited from interface com.sun.xml.ws.commons.MOMRegistrationAware
isRegisteredAtMOM, setRegisteredAtMOM
-
Methods inherited from interface com.sun.xml.ws.rx.util.TimeSynchronizer
currentTimeInMillis
-
-
-
-
Field Detail
-
MANAGED_BEAN_NAME
static final String MANAGED_BEAN_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
boundSequences
@ManagedAttribute @Description("Collection of sequence ID pairs that form an RM session") Map<String,String> boundSequences()
-
uniqueEndpointId
@ManagedAttribute @Description("Unique identifier of the WS endpoint for which this particular sequence manager will be used") String uniqueEndpointId()
-
persistent
@ManagedAttribute @Description("Determines whether this implementation of SeqenceManager is persistent") boolean persistent()
-
concurrentlyOpenedInboundSequencesCount
@ManagedAttribute @Description("Number of concurrently opened (not terminated) inbound sequences (determines number of concurrent RM sessions)") long concurrentlyOpenedInboundSequencesCount()
-
closeSequence
Sequence closeSequence(String sequenceId) throws UnknownSequenceException
Closes an existing sequence. The closed sequence is still kept in the internal sequence storage- Parameters:
sequenceId- the unique sequence identifier- Returns:
- closed sequence object
- Throws:
UnknownSequenceException
-
createOutboundSequence
Sequence createOutboundSequence(String sequenceId, String strId, long expirationTime) throws DuplicateSequenceException
Creates a new outbound sequence object with a given Id. It is assumed that RM handshake has been already established, thus no RM handshake is performed.- Parameters:
sequenceId- identifier of the new sequencestrId- security reference token identifier which this session is bound toexpirationTime- expiration time of the sequence in milliseconds; value ofcom.sun.xml.ws.rm.policy.Configuration#UNSPECIFIEDmeans that this sequence never expires.- Returns:
- newly created inbound sequence
- Throws:
DuplicateSequenceExcepton- in case a sequence instance with this identifier is already registered with this sequence managerDuplicateSequenceException
-
createInboundSequence
Sequence createInboundSequence(String sequenceId, String strId, long expirationTime) throws DuplicateSequenceException
Creates a new inbound sequence object- Parameters:
sequenceId- identifier of the new sequencestrId- security reference token identifier which this session is bound toexpirationTime- expiration time of the sequence in milliseconds; value ofcom.sun.xml.ws.rm.policy.Configuration#UNSPECIFIEDmeans that this sequence never expires.- Returns:
- newly created inbound sequence
- Throws:
DuplicateSequenceExcepton- in case a sequence instance with this identifier is already registered with this sequence managerDuplicateSequenceException
-
generateSequenceUID
String generateSequenceUID()
Generates a unique identifier of a sequence- Returns:
- new unique sequence identifier which can be used to construct a new sequence.
-
getSequence
Sequence getSequence(String sequenceId) throws UnknownSequenceException
Retrieves an existing sequence from the internal sequence storage- Parameters:
sequenceId- the unique sequence identifier- Returns:
- sequence identified with the
sequenceIdidentifier - Throws:
UnknownSequenceException- in case no such sequence is registered within the sequence manager
-
getInboundSequence
Sequence getInboundSequence(String sequenceId) throws UnknownSequenceException
Retrieves an existing inbound sequence from the internal sequence storage- Parameters:
sequenceId- the unique sequence identifier- Returns:
- sequence identified with the
sequenceIdidentifier - Throws:
UnknownSequenceException- in case no such sequence is registered within the sequence manager or in case the registered sequence was not created as inbound.
-
getOutboundSequence
Sequence getOutboundSequence(String sequenceId) throws UnknownSequenceException
Retrieves an existing outbound sequence from the internal sequence storage- Parameters:
sequenceId- the unique sequence identifier- Returns:
- sequence identified with the
sequenceIdidentifier - Throws:
UnknownSequenceException- in case no such sequence is registered within the sequence manager or in case the registered sequence was not created as outbound.
-
isValid
boolean isValid(String sequenceId)
Provides information on whether the sequence identifier is a valid identifier that belongs to an existing sequence registered with the sequence manager.- Parameters:
sequenceId- sequence identifier to be checked- Returns:
truein case the sequence identifier is valid,falseotherwise
-
terminateSequence
Sequence terminateSequence(String sequenceId) throws UnknownSequenceException
Terminates an existing sequence by calling theSequence.preDestroy()method. In addition to this, the terminated sequence is removed from the internal sequence storage- Parameters:
sequenceId- the unique sequence identifier- Returns:
- terminated sequence object
- Throws:
UnknownSequenceExceptio- in case no such sequence is registered within the sequence managerUnknownSequenceException
-
bindSequences
void bindSequences(String referenceSequenceId, String boundSequenceId) throws UnknownSequenceException
Binds two sequences together. This method is mainly intended to be used for binding together request and response sequences.- Parameters:
referenceSequenceId- a reference sequence identifier to which the other sequence shall be bound.boundSequenceId- a bound sequence identifier- Throws:
UnknownSequenceException- in case any of the sequence identifiers does not represent a valid sequence
-
getBoundSequence
Sequence getBoundSequence(String referenceSequenceId) throws UnknownSequenceException
Retrieves a sequence previously bound to the reference sequence- Parameters:
referenceSequenceId- a reference sequence identifier to which the other sequence has been bound.- Returns:
- bound sequence or
nullin case no sequence is bound to the reference sequence - Throws:
UnknownSequenceExceptio- in case no such reference sequence is registered within the sequence managerUnknownSequenceException
-
onMaintenance
boolean onMaintenance()
Terminates all sequences that became expired in the meantime and removes all previously terminated sequences that were terminated sooner than a pre-configured period of time. This maintenance method is intended to be called externally by aSequenceMaintenanceTaskinstance associated with thisSequenceManager.- Returns:
trueif the next maintenance execution task is supposed to be scheduled,falseotherwise.
-
invalidateCache
void invalidateCache()
Instructs theSequenceManagerinstance to invalidate it's local cache. This prevents stale data being used and ensures that fresh data are loaded from the RM HA backing stores.
-
dispose
void dispose()
Tells theSequenceManagerthat it is going to be disposed. An implementation of this interface can use the method to do the necessary resource cleanup.
-
-