wt.wrmf.delivery
Class StandardReceiverService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.wrmf.delivery.StandardReceiverService
All Implemented Interfaces:
Manager, NetFactor, ReceiverService, Serializable

public class StandardReceiverService
extends StandardManager
implements ReceiverService, Serializable

Use the newStandardReceiverService static factory method(s), not the StandardReceiverService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  Hashtable inboxes
           
private  Object lock
           
private static String RESOURCE
           
private  boolean servDone
           
private static boolean VERBOSE
           
private static String versionID
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardReceiverService()
           
 
Method Summary
 void createInbox(Class inBoxClass, String name)
          

Supported API: false
 Serializable executeMethod(MethodInvocationDesc mid)
          Executes the method described in the MethodInvocationDescription.
(package private)  Serializable executeMethodWithPayload(MethodInvocationDesc mid, boolean withPayload, InputStream is)
           
 Serializable executeMethodWithPayload(MethodInvocationDesc mid, InputStream is)
          

Supported API: false
 Object executePulledIS(ActionPullItem pullItem, InputStream retIS)
          Execute the received InputStream (retIS) according to the MethodInvocationDesc (desc) specified by the ActionPullItem (pullItem).
 String getConceptualClassname()
          Deprecated.  
(package private)  Inbox getInbox(String inboxName)
           
protected  Hashtable getInboxes()
          Gets the object for the association that plays role: inboxes.
static StandardReceiverService newStandardReceiverService()
          Default factory for the class.
protected  void performStartupProcess()
          

Supported API: false
 void pickUpMessage(InputStream is)
          Receiver Service accept feedback from remote side as a stream.
 InputStream pickUpMessageBiDi(InputStream is)
          Receiver Service accept the item as a stream and returns another input stream that contains the receipt item or an Alert Item.
(package private)  InputStream processActionShippingItem(ActionShippingItem asi, InputStream is, AlertItem alert)
           
private  void processFeedback(ShippingItem feedbackObj, InputStream is)
           
private  void processFeedbackImmediate(Object feedbackObj, InputStream is)
           
private  void putBackItemToInbox(ShippingItem obj)
           
protected  void putBackItemToInbox(ShippingItem obj, InputStream is)
          This method is executed at local/Sender's side.
private  void putToInbox(ShippingItem obj)
           
protected  void putToInbox(ShippingItem obj, InputStream is)
          This method is executed at remote/Receiver's side.
private  InputStream returnAlert(AlertItem alert, Throwable e)
           
private  AlertItem returnExecutionAlert(String key, Object[] params)
           
private  InputStream returnReceipt(Receipt receipt)
           
protected  void setInboxes(Hashtable a_Inboxes)
          Sets the object for the association that plays role: inboxes.
private  void updateDeliveryStatus(long trackingId, String srcSystem, DeliveryStatus status)
           
(package private)  void updateDeliveryStatus(ShippingItem obj, DeliveryStatus status)
           
private  void waitInitComplete()
           
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, registerEvents, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

inboxes

private Hashtable inboxes

versionID

private static final String versionID
See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE

lock

private Object lock

servDone

private boolean servDone
Constructor Detail

StandardReceiverService

public StandardReceiverService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

getInboxes

protected Hashtable getInboxes()
Gets the object for the association that plays role: inboxes.

Supported API: false

Returns:
Hashtable

setInboxes

protected void setInboxes(Hashtable a_Inboxes)
                   throws WTPropertyVetoException
Sets the object for the association that plays role: inboxes.

Supported API: false

Parameters:
a_Inboxes -
Throws:
WTPropertyVetoException

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException


Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

putToInbox

protected void putToInbox(ShippingItem obj,
                          InputStream is)
                   throws WTDeliveryException
This method is executed at remote/Receiver's side.

Supported API: false

Parameters:
obj -
is -
Throws:
WTDeliveryException

putBackItemToInbox

protected void putBackItemToInbox(ShippingItem obj,
                                  InputStream is)
                           throws WTDeliveryException
This method is executed at local/Sender's side.

Supported API: false

Parameters:
obj -
is -
Throws:
WTDeliveryException

newStandardReceiverService

public static StandardReceiverService newStandardReceiverService()
                                                          throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardReceiverService
Throws:
WTException

pickUpMessage

public void pickUpMessage(InputStream is)
                   throws WTDeliveryException
Receiver Service accept feedback from remote side as a stream. RETURNS VOID

Supported API: false

Specified by:
pickUpMessage in interface ReceiverService
Parameters:
is -
Throws:
WTDeliveryException

pickUpMessageBiDi

public InputStream pickUpMessageBiDi(InputStream is)
Receiver Service accept the item as a stream and returns another input stream that contains the receipt item or an Alert Item. Should not throw exceptions. All the exceptions should be catched and placed into the Alert Item.

Supported API: false

Specified by:
pickUpMessageBiDi in interface ReceiverService
Parameters:
is -
Returns:
InputStream

createInbox

public void createInbox(Class inBoxClass,
                        String name)
                 throws WTDeliveryException


Supported API: false

Specified by:
createInbox in interface ReceiverService
Parameters:
inBoxClass -
name -
Throws:
WTDeliveryException

executeMethod

public Serializable executeMethod(MethodInvocationDesc mid)
                           throws WTDeliveryException
Executes the method described in the MethodInvocationDescription. returns the result object. The result object can be usefull only for immediate mode. Otherwise the method should use local shipping service to send the responce independently.

Supported API: false

Specified by:
executeMethod in interface ReceiverService
Parameters:
mid -
Returns:
Serializable
Throws:
WTDeliveryException

executeMethodWithPayload

public Serializable executeMethodWithPayload(MethodInvocationDesc mid,
                                             InputStream is)
                                      throws WTDeliveryException


Supported API: false

Specified by:
executeMethodWithPayload in interface ReceiverService
Parameters:
mid -
is -
Returns:
Serializable
Throws:
WTDeliveryException

executePulledIS

public Object executePulledIS(ActionPullItem pullItem,
                              InputStream retIS)
                       throws WTDeliveryException
Execute the received InputStream (retIS) according to the MethodInvocationDesc (desc) specified by the ActionPullItem (pullItem).

Supported API: false

Specified by:
executePulledIS in interface ReceiverService
Parameters:
pullItem -
retIS -
Returns:
Object
Throws:
WTDeliveryException

executeMethodWithPayload

Serializable executeMethodWithPayload(MethodInvocationDesc mid,
                                      boolean withPayload,
                                      InputStream is)
                                throws ClassNotFoundException,
                                       NoSuchMethodException,
                                       IllegalAccessException,
                                       IllegalArgumentException,
                                       InvocationTargetException
Throws:
ClassNotFoundException
NoSuchMethodException
IllegalAccessException
IllegalArgumentException
InvocationTargetException

putToInbox

private void putToInbox(ShippingItem obj)
                 throws WTDeliveryException
Throws:
WTDeliveryException

putBackItemToInbox

private void putBackItemToInbox(ShippingItem obj)
                         throws WTDeliveryException
Throws:
WTDeliveryException

returnAlert

private InputStream returnAlert(AlertItem alert,
                                Throwable e)

returnReceipt

private InputStream returnReceipt(Receipt receipt)

returnExecutionAlert

private AlertItem returnExecutionAlert(String key,
                                       Object[] params)

updateDeliveryStatus

void updateDeliveryStatus(ShippingItem obj,
                          DeliveryStatus status)
                    throws QueryException,
                           WTException,
                           WTPropertyVetoException
Throws:
QueryException
WTException
WTPropertyVetoException

updateDeliveryStatus

private void updateDeliveryStatus(long trackingId,
                                  String srcSystem,
                                  DeliveryStatus status)
                           throws QueryException,
                                  WTException,
                                  WTPropertyVetoException
Throws:
QueryException
WTException
WTPropertyVetoException

processFeedbackImmediate

private void processFeedbackImmediate(Object feedbackObj,
                                      InputStream is)
                               throws WTDeliveryException
Throws:
WTDeliveryException

processFeedback

private void processFeedback(ShippingItem feedbackObj,
                             InputStream is)
                      throws WTDeliveryException
Throws:
WTDeliveryException

processActionShippingItem

InputStream processActionShippingItem(ActionShippingItem asi,
                                      InputStream is,
                                      AlertItem alert)
                                throws WTDeliveryException,
                                       IOException
Throws:
WTDeliveryException
IOException

getInbox

Inbox getInbox(String inboxName)

waitInitComplete

private void waitInitComplete()