|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.util.ManagedReference<WithSerialId> groovyx.gpars.serial.SerialHandle
public class SerialHandle
Weak reference to object, which was serialized to remote hosts. Also keep ids of all hosts, where the object was serialized.
While subscribed by remote nodes it keeps object alive by holding strong reference (anchor) to it
Nested Class Summary | |
---|---|
private static class |
SerialHandle.LocalSerialHandle
|
private static class |
SerialHandle.RemoteSerialHandle
|
Field Summary | |
---|---|
private WithSerialId |
anchor
|
private static org.codehaus.groovy.util.ReferenceBundle |
bundle
|
protected SerialContext |
context
local host |
private static org.codehaus.groovy.util.ReferenceManager |
manager
|
private static java.lang.ref.ReferenceQueue<WithSerialId> |
queue
|
protected java.util.UUID |
serialId
serial id of the object |
private java.lang.Object |
subscribers
remote hosts subscribed to this objects |
Constructor Summary | |
---|---|
private |
SerialHandle(WithSerialId value,
java.util.UUID id)
Construct handle for object with given id to it |
Method Summary | |
---|---|
static SerialHandle |
create(WithSerialId obj,
java.util.UUID id)
|
void |
finalizeReference()
|
java.util.UUID |
getSerialId()
Serial id of the object |
java.lang.Object |
getSubscribers()
Getter for subscribers |
void |
subscribe(SerialContext context)
Subscribes host as interested in the object |
void |
unsubscribe(SerialContext context)
|
Methods inherited from class org.codehaus.groovy.util.ManagedReference |
---|
clear, get |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.ref.ReferenceQueue<WithSerialId> queue
private static final org.codehaus.groovy.util.ReferenceManager manager
private static final org.codehaus.groovy.util.ReferenceBundle bundle
protected final java.util.UUID serialId
protected final SerialContext context
private volatile java.lang.Object subscribers
private volatile WithSerialId anchor
Constructor Detail |
---|
private SerialHandle(WithSerialId value, java.util.UUID id)
value
- The value to associate with the idid
- The id, if null a new id will be generatedMethod Detail |
---|
public java.util.UUID getSerialId()
public void finalizeReference()
finalizeReference
in interface org.codehaus.groovy.util.Finalizable
finalizeReference
in class org.codehaus.groovy.util.ManagedReference<WithSerialId>
public java.lang.Object getSubscribers()
public void subscribe(SerialContext context)
context
- The subscription context to usepublic void unsubscribe(SerialContext context)
public static SerialHandle create(WithSerialId obj, java.util.UUID id)
|
Copyright © 2008–2012 Václav Pech. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |