net.gleamynode.netty2
Interface ThreadPooledEventDispatcher

All Superinterfaces:
EventDispatcher
All Known Subinterfaces:
OrderedEventDispatcherMBean, SimpleEventDispatcherMBean, ThreadPooledEventDispatcherMBean
All Known Implementing Classes:
AbstractThreadPooledEventDispatcher, OrderedEventDispatcher, SimpleEventDispatcher

public interface ThreadPooledEventDispatcher
extends EventDispatcher

An interface for thread-pooled event dispatchers.

Version:
$Rev: 4 $, $Date: 2005-04-18 12:04:09 +0900 $
Author:
Trustin Lee (http://gleamynode.net/)
See Also:
SimpleEventDispatcher, OrderedEventDispatcher

Method Summary
 String getThreadNamePrefix()
          Returns the prefix of dispatcher thread name.
 int getThreadPoolSize()
          Returns the number of dispatcher threads.
 int getThreadPriority()
          Returns the priority of dispatcher threads.
 boolean isStarted()
          Returns true if this event dispatcher is started.
 void setThreadNamePrefix(String threadNamePrefix)
          Sets the prefix of dispatcher thread name.
 void setThreadPoolSize(int newSize)
          Sets the number of dispatcher threads.
 void setThreadPriority(int newPriority)
          Sets the priority of dispatcher threads.
 void start()
          Starts this event dispatcher.
 void stop()
          Stops this event dispatcher.
 
Methods inherited from interface net.gleamynode.netty2.EventDispatcher
fire, flush, getWaitingEventSize
 

Method Detail

start

public void start()
Starts this event dispatcher. this method will silently return if it is already started.

Throws:
IllegalStateException - if threadPoolSize is not set.

stop

public void stop()
Stops this event dispatcher. This method will silently return if it is already stopped.


isStarted

public boolean isStarted()
Returns true if this event dispatcher is started.


getThreadPoolSize

public int getThreadPoolSize()
Returns the number of dispatcher threads.


setThreadPoolSize

public void setThreadPoolSize(int newSize)
Sets the number of dispatcher threads. This property is adjustable in runtime.


getThreadPriority

public int getThreadPriority()
Returns the priority of dispatcher threads.


setThreadPriority

public void setThreadPriority(int newPriority)
Sets the priority of dispatcher threads.

Throws:
IllegalArgumentException - if the specified priority is not between Thread.MIN_PRIORITYand Thread.MAX_PRIORITY.

getThreadNamePrefix

public String getThreadNamePrefix()
Returns the prefix of dispatcher thread name.


setThreadNamePrefix

public void setThreadNamePrefix(String threadNamePrefix)
Sets the prefix of dispatcher thread name. This will help you to determine which thread is which when you debug. The actual thread name will be threadNamePrefix + '-' + threadId.



Copyright © 2004-2006 Trustin Lee. All Rights Reserved.