|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.beepcore.beep.lib.ChannelPool
ChannelPool holds a collection of available
SharedChannel(s) and provides access to them. Availabe
SharedChannel(s) are retrieved through the
getSharedChannel. Each SharedChannel has a time
to live, after which, it is removed from the pool.
| Constructor Summary | |
ChannelPool(Session session)
Creates a ChannelPool with the given session. |
|
ChannelPool(Session session,
long ttl)
Creates a ChannelPool with the given session and time to
live. |
|
| Method Summary | |
void |
close()
Closes down the channel pool, its session and all associated channels. |
SharedChannel |
getSharedChannel(java.lang.String profile)
Returns a SharedChannel which supports the specified
profile. |
SharedChannel |
getSharedChannel(java.lang.String profile,
MessageListener listener)
Returns a SharedChannel which supports the specified
profile and calls back on the specified
DataListener. |
void |
setSharedChannelTTL(long ttl)
Sets the time to live or the number of milleseconds an unused channel will remain in the pool before it is removed from the pool. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ChannelPool(Session session)
ChannelPool with the given session.
session - The session on which all
SharedChannel(s) returned from getSharedChannel
are started.getSharedChannel(java.lang.String)
public ChannelPool(Session session,
long ttl)
ChannelPool with the given session and time to
live.
session - The session on which all
SharedChannel(s) returned from getSharedChannel
are started.ttl - The time in milleseconds an available SharedChannel
will live in ChannelPoolgetSharedChannel(java.lang.String)| Method Detail |
public SharedChannel getSharedChannel(java.lang.String profile)
throws BEEPException
SharedChannel which supports the specified
profile.
profile - Name of a profile for the requested
SharedChannel.
SharedChannel for the requested profile.
BEEPException
public SharedChannel getSharedChannel(java.lang.String profile,
MessageListener listener)
throws BEEPException
SharedChannel which supports the specified
profile and calls back on the specified
DataListener. Once it is no longer needed, call
release on the SharedChannel
to return it to the pool of available channels.
profile - Name of profile for the requested
SharedChannel.listener - DataListener for the requested
SharedChannel.
SharedChannel.
BEEPExceptionMessageListener,
SharedChannelpublic void setSharedChannelTTL(long ttl)
ttl - The time this channel has to live in the pool while in an
available state.public void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||