|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MessageExchange
TODO MessageExchange : manage exceptions in methods MessageExchange represents a container for normalized messages which is described by an exchange pattern. The exchange pattern defines the names, sequence, and cardinality of messages in an exchange.
When a consumer initiates a message exchange (that is, it creates a new exchange instance and initializes it), it has a choice of how to address the exchange, to indicate the service desired. In increasing order of specificity, the initiating consumer may address the new exchange by:
The NMR will always use the most specific address type given, ignoring other, less specific ones, if any.
Note that whenever the NMR chooses the provider endpoint, it must set the endpoint property of the message exchange instance to the endpoint it selected.
Note also that setting the different address properties of an exchange instance does not cause side effects. For example, setting the service endpoint will not affect the previously set interface name or service name.
| Nested Class Summary | |
|---|---|
static class |
MessageExchange.Role
Typesafe enumeration containing the roles a component can play in an exchange. |
| Field Summary | |
|---|---|
static java.lang.String |
JTA_TRANSACTION_PROPERTY_NAME
JTA transaction context property name |
| Method Summary | |
|---|---|
Fault |
createFault()
Generic factory method for Fault objects. |
NormalizedMessage |
createMessage()
Creates a normalized message based on the specified message reference. |
ServiceEndpoint |
getEndpoint()
Retrieves the endpoint used by this exchange. |
java.lang.Exception |
getError()
Retrieves Exception describing the exchanges error status. |
java.lang.String |
getExchangeId()
Returns the unique identifier assigned by the NMR for this exchange. |
Fault |
getFault()
Retrieves the fault message for this exchange, if one exists. |
FlowAttributes |
getFlowAttributes()
Gets the flow attributes |
javax.xml.namespace.QName |
getInterfaceName()
Retrieves the interface name used by this exchange. |
NormalizedMessage |
getMessage(java.lang.String name)
Retrieves a normalized message based on the specified message reference. |
javax.xml.namespace.QName |
getOperation()
Retrieves the operation used by this exchange. |
java.net.URI |
getPattern()
Returns the URI of the pattern for this exchange. |
java.lang.Object |
getProperty(java.lang.String name)
Retrieves the specified property from this exchange. |
java.util.Set |
getPropertyNames()
Get all of the names of the properties for this exchange. |
MessageExchange.Role |
getRole()
Queries the role that the caller (which must be the owner of the this exchange instance) plays in the exchange. |
javax.xml.namespace.QName |
getService()
Retrieves the service used by this exchange. |
ExchangeStatus |
getStatus()
Returns the processing status of the exchange. |
boolean |
isTransacted()
Queries the existence of a JTA transaction context. |
void |
setEndpoint(ServiceEndpoint endpoint)
Specifies the endpoint used by this exchange. |
void |
setError(java.lang.Exception error)
Used to specify the source of a failure status. |
void |
setFault(Fault fault)
Specifies the fault message for this exchange, if one exists. |
void |
setFlowAttributes(FlowAttributes flowAttributes)
Sets the flow attributes |
void |
setInterfaceName(javax.xml.namespace.QName interfaceName)
Specifies the interface name used by this exchange. |
void |
setMessage(NormalizedMessage msg,
java.lang.String name)
Sets a normalized message with the specified message reference. |
void |
setOperation(javax.xml.namespace.QName name)
Specifies the operation used by this exchange. |
void |
setProperty(java.lang.String name,
java.lang.Object obj)
Specifies a property for this exchange. |
void |
setService(javax.xml.namespace.QName service)
Specifies the service used by this exchange. |
void |
setStatus(ExchangeStatus status)
Sets the processing status of the exchange. |
| Field Detail |
|---|
static final java.lang.String JTA_TRANSACTION_PROPERTY_NAME
| Method Detail |
|---|
Fault createFault()
throws MessagingException
java.lang.IllegalStateException - if the component is not the owner of this message exchange
MessagingException - if the exchange is in a terminal state (
getStatus() !=
ExchangeStatus.ACTIVE ), or if the message exchange
pattern does not permit fault messages
NormalizedMessage createMessage()
throws MessagingException
java.lang.IllegalStateException - if the component is not the owner of this message exchange
MessagingException - if the exchange is in a terminal state (
getStatus() !=
ExchangeStatus.ACTIVE )ServiceEndpoint getEndpoint()
null if
not set
java.lang.IllegalStateException - if the component is not the owner of this message exchangejava.lang.Exception getError()
null if not
set
java.lang.IllegalStateException - if the component is not the owner of this message exchangejava.lang.String getExchangeId()
null if not setFlowAttributes getFlowAttributes()
void setFlowAttributes(FlowAttributes flowAttributes)
flowAttributes - the flow attributesFault getFault()
null if not
present
java.lang.IllegalStateException - if the component is not the owner of this message exchangejavax.xml.namespace.QName getInterfaceName()
null if
not set
java.lang.IllegalStateException - if the component is not the owner of this message exchangeNormalizedMessage getMessage(java.lang.String name)
name - message reference; must be non-null and non-empty
java.lang.IllegalStateException - if the component is not the owner of this message exchangejavax.xml.namespace.QName getOperation()
null if
not set
java.lang.IllegalStateException - if the component is not the owner of this message exchangejava.net.URI getPattern()
null if not set
java.lang.IllegalStateException - if the component is not the owner of this message exchangejava.lang.Object getProperty(java.lang.String name)
name - property name; must be non-null and non-empty
java.lang.IllegalStateException - if the component is not the owner of this message exchangejava.util.Set getPropertyNames()
java.lang.IllegalStateException - if the component is not the owner of this message exchangeMessageExchange.Role getRole()
java.lang.IllegalStateException - if the component is not the owner of this message exchangejavax.xml.namespace.QName getService()
null if
not set
java.lang.IllegalStateException - - if the component is not the owner of this message exchangeExchangeStatus getStatus()
boolean isTransacted()
java.lang.IllegalStateException - if the component is not the owner of this message exchangevoid setEndpoint(ServiceEndpoint endpoint)
endpoint - endpoint address; may be null
java.lang.IllegalStateException - if the component is not the owner of this message exchangevoid setError(java.lang.Exception error)
error - error cause; must be non-null
java.lang.IllegalStateException - if the component is not the owner of this message exchange
void setFault(Fault fault)
throws MessagingException
fault - fault message; may be null
MessagingException - operation not permitted in the current exchange state
java.lang.IllegalStateException - if the component is not the owner of this message exchangevoid setInterfaceName(javax.xml.namespace.QName interfaceName)
interfaceName - interface name to be used by this exchange; may be null
java.lang.IllegalStateException - - if the component is not the owner of this message exchange
void setMessage(NormalizedMessage msg,
java.lang.String name)
throws MessagingException
msg - normalized message; must be non-nullname - message reference; must be non-null and non-empty
MessagingException - operation not permitted in the current exchange state
java.lang.IllegalStateException - if the component is not the owner of this message exchangevoid setOperation(javax.xml.namespace.QName name)
name - operation name; may be null
java.lang.IllegalStateException - if the component is not the owner of this message exchange
void setProperty(java.lang.String name,
java.lang.Object obj)
name - property name; must be non-null and non-emptyobj - property value; may be null
java.lang.IllegalStateException - if the component is not the owner of this message exchangevoid setService(javax.xml.namespace.QName service)
service - service address; may be null
java.lang.IllegalStateException - if the component is not the owner of this message exchange
void setStatus(ExchangeStatus status)
throws MessagingException
status - exchange status; must be non-null
MessagingException - failed to set status, possibly due to an invalid state
transition.
java.lang.IllegalStateException - if the component is not the owner of this message exchange
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||