Errai 3.0.1-SNAPSHOT

org.jboss.errai.bus.server
Class WorkerFactory

java.lang.Object
  extended by org.jboss.errai.bus.server.WorkerFactory

public class WorkerFactory
extends Object

The WorkerFactory maintains a pool of Workers, and takes care of running and terminating them


Constructor Summary
WorkerFactory(ErraiService svc)
          Initializes the worker factory with a new thread group, service, all the properties, messages and workers
 
Method Summary
 void deliver(Message m)
          Attempts to send the message
 void deliverGlobal(Message m)
          Attempts to deliver the specified message globally
protected  BlockingQueue<Message> getMessages()
          Gets the messages in the queue
protected  long getWorkerTimeout()
          Gets the timeout
 void startPool()
          Starts execution of all the threads in the pool of threads
 void stopPool()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkerFactory

public WorkerFactory(ErraiService svc)
Initializes the worker factory with a new thread group, service, all the properties, messages and workers

Parameters:
svc - - the ErraiService that is to be associated to this factory of workers
Method Detail

deliverGlobal

public void deliverGlobal(Message m)
                   throws InterruptedException
Attempts to deliver the specified message globally

Parameters:
m - - message to be delivered
Throws:
InterruptedException

deliver

public void deliver(Message m)
             throws InterruptedException
Attempts to send the message

Parameters:
m - - message to be sent
Throws:
InterruptedException

getMessages

protected BlockingQueue<Message> getMessages()
Gets the messages in the queue

Returns:
the messages in the queue

getWorkerTimeout

protected long getWorkerTimeout()
Gets the timeout

Returns:
the timeout time

startPool

public void startPool()
Starts execution of all the threads in the pool of threads


stopPool

public void stopPool()

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.