weblogic.wsee.reliability
Class WsrmUtils

This class is a utility class for using Web Services Reliable Messaging (WSRM)
given a service stub (WLStub) instance. It allows you to do common things
such as setting configuration options, getting the sequence id,
and terminating a reliable sequence.

WsrmUtils

public WsrmUtils()

Method Detail

isSequenceInitialized

public static boolean isSequenceInitialized(Stub stub)

Convenience method to check if a given stub has had its
sequence created and fully initialized. This method is useful for waiting
to try to send acknowledgement requests, or to close/terminate a sequence.

Parameters:

stub - The stub that carries the reliable sequence.

Returns:

True if the sequence is fully initialized.

waitForSequenceInitialization

public static StringwaitForSequenceInitialization(Stub stub,
long waitIntervalInMillis,
long maxWaitIntervals)

Convenience method to wait until a given stub has had its
sequence created and fully initialized. This method is useful for waiting
to try to send acknowledgement requests, or to close/terminate a sequence.

Parameters:

stub - The stub that carries the reliable sequence.

waitIntervalInMillis - The number of milliseconds to wait at each
interval (before checking the sequence again).

maxWaitIntervals - The maximum number of times to recheck the
sequence.

sendEmptyLastMessage

public static void sendEmptyLastMessage(Stub stub)

This method is used to send an empty last message according to the WSRM spec. This will
complete the reliable sequence. No further reliable message should be sent on this stub.
Note, you should insure the sequence is initialized prior to calling this method.

Parameters:

stub - The jaxrpc stub that's used to carry the reliable sequence.

Throws:

JAXRPCException - This exception is thrown when there are errors in sending the
mesage.

closeSequence

public static void closeSequence(Stub stub)

This method is used to close a reliable sequence on the given stub.
No further reliable messages may be sent on this stub. This method allows
the client to get a full and final reckoning for the reliable sequence,
and decide how to proceed if there are unacknowleged messages.

Parameters:

stub - The jaxrpc stub that's used to carry the reliable sequence.

Throws:

JAXRPCException - This exception is thrown when there are errors in
closing the sequence.

terminateSequence

public static void terminateSequence(Stub stub)

This method is used to terminate a reliable sequence on the given stub. No further
reliable messages should be sent on this stub.
Note, you should insure the sequence is initialized prior to calling this method.

Parameters:

stub - The jaxrpc stub that's used to carry the reliable sequence.

Throws:

JAXRPCException - This exception is thrown when there are errors in terminating
the sequence.

reset

public static void reset(Stub stub)

This method is used to clear any reliable sequence on the given stub, thus
allowing a new sequence to be started using this stub.
This method first terminates the sequence on the stub, and then clears
the sequence from it.

Parameters:

stub - The jaxrpc stub that's used to carry the reliable sequence.

Throws:

JAXRPCException - This exception is thrown when there are errors in
resetting the stub.

setExpires

This method sets the expiration time of the reliable sequence on the client side.
This value is then negotiated with the server side value to come up with the
final expiration time. If this value is not set, the value specified in the policy
file will be used.

getOfferExpires

This method gets the expiration time that was previously set on the offered
reliable sequence.

Parameters:

stub - The jaxrpc stub that's used to carry the reliable sequence.

Returns:

The duration of the reliable sequence.

setAnonymousAck

public static void setAnonymousAck(Stub stub)

This method allows to use anonymous acknowledgement according to the WSRM specification.

Parameters:

stub - The jaxrpc stub that's used to carry the reliable sequence.

isAnonymousAck

public static boolean isAnonymousAck(Stub stub)

This method determines whether anonymous acknowledgement is used.

Parameters:

stub - The jaxrpc stub that's used to carry the reliable sequence.

Returns:

Whether anonymous acknowledgement is used.

setLastMessage

public static void setLastMessage(Stub stub)

This method sets the next message sent to be the last message.

Parameters:

stub - The jaxrpc stub that's used to carry the reliable sequence.

isLastMessage

public static boolean isLastMessage(Stub stub)

This method determines whether the last message property has been previously set.

Parameters:

stub - The jaxrpc stub that's used to carry the reliable sequence.

Returns:

Whether last message property has been set.

setFinalMessage

public static void setFinalMessage(Stub stub)

Sets a flag on this service handle indicating that the next message sent
using the handle will be the 'final' request to be sent. Thus, you would
call this method before invoking an operation on the service handle. Note,
this method is fundamentally different than setting 'last' message (calling
setLastMessage) in that setting the 'final' message is BEA-specific, and
triggers BEA-specific behavior.

Setting this flag (and after sending the final message) will
trigger the reliable messaging subsystem to start looking for
acknowledgements for all messages up to and including the final message.
When RM receives acknowledgements for all messages up to the final message,
it will auto-terminate the sequence being maintained for this service
handle. Note that auto-terminate will also
auto-terminate any offer sequence (being used to send reliable responses
to the requests sent by this service handle) once acknowlegements for all
responses have been received.

Parameters:

stub - The stub for a service that's used to carry the reliable
sequence.

isFinalMessage

public static boolean isFinalMessage(Stub stub)

This method determines whether the final message has been sent on the
sequence for this stub.

Parameters:

stub - The stub for a service that's used to carry the reliable
sequence.

printSoapMsg

Dumps the contents of a SOAPMessage to the WSEE Verbose.getOut() output
stream. Note, use of this method on the receiving channel of a connection
(i.e. the message received from a connection) is discouraged as it can
reset the input stream used to read the message, and prevent attachments
to the message (deferred until later) from being read.

Copyright 1996, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.