org.drools.concurrent
Class CommandExecutor

java.lang.Object
  extended by org.drools.concurrent.CommandExecutor
All Implemented Interfaces:
Externalizable, Serializable, Runnable

public class CommandExecutor
extends Object
implements Runnable, Externalizable

The CommandExecutor is a Producer/Consumer style classes that provides a queue of Commands in a LinkedBlockingQueue. This the run() method loops for continously until shutdown() is called.

See Also:
Serialized Form

Constructor Summary
CommandExecutor()
           
CommandExecutor(WorkingMemory workingMemory)
           
 
Method Summary
 void readExternal(ObjectInput in)
           
 void run()
           
 void shutdown()
          Allows the looping run() method to execute.
 Future submit(Command command)
          Submit a Command for execution
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandExecutor

public CommandExecutor()

CommandExecutor

public CommandExecutor(WorkingMemory workingMemory)
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

shutdown

public void shutdown()
Allows the looping run() method to execute.


submit

public Future submit(Command command)
Submit a Command for execution

Parameters:
command -
Returns:
return the Future

run

public void run()
Specified by:
run in interface Runnable


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.