|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.media.jsdt.impl.JSDTObject | +--com.sun.media.jsdt.impl.ManageableImpl | +--com.sun.media.jsdt.impl.ChannelImpl
JSDT Channel (implementation) class.
Field Summary | |
static char |
D_All
Send Data to all consumers (including self) of the Channel. |
static char |
D_Client
Send Data to a specific consumer of the Channel. |
static char |
D_Others
Send Data to all other consumers of the Channel. |
static char |
M_Channel
To signify a manageable object of type Channel. |
protected boolean |
ordered
Indicates whether data sent over this channel will be ordered. |
AbstractChannelProxy |
po
Handle to client-side proxy. |
protected boolean |
reliable
Indicates if data sent over this channel will be reliably delivered. |
protected SessionImpl |
session
The session that this channel belongs to. |
AbstractChannelServer |
so
Handle to server-side object. |
Fields inherited from class com.sun.media.jsdt.impl.ManageableImpl |
mpo,
name,
objectType |
Fields inherited from class com.sun.media.jsdt.impl.JSDTObject |
giveTime,
httpTunnelPort,
maxQueueSize,
maxThreadPoolSize,
pingPeriod,
registryAddress,
registryPort,
registryTime,
showMessage,
showStack,
socketFactoryClass,
SSLCipher,
timeoutPeriod,
TTL,
versionString |
Constructor Summary | |
ChannelImpl(boolean isServer,
java.lang.String name,
SessionImpl session,
boolean reliable,
boolean ordered)
Channel the constructor for the Channel class. |
Method Summary | |
void |
addChannelListener(com.sun.media.jsdt.event.ChannelListener listener)
add the specified Channel listener to receive Channel events for this Channel. |
void |
addConsumer(com.sun.media.jsdt.Client client,
com.sun.media.jsdt.ChannelConsumer consumer)
add a new ChannelConsumer for this Client. |
boolean |
dataAvailable(com.sun.media.jsdt.Client client)
tests whether there is Data available to read on this Channel. |
boolean |
isOrdered()
isOrdered returns whether this is an ordered channel. |
boolean |
isReliable()
isReliable test whether this is a reliable channel. |
void |
join(com.sun.media.jsdt.Client client)
join is used by a client to join an appropriate channel whose use is defined by the application. |
void |
join(com.sun.media.jsdt.Client client,
int mode)
join is used by a client to join an appropriate channel whose use is defined by the application. |
void |
leave(com.sun.media.jsdt.Client client)
leave removes a Client from this Channel. |
java.lang.String[] |
listConsumerNames()
list the names of the Clients who are currently consuming this Channel. |
com.sun.media.jsdt.Data |
receive(com.sun.media.jsdt.Client client)
is used to receive Data from other Clients joined to this Channel. |
com.sun.media.jsdt.Data |
receive(com.sun.media.jsdt.Client client,
long timeout)
is used to receive Data from other Clients joined to this Channel. |
void |
removeChannelListener(com.sun.media.jsdt.event.ChannelListener listener)
removes the specified Channel listener so that it no longer receives Channel events for this Channel. |
void |
removeConsumer(com.sun.media.jsdt.Client client,
com.sun.media.jsdt.ChannelConsumer consumer)
remove a ChannelConsumer from this Client for this Channel. |
void |
sendToAll(com.sun.media.jsdt.Client sendingClient,
com.sun.media.jsdt.Data data)
sendToAll is used to send data to all clients joined to this channel. |
void |
sendToClient(com.sun.media.jsdt.Client sendingClient,
java.lang.String receivingClientName,
com.sun.media.jsdt.Data data)
sendToClient is used to send data to a single client joined to this channel. |
void |
sendToOthers(com.sun.media.jsdt.Client sendingClient,
com.sun.media.jsdt.Data data)
sendToOthers is used to send data to other clients joined to this channel. |
Methods inherited from class com.sun.media.jsdt.impl.ManageableImpl |
addListener,
destroy,
disableListenerEvents,
disableManagerEvents,
enableListenerEvents,
enableManagerEvents,
expel,
getName,
getSession,
invite,
isManaged,
listClientNames |
Methods inherited from class com.sun.media.jsdt.impl.JSDTObject |
error,
getConnectionType,
setConnectionType |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final char M_Channel
public static final char D_All
public static final char D_Others
public static final char D_Client
protected SessionImpl session
public AbstractChannelProxy po
public AbstractChannelServer so
protected boolean reliable
protected boolean ordered
Constructor Detail |
public ChannelImpl(boolean isServer, java.lang.String name, SessionImpl session, boolean reliable, boolean ordered)
isServer
- set if are we creating object on the server-side.name
- the name of the channel being constructed.session
- the session this channel belongs to.reliable
- indicates whether the channel is reliable.ordered
- indicates whether the channel is ordered.Method Detail |
public void addChannelListener(com.sun.media.jsdt.event.ChannelListener listener) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.NoSuchChannelException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.TimedOutException
listener
- the Channel listener.public void removeChannelListener(com.sun.media.jsdt.event.ChannelListener listener) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.NoSuchChannelException, com.sun.media.jsdt.NoSuchListenerException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.TimedOutException
listener
- the Channel listener.public void addConsumer(com.sun.media.jsdt.Client client, com.sun.media.jsdt.ChannelConsumer consumer) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.InvalidClientException, com.sun.media.jsdt.NoSuchChannelException, com.sun.media.jsdt.NoSuchClientException, com.sun.media.jsdt.NoSuchConsumerException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.PermissionDeniedException, com.sun.media.jsdt.TimedOutException
client
- the Client to associate this ChannelConsumer with.consumer
- the new ChannelConsumer for this client.public void removeConsumer(com.sun.media.jsdt.Client client, com.sun.media.jsdt.ChannelConsumer consumer) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.InvalidClientException, com.sun.media.jsdt.NoSuchChannelException, com.sun.media.jsdt.NoSuchClientException, com.sun.media.jsdt.NoSuchConsumerException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.PermissionDeniedException, com.sun.media.jsdt.TimedOutException
client
- the Client to associate this ChannelConsumer with.consumer
- the ChannelConsumer to remove from this Client.public java.lang.String[] listConsumerNames() throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.NoSuchChannelException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.TimedOutException
public boolean isReliable()
public boolean isOrdered()
public void join(com.sun.media.jsdt.Client client) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.InvalidClientException, com.sun.media.jsdt.NoSuchChannelException, com.sun.media.jsdt.NoSuchClientException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.PermissionDeniedException, com.sun.media.jsdt.NameInUseException, com.sun.media.jsdt.TimedOutException
client
- identifies the client wishing to join this channel.public void join(com.sun.media.jsdt.Client client, int mode) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.InvalidClientException, com.sun.media.jsdt.NoSuchChannelException, com.sun.media.jsdt.NoSuchClientException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.PermissionDeniedException, com.sun.media.jsdt.NameInUseException, com.sun.media.jsdt.TimedOutException
client
- identifies the client wishing to join this channel.mode
- the mode which can be one of, READONLY, WRITEONLY or
READWRITE.public void leave(com.sun.media.jsdt.Client client) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.InvalidClientException, com.sun.media.jsdt.NoSuchChannelException, com.sun.media.jsdt.NoSuchClientException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.TimedOutException
client
- the Client in question.public com.sun.media.jsdt.Data receive(com.sun.media.jsdt.Client client) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.InvalidClientException, com.sun.media.jsdt.NoSuchClientException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.PermissionDeniedException, com.sun.media.jsdt.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 com.sun.media.jsdt.Data receive(com.sun.media.jsdt.Client client, long timeout) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.InvalidClientException, com.sun.media.jsdt.NoSuchClientException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.PermissionDeniedException, com.sun.media.jsdt.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(com.sun.media.jsdt.Client client) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.InvalidClientException, com.sun.media.jsdt.NoSuchClientException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.PermissionDeniedException, com.sun.media.jsdt.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(com.sun.media.jsdt.Client sendingClient, com.sun.media.jsdt.Data data) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.InvalidClientException, com.sun.media.jsdt.NoSuchChannelException, com.sun.media.jsdt.NoSuchClientException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.PermissionDeniedException, com.sun.media.jsdt.TimedOutException
sendingClient
- the client sending the data.data
- the data being sent over this channel.public void sendToOthers(com.sun.media.jsdt.Client sendingClient, com.sun.media.jsdt.Data data) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.InvalidClientException, com.sun.media.jsdt.NoSuchChannelException, com.sun.media.jsdt.NoSuchClientException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.PermissionDeniedException, com.sun.media.jsdt.TimedOutException
sendingClient
- the client sending the data.data
- the data being sent over this channel.public void sendToClient(com.sun.media.jsdt.Client sendingClient, java.lang.String receivingClientName, com.sun.media.jsdt.Data data) throws com.sun.media.jsdt.ConnectionException, com.sun.media.jsdt.InvalidClientException, com.sun.media.jsdt.NoSuchChannelException, com.sun.media.jsdt.NoSuchClientException, com.sun.media.jsdt.NoSuchConsumerException, com.sun.media.jsdt.NoSuchSessionException, com.sun.media.jsdt.PermissionDeniedException, com.sun.media.jsdt.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 |