org.ow2.petals.microkernel.api.jbi.messaging
Interface RouterService

All Superinterfaces:
org.ow2.petals.clientserverapi.jbi.messaging.RouterService

public interface RouterService
extends org.ow2.petals.clientserverapi.jbi.messaging.RouterService

Routes messages from the DeliveryChannel to their destinations.

Perform an address resolution, finding the endpoint(s) satisfying the destination information, and select the appropriate transporter to convey the messages. Resolutions are based on defined rules.

Routes messages pushed from the Transporter to the target DeliveryChannel.

Author:
Adrien LOUIS - EBM WebSourcing, Roland Naudin - EBM WebSourcing, Christophe Hamerling - EBM WebSourcing

Field Summary
static String COMPONENT_LOGGER_NAME
           
static String PROPERTY_ROUTER_CONSUMER_NOACK
          The message exchange properties to set the NOACK feature.
static String PROPERTY_ROUTER_PROVIDER_LINKTYPE
          The message exchange property name to set the provider link type to resolve.
static String PROPERTY_ROUTER_PROVIDER_NOACK
           
static String PROPERTY_ROUTER_QOS
          Constant used to specify the property name to set the router policy.
static String PROPERTY_ROUTER_SEND_ATTEMPT
          Constant used to specify the property name to set the router send attempt.
static String PROPERTY_ROUTER_SEND_DELAY
          Constant used to specify the property name to set the delay between router send attempts.
static String PROPERTY_ROUTER_TIMETOLIVE
          The message exchange property to set the TTL of the exchange.
 
Fields inherited from interface org.ow2.petals.clientserverapi.jbi.messaging.RouterService
DEFAULT_PLATFORM_STRATEGY, DEFAULT_POLICY, FAST_POLICY, RELIABLE_POLICY, SECURE_POLICY
 
Method Summary
 void addComponent(ComponentContext componentContext)
          Inform that a component is installing.
 void modifiedSALifeCycle(List<ServiceUnitLifeCycle> serviceUnitLifes)
          Inform that a SA life-cycle has changed its state.
 org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper receive(ComponentContext componentContext, long timeoutMS)
          Ask to receive a message from MNR and return it.
 void removeComponent(ComponentContext componentContext)
          Inform that a component is uninstalling.
 void send(ComponentContext componentContext, org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator)
          Send the message into the NMR.
 void sendSync(ComponentContext componentContext, org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator, long timeout)
          Send the message synchronously into the NMR.
 void stopTraffic()
          Prepare the stopping of the component.
 

Field Detail

COMPONENT_LOGGER_NAME

static final String COMPONENT_LOGGER_NAME
See Also:
Constant Field Values

PROPERTY_ROUTER_TIMETOLIVE

static final String PROPERTY_ROUTER_TIMETOLIVE
The message exchange property to set the TTL of the exchange.

See Also:
Constant Field Values

PROPERTY_ROUTER_CONSUMER_NOACK

static final String PROPERTY_ROUTER_CONSUMER_NOACK
The message exchange properties to set the NOACK feature.

See Also:
Constant Field Values

PROPERTY_ROUTER_PROVIDER_NOACK

static final String PROPERTY_ROUTER_PROVIDER_NOACK
See Also:
Constant Field Values

PROPERTY_ROUTER_PROVIDER_LINKTYPE

static final String PROPERTY_ROUTER_PROVIDER_LINKTYPE
The message exchange property name to set the provider link type to resolve. See JBI specification section 5.4.3.3 for more details.

See Also:
Constant Field Values

PROPERTY_ROUTER_QOS

static final String PROPERTY_ROUTER_QOS
Constant used to specify the property name to set the router policy. Used only in plaform distribution. The default policy is fast.

See Also:
Constant Field Values

PROPERTY_ROUTER_SEND_ATTEMPT

static final String PROPERTY_ROUTER_SEND_ATTEMPT
Constant used to specify the property name to set the router send attempt. Used only in plaform distribution. The default attempt is 2.

See Also:
Constant Field Values

PROPERTY_ROUTER_SEND_DELAY

static final String PROPERTY_ROUTER_SEND_DELAY
Constant used to specify the property name to set the delay between router send attempts. Used only in plaform distribution. The default attempt is 1 second.

See Also:
Constant Field Values
Method Detail

send

void send(ComponentContext componentContext,
          org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator)
          throws RoutingException
Send the message into the NMR.

Parameters:
componentContext - the source component context
exchangeDecorator - the MessageExchangeWrapper
Throws:
RoutingException - impossible to send the message

sendSync

void sendSync(ComponentContext componentContext,
              org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator,
              long timeout)
              throws RoutingException
Send the message synchronously into the NMR.

Parameters:
componentContext - the source component context
exchangeDecorator - the MessageExchangeWrapper
timeOut - timeout of the message (in ms). 0 for no timeout
Throws:
RoutingException - impossible to process a synchronous send

receive

org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper receive(ComponentContext componentContext,
                                                                     long timeoutMS)
                                                                     throws RoutingException
Ask to receive a message from MNR and return it.

Parameters:
componentContext - The source component context MUST be non null
timeoutMS - parameter which represents
  • The time to wait if greater than 0
  • A non blocking call if equal to 0
  • Infinite Blocking call if less than 0
Returns:
The message exchange decorator retrieved from the Transporter
Throws:
RoutingException - impossible to receive the message

addComponent

void addComponent(ComponentContext componentContext)
                  throws RoutingException
Inform that a component is installing. The Router must inform its Transporters about the component installation.

Parameters:
componentContext - The component context
Throws:
RoutingException - impossible to add the component

removeComponent

void removeComponent(ComponentContext componentContext)
                     throws RoutingException
Inform that a component is uninstalling. The Router must inform its Transporters about the component uninstallation.

Parameters:
componentContext - The component context
Throws:
RoutingException - impossible to remove the component

modifiedSALifeCycle

void modifiedSALifeCycle(List<ServiceUnitLifeCycle> serviceUnitLifes)
Inform that a SA life-cycle has changed its state.

Parameters:
serviceUnitDescriptors - the list of bound SU JBI descriptors

stopTraffic

void stopTraffic()
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.



Copyright © 2005-2015 Linagora. All Rights Reserved.