|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.commons.Debuggable
org.tranche.remote.RemoteCallback
public abstract class RemoteCallback
Abstract remote callback with common functionality.
| Field Summary | |
|---|---|
static long |
NOT_COMPLETED
Flag meaning the callback is not fulfilled. |
| Constructor Summary | |
|---|---|
RemoteCallback(long id,
RemoteTrancheServer rts,
java.lang.String name,
java.lang.String description)
|
|
| Method Summary | |
|---|---|
abstract void |
callback(byte[] bytes)
Method to be implemented. |
java.lang.Exception |
getCachedException()
|
java.lang.String |
getDescription()
Returns the description of this callback. |
long |
getID()
|
java.lang.String |
getName()
Returns thename of this callback. |
java.lang.String |
getPurgeMsg()
Returns the message that was given for purging this callback. |
protected RemoteTrancheServer |
getRemoteTrancheServer()
|
long |
getTimeCompleted()
Returns the UNIX timestamp for when the callback was fulfilled. |
long |
getTimeStarted()
|
boolean |
isComplete()
Returns whether this callback has been fulfilled. |
protected boolean |
isPurged()
Returns whether purged. |
void |
keepAlive()
|
void |
notifyTimedOut()
|
void |
notifyWaiting()
Notify caller waiting callback. |
void |
purge(java.lang.String reason)
Purges callback, notifying waiting threads. |
protected void |
setCachedException(java.lang.Exception e)
|
void |
waitForCallback()
Caller blocks waiting for callback. |
| Methods inherited from class org.tranche.commons.Debuggable |
|---|
debugErr, debugErr, debugOut, isDebug, setDebug |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long NOT_COMPLETED
Flag meaning the callback is not fulfilled.
| Constructor Detail |
|---|
public RemoteCallback(long id,
RemoteTrancheServer rts,
java.lang.String name,
java.lang.String description)
id - rts - name - description - | Method Detail |
|---|
public abstract void callback(byte[] bytes)
Method to be implemented.
bytes - public void keepAlive()
public void waitForCallback()
throws java.lang.Exception
Caller blocks waiting for callback. Caller's execution blocked within RemoteTrancheServer.
java.lang.Exceptionpublic void notifyWaiting()
Notify caller waiting callback.
public void notifyTimedOut()
protected RemoteTrancheServer getRemoteTrancheServer()
public long getID()
public boolean isComplete()
Returns whether this callback has been fulfilled.
public long getTimeCompleted()
Returns the UNIX timestamp for when the callback was fulfilled.
public long getTimeStarted()
public void purge(java.lang.String reason)
Purges callback, notifying waiting threads. Sends a useful exception.
reason - protected boolean isPurged()
Returns whether purged. Used by callbacks for better exceptions.
public java.lang.String getPurgeMsg()
Returns the message that was given for purging this callback.
public java.lang.String getName()
Returns thename of this callback.
public java.lang.String getDescription()
Returns the description of this callback.
public java.lang.Exception getCachedException()
protected void setCachedException(java.lang.Exception e)
e -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||