All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.jstuff.integration.serviceregistry.ServiceProxy Maven / Gradle / Ivy

/*
 * Copyright 2010-2022 by Sebastian Thomschke and contributors.
 * SPDX-License-Identifier: EPL-2.0
 */
package net.sf.jstuff.integration.serviceregistry;

import org.eclipse.jdt.annotation.Nullable;

/**
 * Interface implemented by the service instances handed out to services consumers.
 * Service consumers can cast the received service reference to this type to access service meta-data provided by the service registry.
 *
 * @author Sebastian Thomschke
 */
public interface ServiceProxy {
   /**
    * @return itself casted as the service interface
    */
   SERVICE_INTERFACE get();

   String getServiceEndpointId();

   /**
    * the concrete class of the service instance that has been registered
    */
   @Nullable
   Class getServiceImplementationClass();

   Class getServiceInterface();

   /**
    * @return true if the represented service is available
    */
   boolean isServiceAvailable();

   /**
    * Adds the given listener with a weak reference
    */
   boolean addServiceListener(ServiceListener listener);

   boolean removeServiceListener(ServiceListener listener);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy