Sonic ESB API

com.sonicsw.xq.adapter
Interface XQMessageAdapter


public interface XQMessageAdapter

The XQMessageAdapter is implemented by users that wish to interact with a JCA Resource Adapter within the SonicXQ framework. Its primary responsibility is the translation of SonicXQ specific concepts, such as an XQMessage, into a JCA concept such as an Interaction. It must execute the appropriate interaction on the Resource Adapter based on the method called by the SonicXQ framework. Other capabilities are message factory functionality and SubscriptionSpec generation. Implementations can selectively implement only the methods desired. All others must throw java.lang.UnsupportedOperationException.


Method Summary
 XQMessage call(XQMessage message, long timeout)
          Sends a message and receives the response from the EIS
 XQMessage createMessage()
          creates the default message implementation for the adapter.
 XQMessage createMessage(java.lang.Object nativeMessage)
          translates the native message format into an XQMessage
 java.util.Map createSubscriptionSpec()
          creates a Map of Resource Adapter specific subscription properties
 void destroy()
          frees up resources that are no longer needed.
 void init(XQAdapterContext context)
          called to initialize the adapter.
 void send(XQMessage message)
          sends the message to the EIS
 

Method Detail

init

void init(XQAdapterContext context)
          throws XQEndpointCreationException
called to initialize the adapter. Provides access to the context that the adapter is running in.

Parameters:
context - the container context
Throws:
XQEndpointCreationException - thrown when initialization fails for user defined reasons

send

void send(XQMessage message)
          throws XQEndpointException
sends the message to the EIS

Parameters:
message - the message to send
Throws:
XQEndpointException - thrown in response to an invalid message or an EIS exception

call

XQMessage call(XQMessage message,
               long timeout)
               throws XQEndpointException
Sends a message and receives the response from the EIS

Parameters:
message - the message to send
timeout - a suggested time to wait in milliseconds for a response
Throws:
XQEndpointException - thrown due to EIS Exception or invalid message

createMessage

XQMessage createMessage()
                        throws XQEndpointException
creates the default message implementation for the adapter. Most implementations should delegate this call to the XQMessageFactory obtained on init.

Returns:
a new message
Throws:
XQEndpointException - thrown when an error is generated during message creation

createMessage

XQMessage createMessage(java.lang.Object nativeMessage)
                        throws XQEndpointException
translates the native message format into an XQMessage

Parameters:
nativeMessage - the message received from the adapter
Throws:
XQEndpointException - thrown due to invalid message or message creation exceptions

createSubscriptionSpec

java.util.Map createSubscriptionSpec()
                                     throws XQEndpointException
creates a Map of Resource Adapter specific subscription properties

Returns:
a Map that contains the properties an their values
Throws:
XQEndpointException - thrown when their is an error generating the properties

destroy

void destroy()
frees up resources that are no longer needed. Called by the framework when the Endpoint is destroyed.


Sonic ESB API

Copyright © 2001-2012 Progress Software Corporation. All Rights Reserved.
HTML formatted on 13-Mar-2012.