public class ThreadProcessor
extends java.lang.Object
implements java.lang.Runnable
Constructor and Description |
---|
ThreadProcessor(Processor processor)
Create the object.
|
ThreadProcessor(Processor processor,
boolean daemon,
java.util.concurrent.BlockingQueue<Event> queue)
Create the object.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Finish processing of the events and free all allocated resources.
|
java.lang.String |
getName()
Get the name of the processor.
|
Event |
process(Event event)
Process the event.
|
void |
run() |
void |
start()
Building of the processor is finished, prepare it to the events
processing.
|
protected final FsmLogger logger
public ThreadProcessor(Processor processor, boolean daemon, java.util.concurrent.BlockingQueue<Event> queue)
processor
- the internal processor that process the input eventsdaemon
- the thread is a daemon threadqueue
- the queue for storing of the incoming events before their
processingpublic ThreadProcessor(Processor processor)
LinkedBlockingQueue
with unlimited length.processor
- the internal processor that process the input eventspublic void start() throws FsmException
Processor
start
in interface Processor
FsmException
Processor.close()
public void close()
Processor
Processor.close()
should be
avoided. The behavior is not defined and may cause unpredictable
behavior, e.g. NullPointerException
.close
in interface Processor
Processor.start()
public Event process(Event event) throws FsmException
Processor
process
in interface Processor
event
- the input eventFsmException
- if something failspublic void run()
run
in interface java.lang.Runnable
Copyright 2012-2013 Michal Turek, AnotherFSM.