mandala.rami.impl
Class ARFactory

java.lang.Object
  extended bymandala.rami.AbstractARFactory
      extended bymandala.rami.impl.AbstractARImplFactory
          extended bymandala.rami.impl.ARFactory
All Implemented Interfaces:
Framework.Factory

public class ARFactory
extends AbstractARImplFactory

This factory creates AsynchronousReferenceImpl instances.

The class AsynchronousReferenceImpl needs CallbackManager, FutureFactory and AsynchronousPolicy instances to be created.

This factory uses a default asynchronous policy factory, returned by getDefaultAPFactory() as the default AsynchronousPolicyFactory which returns the AsynchronousPolicy to use when creating new AsynchronousReferenceImpl instances. See AbstractARImplFactory for others default instances.

.

The property mandala.rami.impl.apf can be used to specify the default asynchronous policy factory to use. This property must be a string containing the full name of a class implementing the AsynchronousPolicyFactory with a default no-arg constructor such as mandala.rami.impl.ThreadPooledAPFactory. If the property is unset, then the default asynchronous policy factory is set to ThreadPooledAPFactory.

Version:
1.0
Author:
eipi
See Also:
AsynchronousReferenceImpl, CallbackManager, FutureFactory, AsynchronousPolicyFactory

Field Summary
protected  AsynchronousPolicyFactory apf
          The AsynchronousPolicyFactory to use when creating new AsynchronousReferenceImpl instances.
static java.lang.String DEFAULT_APF_PROPERTY_STRING
          Defines the property string used to specify the default asynchronous policy factory instance.
 
Fields inherited from class mandala.rami.impl.AbstractARImplFactory
futureFactory
 
Fields inherited from class mandala.rami.AbstractARFactory
callbackManager
 
Constructor Summary
ARFactory()
          Creates a new ARFactory instance.
ARFactory(AsynchronousPolicyFactory apf)
          Creates a new ARFactory instance.
ARFactory(CallbackManager callBackManager)
          Creates a new ARFactory instance.
ARFactory(CallbackManager callBackManager, AsynchronousPolicyFactory apf)
          Creates a new ARFactory instance.
ARFactory(CallbackManager callBackManager, FutureFactory futureFactory)
          Creates a new ARFactory instance.
ARFactory(CallbackManager callBackManager, FutureFactory futureFactory, AsynchronousPolicyFactory apf)
          Creates a new ARFactory instance.
ARFactory(FutureFactory futureFactory)
          Creates a new ARFactory instance.
ARFactory(FutureFactory futureFactory, AsynchronousPolicyFactory apf)
          Creates a new ARFactory instance.
 
Method Summary
static AsynchronousPolicyFactory getDefaultAPFactory()
          Gets the default AsynchronousPolicyFactory used when creating new AsynchronousReferenceImpl instances.
protected  AsynchronousReference getInstance(java.lang.Object object, CallbackManager callBackManager, FutureFactory futureFactory)
          Gets an asynchronous reference on the specified object.
static void setDefaultAPFactory(AsynchronousPolicyFactory apf)
          Sets the default AsynchronousPolicyFactory to use when creating new AsynchronousReferenceImpl instances.
 
Methods inherited from class mandala.rami.impl.AbstractARImplFactory
getDefaultFutureFactory, getInstance, getInstance
 
Methods inherited from class mandala.rami.AbstractARFactory
getDefaultCallbackManager, newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_APF_PROPERTY_STRING

public static final java.lang.String DEFAULT_APF_PROPERTY_STRING

Defines the property string used to specify the default asynchronous policy factory instance.

See Also:
Constant Field Values

apf

protected final AsynchronousPolicyFactory apf

The AsynchronousPolicyFactory to use when creating new AsynchronousReferenceImpl instances.

See Also:
AsynchronousPolicyFactory, AsynchronousReferenceImpl
Constructor Detail

ARFactory

public ARFactory()

Creates a new ARFactory instance.

Equivalent to this(getDefaultCallbackManager(), getDefaultFutureFactory(), getDefaultAsynchronousPolicyFactory());.

See Also:
CallbackManager, FutureFactory, AsynchronousPolicyFactory, AsynchronousReferenceImpl

ARFactory

public ARFactory(CallbackManager callBackManager)

Creates a new ARFactory instance.

Equivalent to this(callBackManager, getDefaultFutureFactory(), getDefaultAsynchronousPolicyFactory()).

Parameters:
callBackManager - the CallbackManager to use.

ARFactory

public ARFactory(FutureFactory futureFactory)

Creates a new ARFactory instance.

Equivalent to this(getDefaultCallbackManager(), futureFactory, getDefaultAsynchronousPolicyFactory()); .

Parameters:
futureFactory - the future factory to use.

ARFactory

public ARFactory(AsynchronousPolicyFactory apf)

Creates a new ARFactory instance.

Equivalent to this(getDefaultCallbackManager(), getDefaultFutureFactory(), asynchronousPolicyFactory);

Parameters:
apf - an AsynchronousPolicyFactory value

ARFactory

public ARFactory(CallbackManager callBackManager,
                 FutureFactory futureFactory)

Creates a new ARFactory instance.

Equivalent to this(callBackManager, futureFactory, getDefaultAsynchronousPolicyFactory());.

Parameters:
callBackManager - a CallbackManager value
futureFactory - a FutureFactory value

ARFactory

public ARFactory(CallbackManager callBackManager,
                 AsynchronousPolicyFactory apf)

Creates a new ARFactory instance.

Equivalent to this(callBackManager, getDefaultFutureFactory(), asynchronousPolicyFactory);.

Parameters:
callBackManager - a CallbackManager value
apf - an AsynchronousPolicyFactory value

ARFactory

public ARFactory(FutureFactory futureFactory,
                 AsynchronousPolicyFactory apf)

Creates a new ARFactory instance.

Equivalent to this(getDefaultCallbackManager(), futureFactory, asynchronousPolicyFactory);.

Parameters:
futureFactory - a FutureFactory value
apf - an AsynchronousPolicyFactory value

ARFactory

public ARFactory(CallbackManager callBackManager,
                 FutureFactory futureFactory,
                 AsynchronousPolicyFactory apf)

Creates a new ARFactory instance.

The specified callbackManager, futureFactory and asynchronousPolicyFactory will be used when creating new AsynchronousReference.

Parameters:
callBackManager - a CallbackManager value
futureFactory - a FutureFactory value
apf - an AsynchronousPolicyFactory value
Method Detail

getDefaultAPFactory

public static AsynchronousPolicyFactory getDefaultAPFactory()

Gets the default AsynchronousPolicyFactory used when creating new AsynchronousReferenceImpl instances.

Returns:
the AsynchronousPolicyFactory used when creating new AsynchronousReferenceImpl instances.
See Also:
AsynchronousPolicyFactory, AsynchronousReferenceImpl

setDefaultAPFactory

public static void setDefaultAPFactory(AsynchronousPolicyFactory apf)

Sets the default AsynchronousPolicyFactory to use when creating new AsynchronousReferenceImpl instances.

Parameters:
apf - the default AsynchronousPolicyFactory to use when creating new AsynchronousReferenceImpl instances.

getInstance

protected AsynchronousReference getInstance(java.lang.Object object,
                                            CallbackManager callBackManager,
                                            FutureFactory futureFactory)
Description copied from class: AbstractARImplFactory

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 and futureFactory.

Specified by:
getInstance in class AbstractARImplFactory
Parameters:
object - an Object value
callBackManager - a CallbackManager value
futureFactory - a FutureFactory value
Returns:
the asynchronous reference on the specified object


Mandala help mailing list