com.ibm.commerce.event.impl.commands

Class RaiseECEventCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, RaiseECEventCmd, Protectable, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable, java.lang.Runnable


    public class RaiseECEventCmdImpl
    extends ControllerCommandImpl
    implements RaiseECEventCmd, java.lang.Runnable
    This command, intended to be executed by the scheduler, finds all the events in the BUSEVENT table that have not been raised (CHECKED = 0). A common base event is raised for each of these events and then the BUSEVENT records are updated to CHECKED = -10. It is the responsibility of the EventProcessor scheduled job to do further processing of analytics events that need to be sent to an external analytics system, and then update the BUSEVENT records from -10 to -20 state. Finally, the CleanECEvent job deletes the events with CHECKED = -20 from the BUSEVENT table.

    As an optimization, if there are no events that need to be processed by EventProcessor, the "Analytics Event Configuration" component can be disabled in the instance configuration file and the EventProcessor scheduled job will delete events that are in state -10.

    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
      • EVENT_THREAD_POOL_NAME

        public static final java.lang.String EVENT_THREAD_POOL_NAME
        This is the name of the thread pool to handle the events.
        See Also:
        Constant Field Values
      • sENHANCE_CONCURRENCY

        public static volatile boolean sENHANCE_CONCURRENCY
        Used by BusinessAuditStorageBean to turn on enhanced concurrency. Any other use is unsupported.
    • Constructor Detail

      • RaiseECEventCmdImpl

        public RaiseECEventCmdImpl()
        This is the default constructor for this class. It calls the constructor from the superclass.
    • Method Detail

      • getBusinessEventId

        public java.lang.Long getBusinessEventId()
        This method gets the business event identifier of the event to raise. If null is returned then all possible events should be raised.
        Specified by:
        getBusinessEventId in interface RaiseECEventCmd
        Returns:
        This method returns the business event identifier that will be raised.
      • setBusinessEventId

        public void setBusinessEventId(java.lang.Long businessEventId)
        This method sets the business event identifier to raise. If null is specified then all possible events will be raised.
        Specified by:
        setBusinessEventId in interface RaiseECEventCmd
        Parameters:
        businessEventId - This is the business event identifier to raise.
      • performExecute

        public void performExecute()
                            throws ECException
        This method dispatches the work as an asynchronous activity to ensure the transaction model is the same as the commerce runtime transaction model. All exceptions will be caught and logged. This command will always execute successfully and log problems.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
        See Also:
        TargetableCommand.performExecute()
      • run

        public void run()
        This method contains a while loop that processes the common base objects that are specified to be processed. It also raises ECEvents to represent the event internally so the internal event listeners can react to the events. All exceptions will be caught and logged. This command will always execute successfully and log problems.
        Specified by:
        run in interface java.lang.Runnable
      • setEventGlobalId

        public void setEventGlobalId(java.lang.String eventGlobalId)
        This method sets the name of the event to raise.
        Specified by:
        setEventGlobalId in interface RaiseECEventCmd
        Parameters:
        eventGlobalId - This is the name of the event to raise. When this parameter is set, the event key should also be specified.
      • setSynchronous

        public void setSynchronous(boolean synchronous)
        This method indicates whether the command should process events in the current thread of execution or use another thread to process the events asynchronously.
        Specified by:
        setSynchronous in interface RaiseECEventCmd
        Parameters:
        synchronous - This indicates whether the command should execute synchronously (true) or asynchronously (false).