Package org.apache.camel.cluster
Interface CamelClusterView
- All Superinterfaces:
AutoCloseable,CamelContextAware,HasCamelContext,Service
- All Known Subinterfaces:
CamelPreemptiveClusterView
Represents the View of the cluster at some given period of time.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventListener(CamelClusterEventListener listener) Add an event listener.Provides the leader member if elected.Provides the local member.Provides the list of members of the cluster.voidremoveEventListener(CamelClusterEventListener listener) Remove the event listener.default <T extends CamelClusterView>
TAccess the underlying concrete CamelClusterView implementation to provide access to further features.Methods inherited from interface org.apache.camel.CamelContextAware
setCamelContextMethods inherited from interface org.apache.camel.spi.HasCamelContext
getCamelContext
-
Method Details
-
getClusterService
CamelClusterService getClusterService()- Returns:
- the cluster.
-
getNamespace
String getNamespace()- Returns:
- the namespace for this view.
-
getLeader
Optional<CamelClusterMember> getLeader()Provides the leader member if elected.- Returns:
- the leader member.
-
getLocalMember
CamelClusterMember getLocalMember()Provides the local member.- Returns:
- the local member.
-
getMembers
List<CamelClusterMember> getMembers()Provides the list of members of the cluster.- Returns:
- the list of members.
-
addEventListener
Add an event listener.- Parameters:
listener- the event listener.
-
removeEventListener
Remove the event listener.- Parameters:
listener- the event listener.
-
unwrap
Access the underlying concrete CamelClusterView implementation to provide access to further features.- Parameters:
clazz- the proprietary class or interface of the underlying concrete CamelClusterView.- Returns:
- an instance of the underlying concrete CamelClusterView as the required type.
-