|
||||||||||
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.sources.AbstractSourceThread
This class implements all methods common to SourceThreads. Extends this class if
you need to create a new type of ISourceThread
.
Field Summary | |
protected IChannel |
m_channel
A source is alsways with a Channel |
protected boolean |
m_channel_ready
Channel state |
protected java.lang.String |
m_Identifying_Name
The identifying name of this source. |
protected java.util.List |
m_listeners
The listeners of this source |
protected boolean |
m_waitForListeners
Option wait for listeners |
protected SimpleTime |
timer
Timer |
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 | |
AbstractSourceThread()
Creates new AbstractSourceThread |
Method Summary | |
void |
addListener(IListener listener)
Subscribes a IListener into this ISource . |
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Configures the Source. |
boolean |
equals(java.lang.Object obj)
Returns true if 2 sources have the same identifying name. |
IChannel |
getChannel()
Returns the channel of this source |
java.lang.String |
getIdentifyingName()
Returns the unique name for the Source |
java.util.List |
getSubscribedListeners()
Returns all subscribes listeners of this ISource . |
int |
hashCode()
Vanialla hashCode(). |
void |
receiveSignal(java.lang.Object source,
int signal)
Receives a signal. |
void |
removeListener(IListener listener)
Removes one IListener from my ISource s. |
void |
send()
Sends the internal byte[] of the source. |
void |
send(byte[] b)
Sends the specified byte to the IChannel . |
void |
setChannel(IChannel channel)
Sets the channel of this Source |
void |
setIdentifyingName(java.lang.String idName)
Sets a unique name for a source |
void |
signal(java.lang.Object target,
int theSignal)
Sends a signal to target object. |
java.lang.String |
toString()
The name of the source. |
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 |
clone, 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 java.util.List m_listeners
protected boolean m_channel_ready
protected SimpleTime timer
protected boolean m_waitForListeners
Constructor Detail |
public AbstractSourceThread()
Method Detail |
public final void setChannel(IChannel channel) throws SourceException
setChannel
in interface ISource
channel
- The IChannel
this source is sending to.public final IChannel getChannel()
getChannel
in interface ISource
public final void setIdentifyingName(java.lang.String idName)
setIdentifyingName
in interface ISource
idName
- The unique name.public final java.lang.String getIdentifyingName()
getIdentifyingName
in interface ISource
public final void addListener(IListener listener) throws SourceException
IListener
into this ISource
.addListener
in interface ISource
listener
- The IListener
to add.public final void removeListener(IListener listener) throws SourceException, NoSuchListenerException
IListener
from my ISource
s.removeListener
in interface ISource
listener
- The IListener
to remove.public final java.util.List getSubscribedListeners()
ISource
.getSubscribedListeners
in interface ISource
public final void send()
send
in interface ISource
public final void send(byte[] b)
IChannel
.send
in interface ISource
b
- The byte to send.public final void receiveSignal(java.lang.Object source, int signal)
receiveSignal
in interface ISignal
source
- The sending object.signal
- The signal.public final void signal(java.lang.Object target, int theSignal)
signal
in interface ISignal
target
- The target object.theSignal
- The signal to send.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
- The configuration object.org.apache.avalon.framework.configuration.ConfigurationException
- Error during configuration.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
The
- object to comparepublic int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |