Class AsyncAlarmForwarder
- java.lang.Object
-
- java.lang.Thread
-
- org.ow2.clif.scenario.isac.engine.AsyncAlarmForwarder
-
- All Implemented Interfaces:
java.lang.Runnable,BladeInsertResponse
public class AsyncAlarmForwarder extends java.lang.Thread implements BladeInsertResponse
Wrapper for asynchronous management of alarms sent to BladeInsertResponse interface.- Author:
- Bruno Dillenseger
-
-
Field Summary
-
Fields inherited from interface org.ow2.clif.server.api.BladeInsertResponse
BLADE_INSERT_RESPONSE
-
-
Constructor Summary
Constructors Constructor Description AsyncAlarmForwarder(java.lang.ThreadGroup group, BladeInsertResponse target)Creates a front-end for a target BladeInsertResponse object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaborted()Direct/synchronous "aborted()" call on the targetvoidalarm(AlarmEvent alarm)Put the provided alarm in a queue for asynchronous forwarding to the target.voidclear()Discards all alarms pending in the queue.voidcompleted()Direct/synchronous "completed()" call on the targetvoidinterrupt()Interruption override: traps interrupt for thread termination without generating InterruptedException in possibly active blocking operations (network I/O).voidrun()Thread activity: get alarms from the queue and forward them until the thread is interrupted.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
AsyncAlarmForwarder
public AsyncAlarmForwarder(java.lang.ThreadGroup group, BladeInsertResponse target)Creates a front-end for a target BladeInsertResponse object. Alarms are asynchronously forwarded to the target, while other BladeInsertResponse calls are synchronously redirected to the target.- Parameters:
group- the thread group this thread will belong totarget- the target BladeInsertResponse object
-
-
Method Detail
-
clear
public void clear()
Discards all alarms pending in the queue.
-
alarm
public void alarm(AlarmEvent alarm)
Put the provided alarm in a queue for asynchronous forwarding to the target.- Specified by:
alarmin interfaceBladeInsertResponse- Parameters:
alarm- the alarm to forward to the target
-
aborted
public void aborted()
Direct/synchronous "aborted()" call on the target- Specified by:
abortedin interfaceBladeInsertResponse
-
completed
public void completed()
Direct/synchronous "completed()" call on the target- Specified by:
completedin interfaceBladeInsertResponse
-
run
public void run()
Thread activity: get alarms from the queue and forward them until the thread is interrupted.- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
interrupt
public void interrupt()
Interruption override: traps interrupt for thread termination without generating InterruptedException in possibly active blocking operations (network I/O). Uses notifyAll() to exit from pending wait() calls.- Overrides:
interruptin classjava.lang.Thread
-
-