org.jboss.soa.esb.listeners.gateway.mina
Class DefaultMessageHandler
java.lang.Object
org.apache.mina.common.IoHandlerAdapter
org.jboss.soa.esb.listeners.gateway.mina.DefaultMessageHandler
- All Implemented Interfaces:
- org.apache.mina.common.IoHandler, MessageHandler
public class DefaultMessageHandler
- extends org.apache.mina.common.IoHandlerAdapter
- implements MessageHandler
DefaultMessageHandler recieves messages and packages the bytes sent into
a ESB Message object.
The bytes array will be available in the default body location:
bytes[] payload = message.getBody().get();
- Author:
- tom.fennelly@jboss.com, Daniel Bevenius
Method Summary |
void |
exceptionCaught(org.apache.mina.common.IoSession session,
java.lang.Throwable cause)
|
void |
messageReceived(org.apache.mina.common.IoSession session,
java.lang.Object message)
Extracts the payload as a bytes array and creates a new ESB Message object populating
the EBS Message body with the bytes array. |
void |
sessionCreated(org.apache.mina.common.IoSession session)
Called when a new connection has been created. |
void |
setServiceInvoker(ServiceInvoker invoker)
Sets the service invoker that should be used. |
Methods inherited from class org.apache.mina.common.IoHandlerAdapter |
messageSent, sessionClosed, sessionIdle, sessionOpened |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.mina.common.IoHandler |
messageSent, sessionClosed, sessionIdle, sessionOpened |
DefaultMessageHandler
public DefaultMessageHandler()
setServiceInvoker
public final void setServiceInvoker(ServiceInvoker invoker)
- Sets the service invoker that should be used.
- Specified by:
setServiceInvoker
in interface MessageHandler
- Parameters:
invoker
- The ServiceInvoker
that this message handler should use.
sessionCreated
public void sessionCreated(org.apache.mina.common.IoSession session)
- Called when a new connection has been created.
- Specified by:
sessionCreated
in interface org.apache.mina.common.IoHandler
- Overrides:
sessionCreated
in class org.apache.mina.common.IoHandlerAdapter
- Parameters:
session
- The MINA IoSession.
exceptionCaught
public void exceptionCaught(org.apache.mina.common.IoSession session,
java.lang.Throwable cause)
- Specified by:
exceptionCaught
in interface org.apache.mina.common.IoHandler
- Overrides:
exceptionCaught
in class org.apache.mina.common.IoHandlerAdapter
messageReceived
public void messageReceived(org.apache.mina.common.IoSession session,
java.lang.Object message)
throws java.lang.Exception
- Extracts the payload as a bytes array and creates a new ESB Message object populating
the EBS Message body with the bytes array.
- Specified by:
messageReceived
in interface org.apache.mina.common.IoHandler
- Overrides:
messageReceived
in class org.apache.mina.common.IoHandlerAdapter
- Parameters:
session
- The MINA IoSession.message
- The MINA message object.
- Throws:
java.lang.Exception