|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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); };
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 |
public AsynchronousPolicy getAsynchronousPolicy(java.lang.Object object)
Returns the asynchronous policy an asynchronous reference on the given object must have.
object
- the object to get an asynchronous reference with the
specified asynchronous policy on.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |