|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.semispace.comet.client.SemiSpaceCometProxy
public class SemiSpaceCometProxy
Client side of comet proxy
Constructor Summary | |
---|---|
SemiSpaceCometProxy()
|
Method Summary | ||
---|---|---|
void |
destroy()
|
|
void |
init(String endpoint)
|
|
SemiEventRegistration |
notify(Object template,
SemiEventListener listener,
long duration)
Register a listener for a particular template search. |
|
|
read(T template,
long duration)
Read an object from the space, which has matching fields (or getters) with the template |
|
|
readIfExists(T template)
Same as read, with duration 0 |
|
|
take(T template,
long duration)
Same as read, except that the object is removed from the space. |
|
|
takeIfExists(T template)
Same as take, with a duration of 0 |
|
SemiLease |
write(Object obj,
long timeToLiveMs)
Write object into tuple space, with a life time given in ms. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SemiSpaceCometProxy()
Method Detail |
---|
public void init(String endpoint)
public void destroy()
public SemiLease write(Object obj, long timeToLiveMs)
SemiSpaceInterface
write
in interface SemiSpaceInterface
obj
- Object to be written into the spacetimeToLiveMs
- Life time in milliseconds of the written object
public <T> T read(T template, long duration)
SemiSpaceInterface
read
in interface SemiSpaceInterface
template
- Object of exactly the same type as what
is wanted as return value, with zero or more none-null fields or getters.duration
- How long you are willing to wait for an answer / match.
public <T> T readIfExists(T template)
SemiSpaceInterface
readIfExists
in interface SemiSpaceInterface
SemiSpaceInterface.read(Object, long)
public <T> T take(T template, long duration)
SemiSpaceInterface
take
in interface SemiSpaceInterface
SemiSpaceInterface.read(Object, long)
public <T> T takeIfExists(T template)
SemiSpaceInterface
takeIfExists
in interface SemiSpaceInterface
SemiSpaceInterface.take(Object, long)
,
SemiSpaceInterface.read(Object, long)
public SemiEventRegistration notify(Object template, SemiEventListener listener, long duration)
SemiSpaceInterface
notify
in interface SemiSpaceInterface
template
- Template to be matched.listener
- Listener to be notified when object with a matching template is foundduration
- How long this particular listener is valid.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |