|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The ProxyObject
interface is an optional interface
that can be implemented by end-user classes to receive hotswap
transaction lifecycle events.
The names are prefixed with hotswap_
in order to avoid
potential name conflicts with end-user code.
Method Summary | |
Object |
hotswap_get(Object key)
This is the type-safe window two ProxyObject
instances having different Class membership can
communicate through. |
void |
hotswap_onCommit()
Called after hotswap_onPrepare(ProxyObject) in a
transaction to signal that consensus has been successfully
reached; state changes should be committed. |
boolean |
hotswap_onPrepare(ProxyObject oldInstance)
Called when the ProxyObject is first involved in a
hotswap transaction; the argument is the old
ProxyObject instance that will be subsequently
released (the one that this new object will replace). |
void |
hotswap_onRelease()
Called when the ProxyObject is about to be dropped
and presumably garbage-collected. |
void |
hotswap_onRollback()
Called after hotswap_onPrepare(Object) in a
transaction to signal that consensus has not been successfully
reached; state changes be discarded. |
Method Detail |
public Object hotswap_get(Object key)
ProxyObject
instances having different Class
membership can
communicate through. It is used for passing state from one
ProxyObject
instance to another within the body of
hotswap_onPrepare(ProxyObject oldInstance)
.public boolean hotswap_onPrepare(ProxyObject oldInstance)
ProxyObject
is first involved in a
hotswap transaction; the argument is the old
ProxyObject
instance that will be subsequently
released (the one that this new object will replace). The new
object may use this old object to synchronize state changes, is
desired.
The return value of the method should signal whether to
commit the swap or rollback: if the return value is
false
, this new instance will not replace
the old one; that is, the new object is saying I couldn't
successfully accomplish the state translation to the new
object, so rather than putting the application in a
unpredictable state, just stick with the current one
(rollback).
public void hotswap_onCommit()
hotswap_onPrepare(ProxyObject)
in a
transaction to signal that consensus has been successfully
reached; state changes should be committed.public void hotswap_onRollback()
hotswap_onPrepare(Object)
in a
transaction to signal that consensus has not been successfully
reached; state changes be discarded.public void hotswap_onRelease()
ProxyObject
is about to be dropped
and presumably garbage-collected.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |