org.ogf.saga.buffer
Class BufferFactory

java.lang.Object
  extended by org.ogf.saga.buffer.BufferFactory

public abstract class BufferFactory
extends Object

Factory for creating buffers.


Constructor Summary
BufferFactory()
           
 
Method Summary
static Buffer createBuffer()
          Creates a (implementation-managed) buffer.
static Buffer createBuffer(byte[] data)
          Creates a (application-allocated) buffer.
static Buffer createBuffer(int size)
          Creates a (implementation-managed) buffer of the specified size.
static Buffer createBuffer(String sagaFactoryClassname)
          Creates a (implementation-managed) buffer.
static Buffer createBuffer(String sagaFactoryClassname, byte[] data)
          Creates a (application-allocated) buffer.
static Buffer createBuffer(String sagaFactoryClassname, int size)
          Creates a (implementation-managed) buffer of the specified size.
protected abstract  Buffer doCreateBuffer(byte[] data)
          Creates a buffer.
protected abstract  Buffer doCreateBuffer(int size)
          Creates a buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferFactory

public BufferFactory()
Method Detail

doCreateBuffer

protected abstract Buffer doCreateBuffer(byte[] data)
                                  throws BadParameterException,
                                         NoSuccessException
Creates a buffer. To be provided by an implementation.

Parameters:
data - the storage.
Returns:
the buffer.
Throws:
BadParameterException
NoSuccessException

doCreateBuffer

protected abstract Buffer doCreateBuffer(int size)
                                  throws BadParameterException,
                                         NoSuccessException
Creates a buffer. To be provided by an implementation.

Parameters:
size - the size of the buffer.
Returns:
the buffer.
Throws:
BadParameterException
NoSuccessException

createBuffer

public static Buffer createBuffer(byte[] data)
                           throws BadParameterException,
                                  NoSuccessException
Creates a (application-allocated) buffer. The size is implicit in the size of the specified array.

Parameters:
data - the storage.
Returns:
the buffer.
Throws:
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
BadParameterException - is thrown when the implementation cannot handle the specified data buffer.

createBuffer

public static Buffer createBuffer(String sagaFactoryClassname,
                                  byte[] data)
                           throws BadParameterException,
                                  NoSuccessException
Creates a (application-allocated) buffer. The size is implicit in the size of the specified array.

Parameters:
sagaFactoryClassname - the class name of the Saga factory to be used.
data - the storage.
Returns:
the buffer.
Throws:
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
BadParameterException - is thrown when the implementation cannot handle the specified data buffer.

createBuffer

public static Buffer createBuffer(int size)
                           throws BadParameterException,
                                  NoSuccessException
Creates a (implementation-managed) buffer of the specified size.

Parameters:
size - the size.
Returns:
the buffer.
Throws:
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
BadParameterException - is thrown when the implementation cannot handle the specified size.

createBuffer

public static Buffer createBuffer(String sagaFactoryClassname,
                                  int size)
                           throws BadParameterException,
                                  NoSuccessException
Creates a (implementation-managed) buffer of the specified size.

Parameters:
sagaFactoryClassname - the class name of the Saga factory to be used.
size - the size.
Returns:
the buffer.
Throws:
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
BadParameterException - is thrown when the implementation cannot handle the specified size.

createBuffer

public static Buffer createBuffer()
                           throws BadParameterException,
                                  NoSuccessException
Creates a (implementation-managed) buffer.

Returns:
the buffer.
Throws:
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
BadParameterException - is thrown when the defaults are not suitable.

createBuffer

public static Buffer createBuffer(String sagaFactoryClassname)
                           throws BadParameterException,
                                  NoSuccessException
Creates a (implementation-managed) buffer.

Parameters:
sagaFactoryClassname - the class name of the Saga factory to be used.
Returns:
the buffer.
Throws:
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
BadParameterException - is thrown when the defaults are not suitable.


Copyright © 2014 Open Grid Forum. All rights reserved.