Package org.apache.camel.cluster
Interface CamelClusterService
- All Superinterfaces:
AutoCloseable
,CamelContextAware
,HasId
,IdAware
,Ordered
,Service
- All Known Subinterfaces:
CamelPreemptiveClusterService
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionAttributes associated to the service.Return the namespaces handled by this service.default int
getOrder()
Gets the order.Get a view of the cluster bound to a namespace creating it if needed.boolean
Check if the service is the leader on the given namespace.void
releaseView
(CamelClusterView view) Release a view if it has no references.void
Force start of the view associated to the give namespace.void
Force 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 org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
Methods inherited from interface org.apache.camel.spi.IdAware
setGeneratedId, setId
-
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 useInteger.MAX_VALUE
or 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
Force start of the view associated to the give namespace.- Throws:
Exception
-
stopView
Force stop of the view associated to the give namespace.- Throws:
Exception
-
isLeader
Check if the service is the leader on the given namespace.- Parameters:
namespace
- the namespace.
-
getAttributes
Attributes associated to the service. -
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.
-