|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.anneck.jcast.core.AbstractThread | +--de.anneck.jcast.listeners.AbstractListenerThread
AbstractListenerThread provides default implementations of all methods required for a ListenerThread. If you want to create a new type of listener, extends this class. Take a look at SimpleListener for a vanilla implementation.
Field Summary | |
protected byte[] |
m_byte
The internal byte[] |
protected java.util.List |
m_cache
Internal cache as vector |
protected IChannel |
m_channel
The Channel its listening on |
protected static ListenerController |
m_controller
My controller |
protected java.lang.String |
m_Identifying_Name
|
protected ISource |
m_source
The Source its listening to |
protected SimpleStatistics |
m_stats
Statistics and Misc informations |
Fields inherited from class de.anneck.jcast.core.AbstractThread |
m_class, m_log, m_mutex, m_name, m_prio, m_state |
Fields inherited from interface de.anneck.jcast.core.IThread |
RUNNING, STOPPED, WAITING |
Fields inherited from interface de.anneck.jcast.core.ISignal |
BUSY, CHANNEL_IS_BUSY, CHANNEL_IS_READY, CLIENT_DISCONNECTED, HELO, READY, SOURCE_GONE |
Constructor Summary | |
AbstractListenerThread()
Creates new AbstractListenerThread |
Method Summary | |
java.lang.Object |
clone()
|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Configures the Listenerthread with the configuration object. |
boolean |
equals(java.lang.Object obj)
Evaluates equality using the IdentifyingName method. |
IChannel |
getChannel()
Returns the channel of this source |
java.lang.String |
getIdentifyingName()
Returns the unique name for the Source |
ISource |
getSource()
Returns the source this listener is listening to |
int |
hashCode()
Standard hashCode from Object. |
void |
receive(byte[] b)
Receives a byte array of something. |
void |
receiveSignal(java.lang.Object source,
int param)
Receives a Signal from a source. |
void |
setChannel(IChannel channel)
Sets the channel of this Source |
void |
setIdentifyingName(java.lang.String idName)
Sets a unique name for a source |
void |
setSource(ISource aSource)
Sets the source this listener is listening to |
void |
signal(java.lang.Object target,
int theSignal)
Sends a signal to a target. |
void |
subscribeChannel(IChannel channel)
Subscribes the listener to a IChannel . |
void |
subscribeSource(IChannel channel,
ISource source)
Subscribe the listener to a specific Source in a Channel. |
java.lang.String |
toString()
Helper to identify objects better. |
Methods inherited from class de.anneck.jcast.core.AbstractThread |
checkState, doKill, doRestart, doStart, doStop, getAllThreads, getThreadClass, getThreadName, getThreadPriority, isRunning, isStopped, isWaiting, run, setState, setThreadPriority |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.anneck.jcast.core.IThread |
checkState, doKill, doRestart, doStart, doStop, doWork, getThreadClass, getThreadName, getThreadPriority, isRunning, isStopped, isWaiting, setState, setThreadPriority |
Methods inherited from interface java.lang.Runnable |
run |
Field Detail |
protected java.lang.String m_Identifying_Name
protected IChannel m_channel
protected ISource m_source
protected byte[] m_byte
protected SimpleStatistics m_stats
protected java.util.List m_cache
protected static ListenerController m_controller
Constructor Detail |
public AbstractListenerThread()
Method Detail |
public final void setIdentifyingName(java.lang.String idName)
setIdentifyingName
in interface IListener
idName
- The unique name.public final java.lang.String getIdentifyingName()
getIdentifyingName
in interface IListener
public final void setChannel(IChannel channel) throws ListenerException
setChannel
in interface IListener
channel
- The IChannel
object.public final IChannel getChannel()
getChannel
in interface IListener
public final void setSource(ISource aSource) throws ListenerException
setSource
in interface IListener
aSource
- The ISource
object.public final ISource getSource()
getSource
in interface IListener
ISource
public final void subscribeChannel(IChannel channel) throws ChannelException
IChannel
.subscribeChannel
in interface IListener
channel
- The target IChannel
to subscribe to.public final void subscribeSource(IChannel channel, ISource source) throws ChannelException, ListenerException
subscribeSource
in interface IListener
channel
- The channel that contains the source.source
- The source to subscribe to.public final void receive(byte[] b)
receive
in interface IListener
b
- The byte to receive.public final void receiveSignal(java.lang.Object source, int param)
receiveSignal
in interface ISignal
source
- The object sending the signal.param
- The Signal.public final void signal(java.lang.Object target, int theSignal)
signal
in interface ISignal
target
- The object to receive the signal.theSignal
- The signal to send to the target.public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The object to compare withpublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
configuration
- A valid configuration object.org.apache.avalon.framework.configuration.ConfigurationException
- Error during configuration.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |