com.sun.sgs.impl.protocol.simple
Class SimpleSgsProtocolDescriptor

java.lang.Object
  extended by com.sun.sgs.impl.protocol.simple.SimpleSgsProtocolDescriptor
All Implemented Interfaces:
ProtocolDescriptor, Serializable

public class SimpleSgsProtocolDescriptor
extends Object
implements ProtocolDescriptor, Serializable

A protocol descriptor with an underlying transport descriptor. A protocol may use this class directly or extend it, overriding methods for protocol and/or transport-specific needs.

See Also:
Serialized Form

Field Summary
protected  TransportDescriptor transportDesc
          The transport descriptor for this protocol.
 
Constructor Summary
SimpleSgsProtocolDescriptor(TransportDescriptor transportDesc)
          Constructs an instance with the specified transport descriptor.
 
Method Summary
 byte[] getConnectionData()
          Return the protocol specific connection data as a byte array.
 boolean supportsProtocol(ProtocolDescriptor descriptor)
          Returns true if the specified descriptor represents a protocol supported by the protocol that this descriptor represents, and returns false otherwise.
 String toString()
          Returns a string representation of this descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

transportDesc

protected final TransportDescriptor transportDesc
The transport descriptor for this protocol.

Constructor Detail

SimpleSgsProtocolDescriptor

public SimpleSgsProtocolDescriptor(TransportDescriptor transportDesc)
Constructs an instance with the specified transport descriptor.

Parameters:
transportDesc - transport descriptor
Method Detail

supportsProtocol

public boolean supportsProtocol(ProtocolDescriptor descriptor)
Returns true if the specified descriptor represents a protocol supported by the protocol that this descriptor represents, and returns false otherwise. The determination of whether the given protocol is supported is protocol specific.

This implementation returns true if the specified descriptor is an instance of this class and this descriptor's underlying transport descriptor is compatible with the specified descriptor's transport descriptor.

Specified by:
supportsProtocol in interface ProtocolDescriptor
Parameters:
descriptor - a protocol descriptor
Returns:
true if the specified descriptor represents a protocol supported by the protocol that this descriptor represents, and false otherwise

getConnectionData

public byte[] getConnectionData()
Return the protocol specific connection data as a byte array. The data can be used by a client to connect to a server. The format of the data may be dependent on the transport configured with this protocol.

Returns:
the connection data

toString

public String toString()
Returns a string representation of this descriptor.

Overrides:
toString in class Object
Returns:
a string representation of this descriptor

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved