public abstract class FulfillerSystem extends SourceSinkTemplate
OrderFulfiller
,
HardgoodFulfiller
,
ElectronicFulfiller
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
java.lang.String |
mModifyOrderNotificationPort |
protected java.lang.String |
mModifyOrderPort |
protected java.lang.String |
NUCLEUS_NAME |
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
FulfillerSystem() |
Modifier and Type | Method and Description |
---|---|
void |
doStartService()
This method establishes the PerformanceMonitor operation name
for this fulfiller.
|
ClientLockManager |
getClientLockManager()
The ClientLockManager is used to ensure that only one
thread/message is processing a given order at any given time.
|
CommerceItemStates |
getCommerceItemStates()
The object containing all the states of a commerce item
|
PipelineManager |
getFulfillmentPipelineManager()
The PipelineManager used by this fulfillment class to access pipeline
processing.
|
java.io.Serializable |
getKeyForMessage(javax.jms.ObjectMessage oMessage)
This method will return the key to be used for locking out other messages with the same
key while a thread is handling this message.
|
boolean |
getLookUpOrderIdFromMessage()
The value indicates if the order id is to be retrieved from the
commerce message
|
boolean |
getLookUpOrderIdFromOrder()
The value indicates if the order id is to be retrieved from the
order object sent in the commerce message when mLookUpOrderIdFromMessage=true
and the CommerceMessage.orderId property is null.
|
java.lang.String |
getModifyOrderNotificationPort()
The port on which the ModifyOrderNotification messages will be sent.
|
java.lang.String |
getModifyOrderPort()
The port on which the ModifyOrder messages will be sent.
|
OrderFulfillmentTools |
getOrderFulfillmentTools()
The OrderFulfillmentTools class is used to perform various
tasks, such as splitting shipping groups, determining which ports messages should be sent
on for fulfillers and many others.
|
OrderManager |
getOrderManager()
The OrderManager used by this fulfillment class to access order
information.
|
OrderStates |
getOrderStates()
The object containing all the states of an order
|
PaymentGroupStates |
getPaymentGroupStates()
The object containing all the states of an payment group
|
PaymentManager |
getPaymentManager()
The PaymentManager is used to debit or credit paymentgroups.
|
ShipItemRelationshipStates |
getShipItemRelationshipStates()
The object containing all the states of a shipping group / commerce item relationship
|
ShippingGroupStates |
getShippingGroupStates()
The object containing all the states of a shipping group
|
protected boolean |
handleMessage(java.lang.String pPortName,
javax.jms.ObjectMessage pMessage)
This is called to handle a newly received message.
|
void |
handleNewMessageType(java.lang.String pPortName,
javax.jms.ObjectMessage pMessage)
This method is called to handle all messages other than the other handle methods.
|
void |
receiveMessage(java.lang.String pPortName,
javax.jms.Message pMessage)
This is called to notify the component that a Message has arrived through the given
input port.
|
void |
setClientLockManager(ClientLockManager pClientLockManager) |
void |
setCommerceItemStates(CommerceItemStates pCommerceItemStates) |
void |
setFulfillmentPipelineManager(PipelineManager pFulfillmentPipelineManager) |
void |
setLookUpOrderIdFromMessage(boolean pLookUpOrderIdFromMessage) |
void |
setLookUpOrderIdFromOrder(boolean pLookUpOrderIdFromOrder) |
void |
setModifyOrderNotificationPort(java.lang.String pModifyOrderNotificationPort) |
void |
setModifyOrderPort(java.lang.String pModifyOrderPort) |
void |
setOrderFulfillmentTools(OrderFulfillmentTools pOrderFulfillmentTools) |
void |
setOrderManager(OrderManager pOrderManager) |
void |
setOrderStates(OrderStates pOrderStates) |
void |
setPaymentGroupStates(PaymentGroupStates pPaymentGroupStates) |
void |
setPaymentManager(PaymentManager pPaymentManager) |
void |
setShipItemRelationshipStates(ShipItemRelationshipStates pShipItemRelationshipStates) |
void |
setShippingGroupStates(ShippingGroupStates pShippingGroupStates) |
sendCommerceMessage
beforeSendMessage, getDefaultMessageSourceName, getDelayOnSendRetry, getLimboDeliveryDelay, getMessageSourceContext, getMessageSourceName, getTransactionManager, isAllowMessageSending, sendObjectMessage, setAllowMessageSending, setDelayOnSendRetry, setLimboDeliveryDelay, setMessageSourceContext, setMessageSourceName, setTransactionManager, startMessageSource, stopMessageSource
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
protected java.lang.String NUCLEUS_NAME
public java.lang.String mModifyOrderNotificationPort
protected java.lang.String mModifyOrderPort
public void setOrderManager(OrderManager pOrderManager)
public OrderManager getOrderManager()
OrderManager
public void setFulfillmentPipelineManager(PipelineManager pFulfillmentPipelineManager)
public PipelineManager getFulfillmentPipelineManager()
PipelineManager
public void setClientLockManager(ClientLockManager pClientLockManager)
public ClientLockManager getClientLockManager()
ClientLockManager
public void setPaymentManager(PaymentManager pPaymentManager)
public PaymentManager getPaymentManager()
PaymentManager
public void setModifyOrderNotificationPort(java.lang.String pModifyOrderNotificationPort)
public java.lang.String getModifyOrderNotificationPort()
public void setModifyOrderPort(java.lang.String pModifyOrderPort)
public java.lang.String getModifyOrderPort()
public void setOrderFulfillmentTools(OrderFulfillmentTools pOrderFulfillmentTools)
public OrderFulfillmentTools getOrderFulfillmentTools()
OrderFulfillmentTools
public void setOrderStates(OrderStates pOrderStates)
public OrderStates getOrderStates()
public void setShippingGroupStates(ShippingGroupStates pShippingGroupStates)
public ShippingGroupStates getShippingGroupStates()
public void setPaymentGroupStates(PaymentGroupStates pPaymentGroupStates)
public PaymentGroupStates getPaymentGroupStates()
public void setShipItemRelationshipStates(ShipItemRelationshipStates pShipItemRelationshipStates)
public ShipItemRelationshipStates getShipItemRelationshipStates()
public void setCommerceItemStates(CommerceItemStates pCommerceItemStates)
public CommerceItemStates getCommerceItemStates()
public void setLookUpOrderIdFromMessage(boolean pLookUpOrderIdFromMessage)
public boolean getLookUpOrderIdFromMessage()
public void setLookUpOrderIdFromOrder(boolean pLookUpOrderIdFromOrder)
public boolean getLookUpOrderIdFromOrder()
public void receiveMessage(java.lang.String pPortName, javax.jms.Message pMessage) throws javax.jms.JMSException
This is called to notify the component that a Message has arrived through the given input port. The MessageSink should be prepared to handle concurrent calls of this method from multiple Threads. All messages received by a FulfillerSystem subclass are expected to be ObjectMessages. All of the objects contained within those object messages are assumed to be CommerceMessage objects.
Each FulfillerSystem subclass processes the message types that it expects to receive. Message processing occurs in the handleMessage method, which each subclass overrides. Additional (custom) message types can be handled by extending the handleNewMessageType method and adding whatever logic is required in there.
The method uses the ClientLockManager to guarantee that only one thread dealing with a message for a given key is running through the system at any moment. The key used to acquire the lock is returned by the method getKeyForMessage().
receiveMessage
in interface MessageSink
receiveMessage
in class SourceSinkTemplate
pPortName
- - the port on which this message was receivedpMessage
- - the message that was sent on the port.javax.jms.JMSException
handleMessage(java.lang.String, javax.jms.ObjectMessage)
,
OrderFulfiller
,
HardgoodFulfiller
,
ElectronicFulfiller
,
ClientLockManager
public java.io.Serializable getKeyForMessage(javax.jms.ObjectMessage oMessage) throws javax.jms.JMSException
pMessage
- the ObjectMessage containing the CommerceMessage.javax.jms.JMSException
protected boolean handleMessage(java.lang.String pPortName, javax.jms.ObjectMessage pMessage) throws javax.jms.JMSException
This is called to handle a newly received message. Before this method is called, the message is subjected to basic validity checks, a transaction is established, and an exclusive lock is acquired for the message's key.
Each FulfillerSystem subclass should override this method to handle the message types that are appropriate to that subclass. Otherwise, handleNewMessageType will be called.
pPortName
- - the port on which this message was receivedpMessage
- - the message that was sent on the port.javax.jms.JMSException
#receive
,
handleNewMessageType(java.lang.String, javax.jms.ObjectMessage)
public void handleNewMessageType(java.lang.String pPortName, javax.jms.ObjectMessage pMessage) throws javax.jms.JMSException
This method is called to handle all messages other than the other handle methods. The default implementation logs a warning and does nothing else. Should new message types be added, this method can be overridden and the handling of the message can be done within. Note that no extra work for locking needs to happen.
pPortName
- - the port on which this message was receivedpMessage
- - an ObjectMessage which will contain a CommerceMessage as an objectjavax.jms.JMSException
- is thrown on a failure to send a messagepublic void doStartService() throws ServiceException
This method establishes the PerformanceMonitor operation name for this fulfiller.
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting upGenericService