Interface ADEPT2CallbackExport
-
public interface ADEPT2CallbackExport
This module of the communication service is responsible for the export of callback objects, i. e. to enable callback objects to be called remotely.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description URI
exportCallback(Class<?> callbackInterface, Object callbackObject, boolean serverSideCallback)
Publishes the given callback object to be ready for receiving callback requests.Pair<Class<?>,Object>
getCallback(URI callbackUri)
Returns the exported remote interface and the callback object identified by the designated callback URI.URI
revokeCallbackExport(Object callbackObject)
Revokes the export of the passed callback object if it is the last revoke.
-
-
-
Method Detail
-
exportCallback
URI exportCallback(Class<?> callbackInterface, Object callbackObject, boolean serverSideCallback)
Publishes the given callback object to be ready for receiving callback requests. This is re-entrant, that is an object may be exported several times and needs to be revoked for each export.- Parameters:
callbackInterface
- The type of the callback.callbackObject
- The callbackObject waiting for callbacksserverSideCallback
- Whether the designated object is a callback on server side. These objects are usually only referenced by the callback export and thus should not be referenced by a weak reference only.- Returns:
- The URI the callback object is registered.
-
getCallback
Pair<Class<?>,Object> getCallback(URI callbackUri)
Returns the exported remote interface and the callback object identified by the designated callback URI.- Parameters:
callbackUri
- The identifier of the requested callback object.- Returns:
- The remote interface and the callback object associated with the given callbackURI. If
no callback object with the designated name is known,
null
will be returned. - Throws:
IllegalArgumentException
- If the designated URI does not refer to a callback object exported via this communication service, anIllegalArgumentException
will be thrown.
-
revokeCallbackExport
URI revokeCallbackExport(Object callbackObject)
Revokes the export of the passed callback object if it is the last revoke.- Parameters:
callbackObject
- The callback object whose export should be revoked.- Returns:
- Returns the URI the designated callback object was registered till now.
- Throws:
IllegalArgumentException
- If the designated object is not registered, aIllegalArgumentException
will be thrown.NullArgumentException
- If null is provided, aNullArgumentException
will be thrown.
-
-