|
Openfire 3.6.1 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.Channel<T>
public class Channel<T extends Packet>
A channel provides a mechanism to queue work units for processing. Each work unit is encapsulated as a ChannelMessage, and processing of each message is performed by a ChannelHandler.
As a request is handled by the system, it will travel through a sequence of channels. This architecture has a number of advantages:
Channels are modeled after SEDA stages. For much much more in-depth architecture information, refer to the SEDA website.
Constructor Summary | |
---|---|
Channel(String name,
ChannelHandler<T> channelHandler)
Creates a new channel. |
Method Summary | |
---|---|
void |
add(T packet)
Enqueus a message to be handled by this channel. |
int |
getMaxThreadCount()
Returns the max number of threads the channel will use for processing messages. |
int |
getMinThreadCount()
Returns the min number of threads the channel will use for processing messages. |
String |
getName()
Returns the name of the channel. |
int |
getQueueSize()
Returns the current number of ChannelMessage objects waiting to be processed by the channel. |
int |
getThreadCount()
Returns the number of currently active worker threads in the channel. |
boolean |
isRunning()
Returns true if the channel is currently running. |
void |
setMaxThreadCount(int maxThreadCount)
Sets the max number of threads the channel will use for processing messages. |
void |
setMinThreadCount(int minThreadCount)
Sets the min number of threads the channel will use for processing messages. |
void |
start()
Starts the channel, which means that worker threads will start processing messages from the queue. |
void |
stop()
Stops the channel, which means that worker threads will stop processing messages from the queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Channel(String name, ChannelHandler<T> channelHandler)
name
- the name of the channel.channelHandler
- the handler for this channel.Method Detail |
---|
public String getName()
public void add(T packet)
packet
- an XMPP packet to add to the channel for processing.public boolean isRunning()
public void start()
public void stop()
public int getThreadCount()
public int getMinThreadCount()
public void setMinThreadCount(int minThreadCount)
minThreadCount
- the min number of threads that can be used by the channel.public int getMaxThreadCount()
public void setMaxThreadCount(int maxThreadCount)
maxThreadCount
- the max number of threads that can be used by the channel.public int getQueueSize()
|
Openfire 3.6.1 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |