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 Detail

      • exportCallback

        URI exportCallback​(Class<?> callbackInterface,
                           Object callbackObject)
        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 a ServerSideProxy it 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.
        Use exportCallback(Class, Object) with a ServerSideProxy instead.
        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 a ServerSideProxy it 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

        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, an IllegalArgumentException 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, a IllegalArgumentException will be thrown.
        NullArgumentException - If null is provided, a NullArgumentException will be thrown.