|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This specifies all core abilities of a JCast type Channel
.
The channel is part of the producer-bus-consumer pattern and provides
the "bus" type features.
MP3ChannelThread
,
SimpleChannelThread
Method Summary | |
void |
add(IListener listener)
Adds a JCast listener into the Channel. |
void |
add(IListener listener,
ISource source)
Adds a listener to a specific source. |
void |
add(ISource source)
Adds JCast Sources into the Channel. |
java.lang.String |
getIdentifyingName()
Returns the unique name for the Channel |
java.lang.String |
getListenerResponseHeader()
Returns the current ListenerResponseHeader |
java.util.List |
getListeners()
Returns a list of all listenes |
java.util.List |
getListeners(ISource source)
Returns a list of all listeners, subscribed to source |
java.lang.String |
getSourceResponseHeader()
Returns the current SourceResponseHeader |
java.util.List |
getSources()
Returns a list of all sources |
void |
remove(IListener listener)
Removes a listener form the Channel |
void |
remove(IListener listener,
ISource source)
Removes the listener from the specific source subscribtion list |
void |
remove(ISource source)
Removes a source from the channel |
void |
send(byte[] b,
ISource source)
This send command will send the byte[] b to all listeners of ISource source. |
void |
setIdentifyingName(java.lang.String idName)
Sets a unique name for a channel |
void |
setListenerResponseHeader(java.lang.String resHeader)
Sets the response header to be send to listeners connecting to this channel |
void |
setSourceResponseHeader(java.lang.String resHeader)
Sets the response header to be send to sources connecting to this channel |
Method Detail |
public void add(ISource source) throws ChannelException
source
- The source to be added into the Channel. Has to implement ISource
public void remove(ISource source) throws ChannelException
public java.util.List getSources()
public void add(IListener listener) throws ChannelException
listener
- The listener to be added into the Channel. Has to implement IChannel
public void remove(IListener listener) throws ChannelException
public java.util.List getListeners()
public void add(IListener listener, ISource source) throws ChannelException
listener
- The listener to be subscribed to the specified source.source
- The target source the listener is subscribed to.public void remove(IListener listener, ISource source) throws ChannelException
public java.util.List getListeners(ISource source)
public void send(byte[] b, ISource source)
ISource
source. You use this method to send byte[] to the
subscribed listeners.public class MySource implements ISource { . . . String helloStr = "hello"; byte[] b = helloStr.toBytes(); // I want to say hello to all my listeners. myChannel.send(b,this); . . . }
b
- The byte[] array to be send to all subscribed listeners.source
- The source that sends the byte[].public void setIdentifyingName(java.lang.String idName)
public java.lang.String getIdentifyingName()
public void setListenerResponseHeader(java.lang.String resHeader)
public java.lang.String getListenerResponseHeader()
public void setSourceResponseHeader(java.lang.String resHeader)
public java.lang.String getSourceResponseHeader()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |