|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.client.lightweight.LightweightClient
public final class LightweightClient
Lightweight implementation that manages a single client connection.
Note that this implements a singleton connector, so that all connections
from this VM will be routed through the same LightweightConnector,
but this would be easy to change for a more robust stress-testing client.
| Constructor Summary | |
|---|---|
LightweightClient(SimpleClientListener listener)
Creates an instance of LightweightClient. |
|
| Method Summary | |
|---|---|
boolean |
isConnected()
Returns true if this session is connected, otherwise
returns false. |
void |
login(Properties p)
Initiates a login session with the server. |
void |
logout(boolean force)
Initiates logging out from the server. |
void |
send(ByteBuffer message)
Sends the message contained in the specified ByteBuffer to
the server. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LightweightClient(SimpleClientListener listener)
LightweightClient.
| Method Detail |
|---|
public void login(Properties p)
throws IOException
ServerSession
login in interface ServerSessionp - the implementation specific connection properties to use
in creating the client's session
IOException
public void send(ByteBuffer message)
throws IOException
ServerSessionByteBuffer to
the server. 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 specified message is sent asynchronously to
the server; therefore, a successful invocation of this method does
not indicate that the given message was successfully sent. Messages
that are received by the server are delivered in sending order.
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 server by this invocation.
send in interface ServerSessionmessage - a message
IOException - if this session is disconnected or an IO error
occurspublic boolean isConnected()
ServerSessiontrue if this session is connected, otherwise
returns false.
isConnected in interface ServerSessiontrue if this session is connected, and
false otherwisepublic void logout(boolean force)
ServerSessionforce is
true then this session is forcibly terminated, for
example, by terminating the associated client's network connections.
If force is false, then this session
is gracefully disconnected, notifying the server that the client
logged out. When a session has been logged out, gracefully or
otherwise, the disconnected method is invoked on this session's associated ServerSessionListener passing a boolean indicating
whether the disconnection was graceful.
If this server session is already disconnected, then an
IllegalStateException is thrown.
logout in interface ServerSessionforce - if true, this session is forcibly
terminated; otherwise the session is gracefully disconnected
|
Project Darkstar, Version 0.9.8-SNAPSHOT 2013-07-29 20:21:26 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||