mandala.rami
Class AbstractARFactory

java.lang.Object
  extended bymandala.rami.AbstractARFactory
All Implemented Interfaces:
Framework.Factory
Direct Known Subclasses:
AbstractARImplFactory, ARPFactory

public abstract class AbstractARFactory
extends java.lang.Object
implements Framework.Factory

This abstract class provides all the necessary method to customize the CallbackManager used when creating AsynchronousReference implementation instance.

This factory creates a new CallbackManagerImpl instance as the default CallbackManager to use when creating new AsynchronousReference implementation instances.

Subclasses must override the getInstance(Object, CallbackManager) to customize the creation of asynchronous references.

Version:
1.0
Author:
eipi
See Also:
CallbackManager, AsynchronousReference, CallbackManagerImpl

Field Summary
protected  CallbackManager callbackManager
          The CallbackManager to use when creating new AsynchronousReference implementation instances.
 
Constructor Summary
AbstractARFactory()
          Creates a new AbstractARFactory instance.
AbstractARFactory(CallbackManager callbackManager)
          Creates a new AbstractARFactory instance.
 
Method Summary
static CallbackManager getDefaultCallbackManager()
          Gets the default CallbackManager used when creating new AsynchronousReference implementation instances.
 AsynchronousReference getInstance(java.lang.Object object)
          Returns the AsynchronousReference which references the specified object.
protected abstract  AsynchronousReference getInstance(java.lang.Object object, CallbackManager callbackManager)
          Gets an asynchronous reference on the specified object.
 AsynchronousReference newInstance(ConstructorOp c, java.lang.Object[] args)
          Returns a new AsynchronousReference which references the object created with the given constructor and parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

callbackManager

protected CallbackManager callbackManager

The CallbackManager to use when creating new AsynchronousReference implementation instances.

See Also:
CallbackManager, AsynchronousReference
Constructor Detail

AbstractARFactory

public AbstractARFactory()

Creates a new AbstractARFactory instance.

Equivalent to this(getDefaultCallbackManager());.

See Also:
CallbackManager

AbstractARFactory

public AbstractARFactory(CallbackManager callbackManager)

Creates a new AbstractARFactory instance.

The specified callbackManager will be used when creating new AsynchronousReference.

Parameters:
callbackManager - the CallbackManager to use when creating new AsynchronousReference
Method Detail

getDefaultCallbackManager

public static CallbackManager getDefaultCallbackManager()

Gets the default CallbackManager used when creating new AsynchronousReference implementation instances.

Returns:
the default CallbackManager used when creating new AsynchronousReference implementation instances.
See Also:
CallbackManager, AsynchronousReference

getInstance

public AsynchronousReference getInstance(java.lang.Object object)
Description copied from interface: Framework.Factory

Returns the AsynchronousReference which references the specified object.

If such an asynchronous reference doesn't exist, it will be created.

Specified by:
getInstance in interface Framework.Factory
Parameters:
object - the object the returned asynchronous reference must refer to
Returns:
the asynchronous reference referencing the given object

getInstance

protected abstract AsynchronousReference getInstance(java.lang.Object object,
                                                     CallbackManager callbackManager)

Gets an asynchronous reference on the specified object.

If the object is not already referenced by an asynchronous reference, a new one is created with the specified callbackManager.

Parameters:
object - an Object value
callbackManager - a CallbackManager value
Returns:
the asynchronous reference on the specified object

newInstance

public AsynchronousReference newInstance(ConstructorOp c,
                                         java.lang.Object[] args)
Description copied from interface: Framework.Factory

Returns a new AsynchronousReference which references the object created with the given constructor and parameter.

Specified by:
newInstance in interface Framework.Factory
Parameters:
c - the constructor to use for the instanciation
args - the arguments to use for the instanciation
Returns:
the asynchronous reference on the new object


Mandala help mailing list