Package org.apache.camel.cluster
Interface CamelClusterView
-
- All Superinterfaces:
AutoCloseable
,CamelContextAware
,Service
- All Known Subinterfaces:
CamelPreemptiveClusterView
public interface CamelClusterView extends Service, CamelContextAware
Represents the View of the cluster at some given period of time.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addEventListener(CamelClusterEventListener listener)
Add an event listener.CamelClusterService
getClusterService()
Optional<CamelClusterMember>
getLeader()
Provides the leader member if elected.CamelClusterMember
getLocalMember()
Provides the local member.List<CamelClusterMember>
getMembers()
Provides the list of members of the cluster.String
getNamespace()
void
removeEventListener(CamelClusterEventListener listener)
Remove the event listener.default <T extends CamelClusterView>
Tunwrap(Class<T> clazz)
Access the underlying concrete CamelClusterView implementation to provide access to further features.-
Methods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
-
-
-
-
Method Detail
-
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
void addEventListener(CamelClusterEventListener listener)
Add an event listener.- Parameters:
listener
- the event listener.
-
removeEventListener
void removeEventListener(CamelClusterEventListener listener)
Remove the event listener.- Parameters:
listener
- the event listener.
-
unwrap
default <T extends CamelClusterView> T unwrap(Class<T> clazz)
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.
-
-