Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

marauroa.net
Class MessageFactory  view MessageFactory download MessageFactory.java

java.lang.Object
  extended bymarauroa.net.MessageFactory

public class MessageFactory
extends java.lang.Object

MessageFactory is the class that is in charge of building the messages from the stream of bytes.


Field Summary
private static java.util.Map factoryArray
           
private static MessageFactory messageFactory
           
 
Constructor Summary
private MessageFactory()
           
 
Method Summary
static MessageFactory getFactory()
          This method returns an instance of MessageFactory
 Message getMessage(byte[] data, java.net.InetSocketAddress source)
          Returns a object of the right class from a stream of serialized data.
private  void register()
           
private  void register(int index, java.lang.Class messageClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factoryArray

private static java.util.Map factoryArray

messageFactory

private static MessageFactory messageFactory
Constructor Detail

MessageFactory

private MessageFactory()
Method Detail

getFactory

public static MessageFactory getFactory()
This method returns an instance of MessageFactory


register

private void register()

register

private void register(int index,
                      java.lang.Class messageClass)

getMessage

public Message getMessage(byte[] data,
                          java.net.InetSocketAddress source)
                   throws java.io.IOException
Returns a object of the right class from a stream of serialized data.