m.c.m.proxyma.buffers
Class ByteBufferFactory

java.lang.Object
  extended by m.c.m.proxyma.buffers.ByteBufferFactory

public class ByteBufferFactory
extends java.lang.Object

This class is the factory for the ByteBuffers implementations and allows the users to change the buffers implementation as needed.
Note: The configration is valid for a single context.

NOTE: this software is released under GPL License. See the LICENSE of this distribution for more informations.

Version:
$Id: ByteBufferFactory.java 138 2010-06-20 13:53:32Z marcolinuz $
Author:
Marco Casavecchia Morganti (marcolinuz) [marcolinuz-at-gmail.com]

Constructor Summary
ByteBufferFactory()
           
 
Method Summary
static ByteBuffer createNewByteBuffer(ProxymaContext context)
          Creates a new instance of a ByteBuffer implementation.
static ByteBufferReader createNewByteBufferReader(ByteBuffer theDataToRead)
          Creates a new instance of a ByteBufferReader implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteBufferFactory

public ByteBufferFactory()
Method Detail

createNewByteBuffer

public static ByteBuffer createNewByteBuffer(ProxymaContext context)
                                      throws java.lang.IllegalArgumentException,
                                             java.lang.ClassNotFoundException,
                                             java.lang.InstantiationException,
                                             java.lang.IllegalAccessException,
                                             java.lang.reflect.InvocationTargetException,
                                             java.lang.NoSuchMethodException
Creates a new instance of a ByteBuffer implementation.
The specific implementation is choosen from the configration of the context.

Parameters:
context - the context where to find the configuration data.
Returns:
a new ByteBuffer
Throws:
java.lang.IllegalArgumentException - if the class is not a ByteBuffer implementation
java.lang.ClassNotFoundException - if the class is not found
java.lang.InstantiationException - if the object can't be instantiated
java.lang.IllegalAccessException - if there is an access violation.
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException

createNewByteBufferReader

public static ByteBufferReader createNewByteBufferReader(ByteBuffer theDataToRead)
                                                  throws java.lang.IllegalArgumentException,
                                                         java.lang.ClassNotFoundException,
                                                         java.lang.InstantiationException,
                                                         java.lang.IllegalAccessException,
                                                         java.lang.reflect.InvocationTargetException
Creates a new instance of a ByteBufferReader implementation.
The specific implementation is choosen from the configration of the context.

Parameters:
context - the context where to find the configuration data.
Returns:
a new ByteBuffer
Throws:
java.lang.IllegalArgumentException - if the class is not a ByteBuffer implementation
java.lang.ClassNotFoundException - if the class is not found
java.lang.InstantiationException - if the object can't be instantiated
java.lang.IllegalAccessException - if there is an access violation.
java.lang.reflect.InvocationTargetException


Copyright © 2010. All Rights Reserved.