|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.service.session.ClientSessionWrapper
public class ClientSessionWrapper
A wrapper for a ClientSessionImpl object that is passed to the
application in the AppListener.loggedIn method when a client
session logs in. A ClientSessionWrapper is passed to the
application instead of a direct reference to a ClientSessionImpl
instance to avoid the possibility of the application removing the ClientSessionImpl instance from the data service and interfering with
the client session service's persistent data.
When a ClientSessionWrapper instance is removed from the data
service, the underlying client session is disconnected.
| Constructor Summary | |
|---|---|
ClientSessionWrapper(ManagedReference<ClientSessionImpl> sessionRef)
Constructs an instance with the specified sessionRef. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object object)
|
ClientSessionImpl |
getClientSession()
Returns the underlying ClientSessionImpl instance for this
wrapper. |
int |
getMaxMessageLength()
Return the maximum message length supported by this session. |
String |
getName()
Returns the login name used to authenticate this session. |
int |
hashCode()
|
boolean |
isConnected()
Returns true if the client is connected,
otherwise returns false. |
void |
removingObject()
Performs additional operations that are needed when this object is removed. |
ClientSession |
send(ByteBuffer message)
Sends a message contained in the specified ByteBuffer to
this session's client with the delivery guarantee of Delivery.RELIABLE. |
ClientSession |
send(ByteBuffer message,
Delivery delivery)
Sends a message contained in the specified ByteBuffer to
this session's client in a manner that satisfies the specified
delivery guarantee. |
Set<Delivery> |
supportedDeliveries()
Returns a set containing the delivery guarantees supported by this session. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
ClientSessionWrapper(ManagedReference<ClientSessionImpl> sessionRef)
sessionRef.
sessionRef - a reference to a client session to wrap| Method Detail |
|---|
public String getName()
getName in interface ClientSessionpublic Set<Delivery> supportedDeliveries()
supportedDeliveries in interface ClientSessionpublic int getMaxMessageLength()
getMaxMessageLength in interface ClientSessionpublic boolean isConnected()
true if the client is connected,
otherwise returns false.
isConnected in interface ClientSessiontrue if the client is connected,
otherwise returns falsepublic ClientSession send(ByteBuffer message)
ByteBuffer to
this session's client with the delivery guarantee of Delivery.RELIABLE. The message starts at the buffer's current
position and ends at the buffer's limit. The buffer's position is
not modified by this operation.
The ByteBuffer may be reused immediately after this method
returns. Changes made to the buffer after this method returns will
have no effect on the message sent to the client by this invocation.
This method is equivalent to invoking send with the specified message
and Delivery.RELIABLE.
send in interface ClientSessionmessage - a message
public ClientSession send(ByteBuffer message,
Delivery delivery)
ByteBuffer to
this session's client in a manner that satisfies the specified
delivery guarantee. The message starts at the buffer's
current position and ends at the buffer's limit. The buffer's
position is not modified by this operation.
When possible, the message should be delivered using the most
efficient means to satisfy the delivery guarantee. However, a
stronger delivery guarantee may be used to deliver the message if
the underlying protocol only supports stronger delivery guarantees.
If the protocol is not able to satisfy the specified delivery
guarantee (e.g., only supports weaker delivery guarantees than the
one specified), then a DeliveryNotSupportedException will be
thrown.
The ByteBuffer may be reused immediately after this method
returns. Changes made to the buffer after this method returns will
have no effect on the message sent to the client by this invocation.
send in interface ClientSessionmessage - a messagedelivery - a delivery guarantee
public void removingObject()
removingObject in interface ManagedObjectRemovalpublic boolean equals(Object object)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic ClientSessionImpl getClientSession()
ClientSessionImpl instance for this
wrapper. If the underlying client session has been removed, then
the client session has been disconnected, so IllegalStateException is thrown.
ClientSessionImpl instance for this
wrapper
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||