java.lang.Object
org.scoja.server.core.ClusterSkeleton
org.scoja.server.core.EventQueue
- All Implemented Interfaces:
- Cluster, java.lang.Runnable
- public class EventQueue
- extends ClusterSkeleton
Estas colas desacoplan la captura de eventos de su procesamiento
posterior a través de enlaces, filtros y destinos.
Puede haber tantas instancias como se desee.
Estas colas son activas: se encargan de ir procesando los eventos
que le llegan.
Se puede configurar cuántas hebras realizan esta labor.
En el constructor se indica el máximo número de hebras que queremos
(por defecto ClusterSkeleton.DEFAULT_THREAD_COUNT 55 ),
pero esta cantidad se puede cambiar dinámicamente con
ClusterSkeleton.setThreads(int) 55 .
Cuando sobran hebras, se destruyen al terminar el proceso del
evento con el que estén.
Sin embargo, las hebras sólo se crean cuando llega un nuevo evento,
todas las hebras están ocupadas y todavía no se ha llegado al
máximo de hebras.
Por tanto, el número real de hebras puede no llegar al máximo;
aunque es muy probable porque crece monótonamente.
name
protected final java.lang.String name
queue
protected final java.util.LinkedList queue
threadsAwaiting
protected int threadsAwaiting
EventQueue
public EventQueue(java.lang.String name)
process
public void process(EventContext eenv)
run
public void run()
- Description copied from interface:
java.lang.Runnable
- This method will be called by whoever wishes to run your class
implementing Runnable. Note that there are no restrictions on what
you are allowed to do in the run method, except that you cannot
throw a checked exception.
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).