mandala.rami.impl
Interface AsynchronousPolicyFactory

All Known Implementing Classes:
FifoAPFactory, RandomAPFactory, SharedAPFactory

public interface AsynchronousPolicyFactory

This interface defines the factory which gives AsynchronousPolicy when creating AsynchronousReferenceImpl object.

Implementing class must be aware of the problem that may occur when sharing the same AsynchronousPolicy implementation within multiple AsynchronousReferenceImpl. Usually, single threaded semantic leads to deadlocks when they are shared whereas concurrent semantic does not. Moreover, non-thread safe objects may generally not be used through a concurrent semantic.

The following code will prevent sharing:


new AsynchronousPolicyFactory() { 
    public AsynchronousPolicy getAsynchronousPolicy(Object object) {
        // Do something usefull with object if necessary
        return new MyPolicy(object);
};

Version:
1.0
Author:
eipi
See Also:
AsynchronousPolicy, AsynchronousReferenceImpl

Method Summary
 AsynchronousPolicy getAsynchronousPolicy(java.lang.Object object)
          Returns the asynchronous policy an asynchronous reference on the given object must have.
 

Method Detail

getAsynchronousPolicy

public AsynchronousPolicy getAsynchronousPolicy(java.lang.Object object)

Returns the asynchronous policy an asynchronous reference on the given object must have.

Parameters:
object - the object to get an asynchronous reference with the specified asynchronous policy on.
Returns:
the asynchronous policy that must be used by asynchronous reference on the specified object.


Mandala help mailing list