Fields Summary |
---|
protected com.sun.xml.ws.api.message.Message | messageThe JAX-WS Message wrapped by this instance. |
protected Sequence | sequenceThe Sequence to which the message belongs. |
protected int | messageNumberThe messageNumber of the Message in its Sequence. |
protected boolean | isWaitingFlag which is true if and only if the message is waiting for
a notification. |
protected boolean | isCompleteFlag indicating whether message is delivered/acked.
The meaning differs according to the type of sequence
to which the message belongs. The value must only be
changed using the complete() method, which should only
be invoked by the Sequence containing the message. |
protected Message | relatedMessageFor messages belonging to 2-way MEPS, the corresponding message. |
protected com.sun.xml.ws.rm.protocol.SequenceElement | sequenceElementSequence stored when the corresponding com.sun.xml.ws.api.message.Header
is added to the message. |
protected com.sun.xml.ws.rm.protocol.SequenceAcknowledgementElement | sequenceAcknowledgementElementSequenceElement stored when the corresponding com.sun.xml.ws.api.message.Header
is added to the message. |
protected com.sun.xml.ws.rm.protocol.AckRequestedElement | ackRequestedElementSequenceElement stored when the corresponding com.sun.xml.ws.api.message.Header
is added to the message. |
public boolean | isTwoWayRequestWhen true, indicates that the message is a request message for
a two-way operation. ClientOutboundSequence with anonymous
AcksTo has to handle Acknowledgements differently in this case. |
public boolean | isOneWayResponseSet in empty message used to piggyback response
headers on a one-way response. |
public static final String | namespaceURINamespace URI corresponding to RM version. |
Methods Summary |
---|
public void | addHeader(com.sun.xml.ws.api.message.Header header)Add the specified RM Header element to the underlying JAX-WS message's
HeaderList .
message.getHeaders().add(header);
|
public synchronized void | block()Block the current thread using the monitor of this Message .
isWaiting = true;
try {
while (!isComplete && isWaiting) {
wait();
}
} catch (InterruptedException e) {}
|
public void | complete()Sets the isComplete field to true, indicating that the message has been acked. Also
discards the stored com.sun.xml.api.message.Message.
//release reference to JAX-WS message.
synchronized(sequence) {
message = null;
isComplete = true;
}
|
public void | copyContents()Returns a com.sun.ws.rm.Message whose inner com.sun.xml.ws.api.message.Message is replaced by
a copy of the original one. This message is stored in the relatedMessage field of ClientInboundSequence
messages. A copy needs to be retained rather than the original since the original will already
have been consumed at such time the relatedMessage needs to be resent.
if (message != null) {
com.sun.xml.ws.api.message.Message newmessage = message.copy();
message = newmessage;
}
|
public com.sun.xml.ws.rm.protocol.AckRequestedElement | getAckRequestedElement()
return ackRequestedElement;
|
public com.sun.xml.ws.api.message.Message | getCopy()Returns a copy of the wrapped com.sun.xml.ws.api.message.Message.
return message == null ? null : message.copy();
|
public com.sun.xml.ws.api.message.Header | getHeader(java.lang.String name)Get the RM Header Element with the specified name from the underlying
JAX-WS message's HeaderList
if (message == null || !message.hasHeaders()) {
return null;
}
return message.getHeaders().get(namespaceURI, name, true);
|
public int | getMessageNumber()Returns the value of the messageNumber field
return messageNumber;
|
public com.sun.xml.ws.rm.Message | getRelatedMessage()Accessor for the relatedMessage field.
return relatedMessage;
|
public Sequence | getSequence()Gets the Sequence to which the Message belongs.
return sequence;
|
public com.sun.xml.ws.rm.protocol.SequenceAcknowledgementElement | getSequenceAcknowledgementElement()
return sequenceAcknowledgementElement;
|
public com.sun.xml.ws.rm.protocol.SequenceElement | getSequenceElement()
return sequenceElement;
|
public boolean | isComplete()Determines whether this message is delivered/acked
//synchronized block is redundant.
synchronized(sequence) {
return isComplete;
}
|
public synchronized boolean | isWaiting()
return isWaiting;
|
public synchronized void | resume()Wake up the current thread which is waiting on this Message's monitor.
isWaiting = false;
notify();
|
public void | setAckRequestedElement(com.sun.xml.ws.rm.protocol.AckRequestedElement el)
ackRequestedElement = el;
|
public void | setMessageNumber(int messageNumber)Sets the value of the messageNumber field. Used by Sequence methods when
adding message to the sequence.
this.messageNumber = messageNumber;
|
public void | setRelatedMessage(com.sun.xml.ws.rm.Message mess)Mutator for the relatedMessage field.
//store the message with a copy of the "inner" com.sun.xml.ws.api.message.Message
//since the original one will be consumed
mess.copyContents();
relatedMessage = mess;
|
public void | setSequence(Sequence sequence)Sets the value of the sequence field. Used by Sequence methods when
adding message to the sequence.
this.sequence = sequence;
|
public void | setSequenceAcknowledgementElement(com.sun.xml.ws.rm.protocol.SequenceAcknowledgementElement el)
sequenceAcknowledgementElement = el;
|
public void | setSequenceElement(com.sun.xml.ws.rm.protocol.SequenceElement el)
sequenceElement = el;
|
public java.lang.String | toString()
String ret = Messages.MESSAGE_NUMBER_STRING.format(messageNumber);
ret += Messages.SEQUENCE_STRING.format(getSequence() != null ?
getSequence().getId() :
"null");
SequenceElement sel;
SequenceAcknowledgementElement sael;
AckRequestedElement ael;
if ( null != (sel = getSequenceElement())) {
ret += sel.toString();
}
if ( null != (sael = getSequenceAcknowledgementElement())) {
ret += sael.toString();
}
if ( null != (ael = getAckRequestedElement())) {
ret += ael.toString();
}
return ret;
|