net.sf.xbus.application
Class Adapter

java.lang.Object
  extended by net.sf.xbus.application.Adapter

public class Adapter
extends java.lang.Object

The Adapter is called from receivers. He is responsible for creating the appropriate Message object, calling the appropriate object and method of the application layer and logging the call in the DBJournal.


Constructor Summary
Adapter()
           
 
Method Summary
 void callApplication(XBUSSystem source, java.lang.Object request, java.lang.String messageType)
          Creates the appropriate Message object by calling the MessageFactory and calls the appropriate object and method of the application layer by calling the ApplicationFactory.
static void callSender(Message message, XBUSSystem destination)
          Sends a message to a sender (which was generated by the SenderFactory).
 java.lang.String getErrormessage()
          After calling the application layer, the receiver can query the resulting error message.
 java.lang.Object getResponse()
          After calling the application layer, the receiver can query the resulting response.
 java.lang.String getReturncode()
          After calling the application layer, the receiver can query the resulting returncode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Adapter

public Adapter()
Method Detail

callSender

public static void callSender(Message message,
                              XBUSSystem destination)
                       throws XException
Sends a message to a sender (which was generated by the SenderFactory).

Parameters:
message - the message to be sent
destination - the destination where the message shall be sent to
Throws:
XException - if something goes wrong

callApplication

public void callApplication(XBUSSystem source,
                            java.lang.Object request,
                            java.lang.String messageType)
Creates the appropriate Message object by calling the MessageFactory and calls the appropriate object and method of the application layer by calling the ApplicationFactory. Finally the DBJournal class is called for logging of the call.

The resulting returncode and response-string can be requested afterwards with dedicated methods in this class.


getReturncode

public java.lang.String getReturncode()
After calling the application layer, the receiver can query the resulting returncode.


getResponse

public java.lang.Object getResponse()
After calling the application layer, the receiver can query the resulting response.


getErrormessage

public java.lang.String getErrormessage()
After calling the application layer, the receiver can query the resulting error message.