org.mule.transport
Class TrackingWorkManager

java.lang.Object
  extended by org.mule.transport.TrackingWorkManager
All Implemented Interfaces:
Executor, javax.resource.spi.work.WorkManager, Disposable, Startable

public class TrackingWorkManager
extends Object
implements WorkManager

Wraps a WorkManager to track the work that in process.


Field Summary
static int DEFAULT_SLEEP_MILLIS
           
protected static Log logger
           
static String MULE_WAIT_MILLIS
           
 
Fields inherited from interface javax.resource.spi.work.WorkManager
IMMEDIATE, INDEFINITE, UNKNOWN
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
TrackingWorkManager(WorkManagerHolder workManagerHolder, int shutdownTimeout)
           
 
Method Summary
 void dispose()
          A lifecycle method where implementor should free up any resources.
 void doWork(javax.resource.spi.work.Work work)
           
 void doWork(javax.resource.spi.work.Work work, long startTimeout, javax.resource.spi.work.ExecutionContext execContext, javax.resource.spi.work.WorkListener workListener)
           
 void execute(Runnable runnable)
           
 boolean isStarted()
          Is the WorkManager ready to accept work?
 void scheduleWork(javax.resource.spi.work.Work work)
           
 void scheduleWork(javax.resource.spi.work.Work work, long startTimeout, javax.resource.spi.work.ExecutionContext execContext, javax.resource.spi.work.WorkListener workListener)
           
 void setWorkListenerWrapperFactory(WorkListenerWrapperFactory workListenerWrapperFactory)
           
 void setWorkTracker(WorkTracker workTracker)
           
 void start()
           
 long startWork(javax.resource.spi.work.Work work)
           
 long startWork(javax.resource.spi.work.Work work, long startTimeout, javax.resource.spi.work.ExecutionContext execContext, javax.resource.spi.work.WorkListener workListener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final Log logger

DEFAULT_SLEEP_MILLIS

public static final int DEFAULT_SLEEP_MILLIS
See Also:
Constant Field Values

MULE_WAIT_MILLIS

public static final String MULE_WAIT_MILLIS
See Also:
Constant Field Values
Constructor Detail

TrackingWorkManager

public TrackingWorkManager(WorkManagerHolder workManagerHolder,
                           int shutdownTimeout)
Method Detail

isStarted

public boolean isStarted()
Description copied from interface: WorkManager
Is the WorkManager ready to accept work?


dispose

public void dispose()
Description copied from interface: Disposable
A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

Specified by:
dispose in interface Disposable

execute

public void execute(Runnable runnable)
Specified by:
execute in interface Executor

start

public void start()
           throws MuleException
Specified by:
start in interface Startable
Throws:
MuleException

doWork

public void doWork(javax.resource.spi.work.Work work)
            throws javax.resource.spi.work.WorkException
Specified by:
doWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

doWork

public void doWork(javax.resource.spi.work.Work work,
                   long startTimeout,
                   javax.resource.spi.work.ExecutionContext execContext,
                   javax.resource.spi.work.WorkListener workListener)
            throws javax.resource.spi.work.WorkException
Specified by:
doWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

startWork

public long startWork(javax.resource.spi.work.Work work)
               throws javax.resource.spi.work.WorkException
Specified by:
startWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

startWork

public long startWork(javax.resource.spi.work.Work work,
                      long startTimeout,
                      javax.resource.spi.work.ExecutionContext execContext,
                      javax.resource.spi.work.WorkListener workListener)
               throws javax.resource.spi.work.WorkException
Specified by:
startWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

scheduleWork

public void scheduleWork(javax.resource.spi.work.Work work)
                  throws javax.resource.spi.work.WorkException
Specified by:
scheduleWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

scheduleWork

public void scheduleWork(javax.resource.spi.work.Work work,
                         long startTimeout,
                         javax.resource.spi.work.ExecutionContext execContext,
                         javax.resource.spi.work.WorkListener workListener)
                  throws javax.resource.spi.work.WorkException
Specified by:
scheduleWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

setWorkListenerWrapperFactory

public void setWorkListenerWrapperFactory(WorkListenerWrapperFactory workListenerWrapperFactory)

setWorkTracker

public void setWorkTracker(WorkTracker workTracker)


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.