Interface CamelClusterService

All Superinterfaces:
AutoCloseable, CamelContextAware, HasId, IdAware, Ordered, Service
All Known Subinterfaces:
CamelPreemptiveClusterService

public interface CamelClusterService extends Service, CamelContextAware, IdAware, Ordered
  • Method Details

    • getOrder

      default int getOrder()
      Description copied from interface: Ordered
      Gets the order.

      Use low numbers for higher priority. Normally the sorting will start from 0 and move upwards. So if you want to be last then use Integer.MAX_VALUE or eg Ordered.LOWEST.

      Specified by:
      getOrder in interface Ordered
      Returns:
      the order
    • getView

      CamelClusterView getView(String namespace) throws Exception
      Get a view of the cluster bound to a namespace creating it if needed. Multiple calls to this method with the same namespace should return the same instance. The instance is automatically started the first time it is instantiated and if the cluster service is ready.
      Parameters:
      namespace - the namespace the view refer to.
      Returns:
      the view.
      Throws:
      Exception - if the view can't be created.
    • releaseView

      void releaseView(CamelClusterView view) throws Exception
      Release a view if it has no references.
      Parameters:
      view - the view.
      Throws:
      Exception
    • getNamespaces

      Collection<String> getNamespaces()
      Return the namespaces handled by this service.
    • startView

      void startView(String namespace) throws Exception
      Force start of the view associated to the give namespace.
      Throws:
      Exception
    • stopView

      void stopView(String namespace) throws Exception
      Force stop of the view associated to the give namespace.
      Throws:
      Exception
    • isLeader

      boolean isLeader(String namespace)
      Check if the service is the leader on the given namespace.
      Parameters:
      namespace - the namespace.
    • getAttributes

      default Map<String,Object> getAttributes()
      Attributes associated to the service.
    • unwrap

      default <T extends CamelClusterService> T unwrap(Class<T> clazz)
      Access the underlying concrete CamelClusterService implementation to provide access to further features.
      Parameters:
      clazz - the proprietary class or interface of the underlying concrete CamelClusterService.
      Returns:
      an instance of the underlying concrete CamelClusterService as the required type.