|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.remote.RemoteCallbackRegistry
public class RemoteCallbackRegistry
Register all callbacks, unregister when called back. Registry invokes an interrupt on timeout.
| Constructor Summary | |
|---|---|
RemoteCallbackRegistry()
|
|
| Method Summary | |
|---|---|
static boolean |
addRemoteCallbackPurgeListener(RemoteCallbackPurgeListener l)
Add a purge listener. |
static void |
clearRemoteCallbackPurgeListeners()
Remove all purge listeners. |
static void |
fireCallbackPurged(RemoteCallback callback,
RemoteTrancheServer server,
long createdTimestamp)
The caller should be the RemoteCallback, which will only happen if it is purged. |
static long |
getAbsoluteCallbackTimeoutInMillis()
The age at which any timeout is purged, regardless of whether the server is active or not. |
static long |
getCallbackTimeoutInMillis()
Callback will be interrupted after this time in milliseconds, throwing a PurgedCallbackException. |
static long |
getServerTimeoutInMillis()
The minimum amount of time should wait for a quite server before purging a callback. |
static void |
register(RemoteCallback callback,
RemoteTrancheServer server)
Add the callback to the registrar. |
static boolean |
removeRemoteCallbackPurgeListener(RemoteCallbackPurgeListener l)
Remove the given purge listener. |
static void |
setAbsoluteCallbackTimeoutInMillis(long aAbsoluteTimeoutInMillis)
The age at which any timeout is purged, regardless of whether the server is active or not. |
static void |
setCallbackTimeoutInMillis(long aTimeoutInMillis)
Callback will be interrupted after this time in milliseconds, throwing a PurgedCallbackException. |
static void |
setServerTimeoutInMillis(long aTimeoutInMillisSinceServerLastSent)
The minimum amount of time should wait for a quite server before purging a callback. |
static void |
unregister(RemoteCallback callback)
Unregister a callback that has been added to the registry. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteCallbackRegistry()
| Method Detail |
|---|
public static void register(RemoteCallback callback,
RemoteTrancheServer server)
Add the callback to the registrar. Registrar automatically purges callbacks that are timed out based on internal heuristics.
If a callback is returned, make sure to unregister it.
callback - server - public static void unregister(RemoteCallback callback)
Unregister a callback that has been added to the registry.
callback -
public static void fireCallbackPurged(RemoteCallback callback,
RemoteTrancheServer server,
long createdTimestamp)
The caller should be the RemoteCallback, which will only happen if it is purged.
callback - server - createdTimestamp - public static boolean addRemoteCallbackPurgeListener(RemoteCallbackPurgeListener l)
Add a purge listener.
l -
public static boolean removeRemoteCallbackPurgeListener(RemoteCallbackPurgeListener l)
Remove the given purge listener.
l -
public static void clearRemoteCallbackPurgeListeners()
Remove all purge listeners.
public static long getServerTimeoutInMillis()
The minimum amount of time should wait for a quite server before purging a callback.
This only happens if the callback is at least a certain age.
callbackTimeoutInMillis,
absoluteCallbackTimeoutInMillispublic static void setServerTimeoutInMillis(long aTimeoutInMillisSinceServerLastSent)
The minimum amount of time should wait for a quite server before purging a callback.
This only happens if the callback is at least a certain age.
aTimeoutInMillisSinceServerLastSent - callbackTimeoutInMillis,
absoluteCallbackTimeoutInMillispublic static long getAbsoluteCallbackTimeoutInMillis()
The age at which any timeout is purged, regardless of whether the server is active or not. 0 (or any negative number) will disable this timeout.
This is quite different from the other heuristic, which looks at both the age of the request and the length of time since last server response.
callbackTimeoutInMillis,
serverTimeoutInMillispublic static void setAbsoluteCallbackTimeoutInMillis(long aAbsoluteTimeoutInMillis)
The age at which any timeout is purged, regardless of whether the server is active or not. 0 (or any negative number) will disable this timeout.
This is quite different from the other heuristic, which looks at both the age of the request and the length of time since last server response.
aAbsoluteTimeoutInMillis - callbackTimeoutInMillis,
serverTimeoutInMillispublic static long getCallbackTimeoutInMillis()
Callback will be interrupted after this time in milliseconds, throwing a PurgedCallbackException.
This only happens if the server hasn't received any data for a minimal period.
serverTimeoutInMillis,
absoluteCallbackTimeoutInMillispublic static void setCallbackTimeoutInMillis(long aTimeoutInMillis)
Callback will be interrupted after this time in milliseconds, throwing a PurgedCallbackException.
This only happens if the server hasn't received any data for a minimal period.
aTimeoutInMillis - serverTimeoutInMillis,
absoluteCallbackTimeoutInMillis
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||