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
Modifier and TypeMethodDescriptionexportCallback(Class<?> callbackInterface, Object callbackObject) Publishes the given callback object to be ready for receiving callback requests.exportCallback(Class<?> callbackInterface, Object callbackObject, boolean serverSideCallback) Deprecated, for removal: This API element is subject to removal in a future version.getCallback(URI callbackUri) Returns the exported remote interface and the callback object identified by the designated callback URI.revokeCallbackExport(Object callbackObject) Revokes the export of the passed callback object if it is the last revoke.
-
Method Details
-
exportCallback
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 callbacks. If this is aServerSideProxyit will be automatically closed after its alive time has elapsed (and it has not been closed explicitly before).- Returns:
- The URI the callback object is registered.
-
exportCallback
@Deprecated(since="15.0.0", forRemoval=true) URI exportCallback(Class<?> callbackInterface, Object callbackObject, boolean serverSideCallback) Deprecated, for removal: This API element is subject to removal in a future version.UseexportCallback(Class, Object)with aServerSideProxyinstead.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 callbacks. If this is aServerSideProxyit will be automatically closed after its alive time has elapsed (and it has not been closed explicitly before).serverSideCallback- 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
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,
nullwill be returned. - Throws:
IllegalArgumentException- If the designated URI does not refer to a callback object exported via this communication service, anIllegalArgumentExceptionwill be thrown.
-
revokeCallbackExport
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, aIllegalArgumentExceptionwill be thrown.NullArgumentException- If null is provided, aNullArgumentExceptionwill be thrown.
-
exportCallback(Class, Object)with aServerSideProxyinstead.