org.ow2.petals.transport.platform.nio
Class NioTransporterImpl

java.lang.Object
  extended by org.ow2.petals.transport.platform.nio.NioTransporterImpl
All Implemented Interfaces:
NioReceiver, Transporter

public class NioTransporterImpl
extends java.lang.Object
implements Transporter, NioReceiver

NIO Implementation of the Transporter

Author:
Christophe DENEUX (Capgemini Sud)

Field Summary
 
Fields inherited from interface org.ow2.petals.transport.Transporter
HTTP_FRACTAL_TRANSPORTER, LOCAL_FRACTAL_TRANSPORTER, SSL_FRACTAL_TRANSPORTER, TCP_FRACTAL_TRANSPORTER
 
Fields inherited from interface org.ow2.petals.transport.platform.nio.server.NioReceiver
NIO_MSG_RECEIVER_ITF
 
Constructor Summary
NioTransporterImpl()
           
 
Method Summary
 void onMessage(java.lang.Object object)
           
 void send(org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator, TransportSendContext transportContext)
          This method does following action : Serialize the message exchange. Get the destination of the message. Add it to the message. Send it to the transport agent.
 void sendSync(org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator, TransportSendContext transportContext)
          Send the specified exchange to the specified container and wait until the response is received or the timeout is reached.
 void start()
          Init variables with Fractal attributes value and create/bind the topic for this container.
 void stop()
          Method called when the fractal component is stopped
 void stopTraffic()
          Prepare the stopping of the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NioTransporterImpl

public NioTransporterImpl()
Method Detail

onMessage

public void onMessage(java.lang.Object object)
Specified by:
onMessage in interface NioReceiver

send

public void send(org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator,
                 TransportSendContext transportContext)
          throws TransportException
This method does following action :
  1. Serialize the message exchange.
  2. Get the destination of the message.
  3. Add it to the message.
  4. Send it to the transport agent.

Specified by:
send in interface Transporter
Parameters:
exchangeDecorator - the exchange decorator to send.
Throws:
TransportException - If the exchange is invalid, or can not be serialized. If the distant container can not be found.
See Also:
Transporter#send(MessageExchangeImpl, java.lang.String, java.lang.String, long)

sendSync

public void sendSync(org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator,
                     TransportSendContext transportContext)
              throws TransportException
Description copied from interface: Transporter
Send the specified exchange to the specified container and wait until the response is received or the timeout is reached. According to the transport policy, the message is may be not persisted by the Transport layer, so it can be lost in case of problem.

Specified by:
sendSync in interface Transporter
Parameters:
exchangeDecorator - the exchange decorator to send.
Throws:
TransportException - If the exchange is invalid, or can not be serialized. If the distant container can not be found.

stopTraffic

public void stopTraffic()
Description copied from interface: Transporter
Prepare the stopping of the component. It means that all ongoing message traffic must terminate during the method invocation and all new message traffic is rejected.

Specified by:
stopTraffic in interface Transporter

start

public void start()
           throws org.objectweb.fractal.api.control.IllegalLifeCycleException,
                  org.objectweb.fractal.api.NoSuchInterfaceException
Init variables with Fractal attributes value and create/bind the topic for this container.

Throws:
org.objectweb.fractal.api.NoSuchInterfaceException
java.lang.Exception
org.objectweb.fractal.api.control.IllegalLifeCycleException

stop

public void stop()
          throws java.lang.Exception
Method called when the fractal component is stopped

Throws:
java.lang.Exception


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