Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.sandesha2.workers
Class SandeshaThread

    java.lang.Object
      java.lang.Thread
          org.apache.sandesha2.workers.SandeshaThread

All Implemented Interfaces:
  java.lang.Runnable

Direct Known Subclasses:
  Invoker, PollingManager, Sender

public abstract class SandeshaThread
extends java.lang.Thread

Aggregates pause and stop logic between sender and invoker threads.

Field Summary
`protected org.apache.axis2.context.ConfigurationContext` | `context`
`protected StorageManager` | `storageManager`
`protected org.apache.axis2.util.threadpool.ThreadFactory` | `threadPool`

Fields inherited from class java.lang.Thread
`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

Constructor Summary
`SandeshaThread(int sleepTime)`

Method Summary
`void` | `blockForPause()` Waits for the invoking thread to pause
`protected void` | `doPauseIfNeeded()`
`void` | `finishPause()`
`java.util.ArrayList` | `getSequences()`
`WorkerLock` | `getWorkerLock()`
`protected boolean` | `hasStoppedRunning()`
`protected abstract boolean` | `internalRun()` The main work loop, to be implemented by any child class.
`boolean` | `isThreadStarted()`
`void` | `run()`
`protected boolean` | `runMainLoop()` Test to check if a notify has been called when not waiting
`void` | `runThreadForSequence(org.apache.axis2.context.ConfigurationContext context, java.lang.String sequenceID, boolean rmSource)` Ensure that the worker thread is aware of the given sequence.
`void` | `setRanMainLoop()` Indicate that the main loop has been run
`void` | `stopRunning()`
`void` | `stopThreadForSequence(java.lang.String sequenceID, boolean rmSource)`
`void` | `wakeThread()` Wake the current thread as there is work to be done.

Methods inherited from class java.lang.Thread
`activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### threadPool

    protected transient org.apache.axis2.util.threadpool.ThreadFactory threadPool

### context

    protected org.apache.axis2.context.ConfigurationContext context

### storageManager

    protected StorageManager storageManager

Constructor Detail

### SandeshaThread

    public SandeshaThread(int sleepTime)

Method Detail

### getWorkerLock

    public final WorkerLock getWorkerLock()

### stopThreadForSequence

    public void stopThreadForSequence(java.lang.String sequenceID,
                                      boolean rmSource)

### blockForPause

    public void blockForPause()

  Waits for the invoking thread to pause

### finishPause

    public void finishPause()

### stopRunning

    public void stopRunning()

### isThreadStarted

    public boolean isThreadStarted()

### runThreadForSequence

    public void runThreadForSequence(org.apache.axis2.context.ConfigurationContext context,
                                     java.lang.String sequenceID,
                                     boolean rmSource)

  Ensure that the worker thread is aware of the given sequence. As source sequences do not have a proper sequence id at the time they are bootstrapped, the caller must pass in the internal sequence id when rmSource is true.

### getSequences

    public java.util.ArrayList getSequences()

  Returns:
    a List of SequenceEntry instances

### hasStoppedRunning

    protected boolean hasStoppedRunning()

### doPauseIfNeeded

    protected void doPauseIfNeeded()

### wakeThread

    public void wakeThread()

  Wake the current thread as there is work to be done. Also flag that if we miss a notify, then there is work to be done. Implementing threads should check this value before waiting

### setRanMainLoop

    public void setRanMainLoop()

  Indicate that the main loop has been run

### runMainLoop

    protected boolean runMainLoop()

  Test to check if a notify has been called when not waiting

  Returns:

### internalRun

    protected abstract boolean internalRun()

  The main work loop, to be implemented by any child class. If the child wants to sleep before the next loop then they should return true.

### run

    public void run()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2007 Apache Web Services Project. All Rights Reserved.