com.sun.sgs.client.simple
Class SimpleClient.SimpleClientChannel

java.lang.Object
  extended by com.sun.sgs.client.simple.SimpleClient.SimpleClientChannel
All Implemented Interfaces:
ClientChannel
Enclosing class:
SimpleClient

final class SimpleClient.SimpleClientChannel
extends Object
implements ClientChannel

Simple ClientChannel implementation


Constructor Summary
SimpleClient.SimpleClientChannel(String name, BigInteger id)
           
 
Method Summary
 String getName()
          Returns the name of this channel.
(package private)  void joined()
           
(package private)  void left()
           
(package private)  void receivedMessage(ByteBuffer message)
           
 void send(ByteBuffer message)
          Sends the message contained in the specified ByteBuffer to all channel members, including the sender.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleClient.SimpleClientChannel

SimpleClient.SimpleClientChannel(String name,
                                 BigInteger id)
Method Detail

getName

public String getName()
Returns the name of this channel. A channel's name is set when it is created by the server-side application.

Specified by:
getName in interface ClientChannel
Returns:
the name of this channel

send

public void send(ByteBuffer message)
          throws IOException
Sends the message contained in the specified ByteBuffer to all channel members, including the sender. 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 server-side application associated with this client may alter the message being sent, or may discard the message for application-specific reasons. In the latter case, there will be no notification of the message being sent.

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 channel by this invocation.

Specified by:
send in interface ClientChannel
Parameters:
message - a message to send
Throws:
IOException - if a synchronous I/O problem occurs

joined

void joined()

left

void left()

receivedMessage

void receivedMessage(ByteBuffer message)

Project Darkstar, Version 0.9.9
2013-07-29 20:40:00

Copyright © 2007-2013 Sun Microsystems, Inc. All rights reserved