javax.jbi.messaging
Interface MessageExchangeFactory


public interface MessageExchangeFactory

A message exchange factory is used used to create new instances of MessageExchange. Service consumers use these factories to create message exchanges when initiating a new service request.

Message exchange factories are created using the ComponentContext given to the component during its initialization (see ComponentLifeCycle). There are a variety of ways to creating such factories, each of which creates a context that is used to provide some of the default properties of MessageExchange instances created by the factory instances. For example, a factory can be created for a particular endpoint, ensuring that all exchanges created by the factory have that endpoint set as the default endpoint property of the exchange. This allows components to retain factories as a way of aligning internal processing context with the context contained in the factory, ensuring that the exchanges created consistently reflect that context.

Author:
JSR208 Expert Group

Method Summary
 MessageExchange createExchange(javax.xml.namespace.QName serviceName, javax.xml.namespace.QName operationName)
          TODO createExchange find an endpoint for the service at the ME creation Creates a new MessageExchange instance used to initiate a service invocation.
 MessageExchange createExchange(java.net.URI pattern)
          Creates a new MessageExchange instance used to initiate a service invocation.
 InOnly createInOnlyExchange()
          Convenience method that creates an In-Only message exchange.
 InOptionalOut createInOptionalOutExchange()
          Convenience method that creates an In-Optional-Out message exchange.
 InOut createInOutExchange()
          Convenience method that creates an In Out message exchange.
 RobustInOnly createRobustInOnlyExchange()
          Convenience method that creates a Robust-In-Only message exchange.
 

Method Detail

createExchange

MessageExchange createExchange(javax.xml.namespace.QName serviceName,
                               javax.xml.namespace.QName operationName)
                               throws MessagingException
TODO createExchange find an endpoint for the service at the ME creation Creates a new MessageExchange instance used to initiate a service invocation.

JBI defines a set of four basic message exchange types, corresponding to the predefined in-* WSDL 2.0 Message Exchange Patterns. Message exchanges of any type are created using the DeliveryChannel.

Parameters:
serviceName - the name of the service to be invoked; must be non-null
operationName - the name of the operation to be invoked; must be non-null and non-empty
Returns:
new message exchange, initialized for invoking the given service and operation; must be non-null
Throws:
MessagingException - if the given service or operation are not registered with the NMR.
MessagingException - if the factory was created for a particular interface, and the given serviceName does not implement that interface.

createExchange

MessageExchange createExchange(java.net.URI pattern)
                               throws MessagingException
Creates a new MessageExchange instance used to initiate a service invocation. JBI defines a set of four fundamental message exchange types which are created using binding and engine delivery channels. This base met0hod is provided for extensibility, to satisfy the need for vendor-specific message exchange patterns. The registration and administration of these patterns is not addressed by JBI.

Parameters:
pattern - message exchange pattern; must be non-null and non-empty
Returns:
new message exchange; must be non-null
Throws:
MessagingException - specified pattern is not registered to a message exchange type

createInOnlyExchange

InOnly createInOnlyExchange()
                            throws MessagingException
Convenience method that creates an In-Only message exchange.

Returns:
new InOnly message exchange; must be non-null
Throws:
MessagingException - failed to create exchange

createInOptionalOutExchange

InOptionalOut createInOptionalOutExchange()
                                          throws MessagingException
Convenience method that creates an In-Optional-Out message exchange.

Returns:
new InOptionalOut message exchange; must be non-null
Throws:
MessagingException185 - - failed to create exchange
MessagingException

createInOutExchange

InOut createInOutExchange()
                          throws MessagingException
Convenience method that creates an In Out message exchange.

Returns:
new InOut message exchange; must be non-null
Throws:
MessagingException - failed to create exchange

createRobustInOnlyExchange

RobustInOnly createRobustInOnlyExchange()
                                        throws MessagingException
Convenience method that creates a Robust-In-Only message exchange.

Returns:
new RobustInOnly message exchange; must be non-null
Throws:
MessagingException185 - - failed to create exchange
MessagingException


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.