org.jboss.soa.esb.couriers
Class CourierFactory

java.lang.Object
  extended by org.jboss.soa.esb.couriers.CourierFactory

public class CourierFactory
extends java.lang.Object


Constructor Summary
protected CourierFactory()
           
 
Method Summary
static void deregisterCourier(TwoWayCourier courier)
          Deregister the courier from the current set.
static Courier getCourier(EPR toEPR)
          Obtain a courier which can perform deliveries only and prime it with the "to address" (toEPR).
static TwoWayCourier getCourier(EPR toEPR, EPR replyToEPR)
          Obtain a courier which can perform both deliveries and pickups and prime it with the "to address" (toEPR) and the "replyTo address" (replyToEPR).
static CourierFactory getInstance()
          Get the CourierFactory method.
 TwoWayCourier getMessageCourier(EPR toEPR)
          Obtain a courier which can perform deliveries only and prime it with the "to address" (toEPR).
static TwoWayCourier getPickupCourier(EPR replyToEPR)
          Obtain a courier which can perform pickups only and prime it with the "to address" (toEPR) and the "replyTo address" (replyToEPR).
static void setInstance(CourierFactory instance)
          Set the CourierFactory method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CourierFactory

protected CourierFactory()
Method Detail

getInstance

public static CourierFactory getInstance()
Get the CourierFactory method.

Returns:
The Courier factory instance.

setInstance

public static void setInstance(CourierFactory instance)
Set the CourierFactory method.

Supports unit testing.

Parameters:
instance - New factory instance.

getMessageCourier

public TwoWayCourier getMessageCourier(EPR toEPR)
                                throws CourierException,
                                       MalformedEPRException
Obtain a courier which can perform deliveries only and prime it with the "to address" (toEPR).

Parameters:
toEPR - - the 'to address', the address on where to deliverAsync a Message.
Returns:
The courier.
Throws:
CourierException - if the specific courier implementation cannot be created.
MalformedEPRException

getCourier

public static Courier getCourier(EPR toEPR)
                          throws CourierException,
                                 MalformedEPRException
Obtain a courier which can perform deliveries only and prime it with the "to address" (toEPR).

Parameters:
toEPR - - the 'to address', the address on where to deliverAsync a Message.
Returns:
Courier
Throws:
CourierException - if the specific courier implementation cannot be created.
MalformedEPRException

getPickupCourier

public static TwoWayCourier getPickupCourier(EPR replyToEPR)
                                      throws CourierException,
                                             MalformedEPRException
Obtain a courier which can perform pickups only and prime it with the "to address" (toEPR) and the "replyTo address" (replyToEPR).

Parameters:
replyToEPR - - the 'replyTo address', the address where to deliverAsync the Message we pickup.
Returns:
TwoWayCourier
Throws:
CourierException - if the specific courier implementation cannot be created.
MalformedEPRException

getCourier

public static TwoWayCourier getCourier(EPR toEPR,
                                       EPR replyToEPR)
                                throws CourierException,
                                       MalformedEPRException
Obtain a courier which can perform both deliveries and pickups and prime it with the "to address" (toEPR) and the "replyTo address" (replyToEPR).

Parameters:
toEPR - - the 'to address', the address on where to deliverAsync a Message.
replyToEPR - - the 'replyTo address', the address where to deliverAsync the Message we pickup.
Returns:
TwoWayCourier
Throws:
CourierException - if the specific courier implementation cannot be created.
MalformedEPRException

deregisterCourier

public static void deregisterCourier(TwoWayCourier courier)
Deregister the courier from the current set.

Parameters:
courier - The current courier.