synergynetframework.appsystem.services.net.objectmessaging
Class Network

java.lang.Object
  extended by synergynetframework.appsystem.services.net.objectmessaging.Network

public class Network
extends java.lang.Object

The Class Network.


Nested Class Summary
static class Network.RegisteredClass
          The Class RegisteredClass.
 
Constructor Summary
Network()
           
 
Method Summary
static Network.RegisteredClass getRegisteredClass(java.lang.Class<?> type)
          Gets the registered class.
static Network.RegisteredClass getRegisteredClass(short classID)
          Gets the registered class.
static java.util.HashMap<java.lang.Short,Network.RegisteredClass> getRegisteredClasses()
          Gets the registered classes.
static Network.RegisteredClass readClass(java.nio.ByteBuffer buffer)
          Read class.
static java.lang.Object readClassAndObject(ConnectionHandler connectionHandler, java.nio.ByteBuffer readBuffer)
          Read class and object.
static java.lang.Object readClassAndObject(ConnectionHandler connectionHandler, java.nio.ByteBuffer readBuffer, boolean lengthKnown)
          Read class and object.
static void register(java.lang.Class<?> type)
          Register.
static void register(java.lang.Class<?> type, Serializer serializer)
          Register.
static Network.RegisteredClass writeClass(java.lang.Class<?> type, java.nio.ByteBuffer buffer)
          Write class.
static void writeClassAndObject(ConnectionHandler connectionHandler, java.lang.Object object, java.nio.ByteBuffer writeBuffer)
          Write class and object.
static void writeClassAndObject(ConnectionHandler connectionHandler, java.lang.Object object, java.nio.ByteBuffer writeBuffer, boolean lengthKnown)
          Write class and object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Network

public Network()
Method Detail

getRegisteredClass

public static Network.RegisteredClass getRegisteredClass(java.lang.Class<?> type)
Gets the registered class.

Parameters:
type - the type
Returns:
the registered class

getRegisteredClass

public static Network.RegisteredClass getRegisteredClass(short classID)
Gets the registered class.

Parameters:
classID - the class id
Returns:
the registered class

getRegisteredClasses

public static java.util.HashMap<java.lang.Short,Network.RegisteredClass> getRegisteredClasses()
Gets the registered classes.

Returns:
the registered classes

readClass

public static Network.RegisteredClass readClass(java.nio.ByteBuffer buffer)
                                         throws SerializationException
Read class.

Parameters:
buffer - the buffer
Returns:
the registered class
Throws:
SerializationException - the serialization exception

readClassAndObject

public static java.lang.Object readClassAndObject(ConnectionHandler connectionHandler,
                                                  java.nio.ByteBuffer readBuffer)
                                           throws SerializationException
Read class and object.

Parameters:
connectionHandler - the connection handler
readBuffer - the read buffer
Returns:
the object
Throws:
SerializationException - the serialization exception

readClassAndObject

public static java.lang.Object readClassAndObject(ConnectionHandler connectionHandler,
                                                  java.nio.ByteBuffer readBuffer,
                                                  boolean lengthKnown)
                                           throws SerializationException
Read class and object.

Parameters:
connectionHandler - the connection handler
readBuffer - the read buffer
lengthKnown - the length known
Returns:
the object
Throws:
SerializationException - the serialization exception

register

public static void register(java.lang.Class<?> type)
Register.

Parameters:
type - the type

register

public static void register(java.lang.Class<?> type,
                            Serializer serializer)
Register.

Parameters:
type - the type
serializer - the serializer

writeClass

public static Network.RegisteredClass writeClass(java.lang.Class<?> type,
                                                 java.nio.ByteBuffer buffer)
                                          throws SerializationException
Write class.

Parameters:
type - the type
buffer - the buffer
Returns:
the registered class
Throws:
SerializationException - the serialization exception

writeClassAndObject

public static void writeClassAndObject(ConnectionHandler connectionHandler,
                                       java.lang.Object object,
                                       java.nio.ByteBuffer writeBuffer)
                                throws SerializationException
Write class and object.

Parameters:
connectionHandler - the connection handler
object - the object
writeBuffer - the write buffer
Throws:
SerializationException - the serialization exception

writeClassAndObject

public static void writeClassAndObject(ConnectionHandler connectionHandler,
                                       java.lang.Object object,
                                       java.nio.ByteBuffer writeBuffer,
                                       boolean lengthKnown)
                                throws SerializationException
Write class and object.

Parameters:
connectionHandler - the connection handler
object - the object
writeBuffer - the write buffer
lengthKnown - the length known
Throws:
SerializationException - the serialization exception