|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JSDT Channel interface.
Field Summary | |
static int |
HIGH_PRIORITY
Channel Data high priority value. |
static int |
LOW_PRIORITY
Channel Data top priority value. |
static int |
MAX_PRIORITIES
The maximum number of Data priorities. |
static int |
MEDIUM_PRIORITY
Channel Data medium priority value. |
static int |
READONLY
The Channel read-only value. |
static int |
READWRITE
The Channel read/write value. |
static int |
TOP_PRIORITY
Channel Data top priority value. |
static int |
WRITEONLY
The Channel write-only value. |
Fields inherited from class java.io.Serializable |
serialVersionUID |
Method Summary | |
void |
addChannelListener(ChannelListener listener)
add the specified Channel listener to receive Channel events for this Channel. |
void |
addConsumer(Client client,
ChannelConsumer consumer)
add a new ChannelConsumer for this Client. |
boolean |
dataAvailable(Client client)
tests whether there is Data available to read on this Channel. |
boolean |
isOrdered()
returns whether this is an ordered channel. |
boolean |
isReliable()
test whether this is a reliable channel. |
void |
join(Client client,
int mode)
join a Client to a Channel in the given mode. |
java.lang.String[] |
listConsumerNames()
list the names of the Clients who are currently consuming this Channel. |
Data |
receive(Client client)
is used to receive Data from other Clients joined to this Channel. |
Data |
receive(Client client,
long timeout)
is used to receive Data from other Clients joined to this Channel. |
void |
removeChannelListener(ChannelListener listener)
removes the specified Channel listener so that it no longer receives Channel events for this Channel. |
void |
removeConsumer(Client client,
ChannelConsumer consumer)
remove a ChannelConsumer from this Client for this Channel. |
void |
sendToAll(Client sendingClient,
Data data)
is used to send Data to all Clients consuming this Channel. |
void |
sendToClient(Client sendingClient,
java.lang.String receivingClientName,
Data data)
is used to send Data to a single Client consuming this Channel. |
void |
sendToOthers(Client sendingClient,
Data data)
is used to send Data to other Clients consuming this Channel. |
Methods inherited from interface com.sun.media.jsdt.Manageable |
destroy,
disableListenerEvents,
disableManagerEvents,
enableListenerEvents,
enableManagerEvents,
expel,
getName,
getSession,
invite,
isManaged,
join,
leave,
listClientNames |
Field Detail |
public static final int TOP_PRIORITY
public static final int HIGH_PRIORITY
public static final int MEDIUM_PRIORITY
public static final int LOW_PRIORITY
public static final int MAX_PRIORITIES
public static final int READONLY
public static final int WRITEONLY
public static final int READWRITE
Method Detail |
public void addChannelListener(ChannelListener listener) throws ConnectionException, NoSuchChannelException, NoSuchSessionException, TimedOutException
listener
- the Channel listener.public void removeChannelListener(ChannelListener listener) throws ConnectionException, NoSuchChannelException, NoSuchListenerException, NoSuchSessionException, TimedOutException
listener
- the Channel listener.public void addConsumer(Client client, ChannelConsumer consumer) throws ConnectionException, InvalidClientException, NoSuchChannelException, NoSuchClientException, NoSuchConsumerException, NoSuchSessionException, PermissionDeniedException, TimedOutException
client
- the Client to associate this ChannelConsumer with.consumer
- the new ChannelConsumer for this client.public void removeConsumer(Client client, ChannelConsumer consumer) throws ConnectionException, InvalidClientException, NoSuchChannelException, NoSuchClientException, NoSuchConsumerException, NoSuchSessionException, PermissionDeniedException, TimedOutException
client
- the Client to associate this ChannelConsumer with.consumer
- the ChannelConsumer to remove from this Client.public java.lang.String[] listConsumerNames() throws ConnectionException, NoSuchChannelException, NoSuchSessionException, TimedOutException
public boolean isReliable()
public boolean isOrdered()
public void join(Client client, int mode) throws ConnectionException, InvalidClientException, NoSuchChannelException, NoSuchClientException, NoSuchSessionException, PermissionDeniedException, NameInUseException, TimedOutException
If this is a managed Channel, then the Client is authenticated to determine if it is permitted to do this operation.
client
- the Client wishing to join this Channel.mode
- the mode which can be one of, READONLY, WRITEONLY or
READWRITE.public Data receive(Client client) throws ConnectionException, InvalidClientException, NoSuchClientException, NoSuchSessionException, PermissionDeniedException, TimedOutException
It will block if there is no Data to read. The dataAvailable
method can be used to check if there is Data that can be received on
this channel.
client
- identifies the client wishing to receive data from
this channel. This client must already be successfully joined to this
channel.public Data receive(Client client, long timeout) throws ConnectionException, InvalidClientException, NoSuchClientException, NoSuchSessionException, PermissionDeniedException, TimedOutException
If Data is immediately available then it will return with it, else it
will wait until the timeout period, specified by the timeout
argument in milliseconds, has elapsed. If no Data is available at this
time, it will return null. Note that if Data becomes available during the
timeout period, this method will be woken up and that Data is immediately
returned.
client
- identifies the client wishing to receive data from
this channel. This client must already be successfully joined to this
channel.timeout
- the maximum time to wait in milliseconds.public boolean dataAvailable(Client client) throws ConnectionException, InvalidClientException, NoSuchClientException, NoSuchSessionException, PermissionDeniedException, TimedOutException
client
- identifies the client wishing to check if there is
data available to receive on this channel. This client must already be
successfully joined to this channel.public void sendToAll(Client sendingClient, Data data) throws ConnectionException, InvalidClientException, NoSuchChannelException, NoSuchClientException, NoSuchSessionException, PermissionDeniedException, TimedOutException
Data from each sender sent at the same priority on the same Channel arrives at a given receiver in the same order it was sent but may have other sender Data interleaved differently.
sendingClient
- the Client sending the Data.data
- the Data being sent over this Channel.public void sendToOthers(Client sendingClient, Data data) throws ConnectionException, InvalidClientException, NoSuchChannelException, NoSuchClientException, NoSuchSessionException, PermissionDeniedException, TimedOutException
Data from each sender sent at the same priority on the same Channel arrives at a given receiver in the same order it was sent but may have other sender Data interleaved differently.
sendingClient
- the Client sending the Data.data
- the Data being sent over this Channel.public void sendToClient(Client sendingClient, java.lang.String receivingClientName, Data data) throws ConnectionException, InvalidClientException, NoSuchChannelException, NoSuchClientException, NoSuchConsumerException, NoSuchSessionException, PermissionDeniedException, TimedOutException
sendingClient
- the Client sending the Data.receivingClient
- the name of the Client receiving the Data.data
- the Data being sent over this Channel.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |