Interface CamelClusterService
- All Superinterfaces:
AutoCloseable, CamelContextAware, HasCamelContext, HasId, IdAware, Ordered, Service
- All Known Subinterfaces:
CamelPreemptiveClusterService
-
Nested Class Summary
Nested Classes -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionAttributes associated to the service.Return the namespaces handled by this service.default intgetOrder()Gets the order.Get a view of the cluster bound to a namespace creating it if needed.booleanCheck if the service is the leader on the given namespace.voidreleaseView(CamelClusterView view) Release a view if it has no references.voidForce start of the view associated to the give namespace.voidForce stop of the view associated to the give namespace.default <T extends CamelClusterService>
TAccess the underlying concrete CamelClusterService implementation to provide access to further features.Methods inherited from interface CamelContextAware
setCamelContextMethods inherited from interface HasCamelContext
getCamelContextMethods inherited from interface IdAware
setGeneratedId, setId
-
Method Details
-
getOrder
default int getOrder()Description copied from interface:OrderedGets 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 useInteger.MAX_VALUEor egOrdered.LOWEST. -
getView
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
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
-
stopView
-
isLeader
Check if the service is the leader on the given namespace.- Parameters:
namespace- the namespace.
-
getAttributes
-
unwrap
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.
-