Class CloudMembershipProvider
java.lang.Object
org.apache.catalina.tribes.membership.MembershipProviderBase
org.apache.catalina.tribes.membership.cloud.CloudMembershipProvider
- All Implemented Interfaces:
- ChannelListener,- Heartbeat,- MembershipProvider
- Direct Known Subclasses:
- DNSMembershipProvider,- KubernetesMembershipProvider
public abstract class CloudMembershipProvider
extends MembershipProviderBase
implements Heartbeat, ChannelListener
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected intprotected static final Stringprotected longprotected Stringprotected MessageDigestprotected intprotected intprotected static final StringManagerprotected Instantprotected StreamProviderprotected StringFields inherited from class org.apache.catalina.tribes.membership.MembershipProviderBaseexecutor, membership, membershipListener, service
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaccept(Serializable msg, Member sender) Invoked by the channel to determine if the listener will process this message or not.protected abstract Member[]Fetch current cluster members from the cloud orchestration.protected static StringGet value of environment variable.protected StringGet the Kubernetes namespace, or "tomcat" if the Kubernetes environment variable cannot be found (with a warning log about the missing namespace).voidHeartbeat invocation for resources cleanup etcvoidinit(Properties properties) voidmessageReceived(Serializable msg, Member sender) Receive a message from the channelvoidstart(int level) booleanstop(int level) protected voidupdateMember(Member member, boolean add) Add or remove specified member.Methods inherited from class org.apache.catalina.tribes.membership.MembershipProviderBasegetMember, getMembers, hasMembers, setMembershipListener, setMembershipServiceMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.catalina.tribes.ChannelListenerequals, hashCode
- 
Field Details- 
sm
- 
CUSTOM_ENV_PREFIX- See Also:
 
- 
url
- 
streamProvider
- 
connectionTimeoutprotected int connectionTimeout
- 
readTimeoutprotected int readTimeout
- 
startTime
- 
md5
- 
headers
- 
localIp
- 
portprotected int port
- 
expirationTimeprotected long expirationTime
 
- 
- 
Constructor Details- 
CloudMembershipProviderpublic CloudMembershipProvider()
 
- 
- 
Method Details- 
getEnvGet value of environment variable.- Parameters:
- keys- the environment variables
- Returns:
- the env variables values, or null if not found
 
- 
getNamespaceGet the Kubernetes namespace, or "tomcat" if the Kubernetes environment variable cannot be found (with a warning log about the missing namespace).- Returns:
- the namespace
 
- 
init- Specified by:
- initin interface- MembershipProvider
- Overrides:
- initin class- MembershipProviderBase
- Throws:
- IOException
 
- 
start- Specified by:
- startin interface- MembershipProvider
- Throws:
- Exception
 
- 
stop- Specified by:
- stopin interface- MembershipProvider
- Throws:
- Exception
 
- 
heartbeatpublic void heartbeat()Description copied from interface:HeartbeatHeartbeat invocation for resources cleanup etc
- 
fetchMembersFetch current cluster members from the cloud orchestration.- Returns:
- the member array
 
- 
updateMemberAdd or remove specified member.- Parameters:
- member- the member to add
- add- true if the member is added, false otherwise
 
- 
messageReceivedDescription copied from interface:ChannelListenerReceive a message from the channel- Specified by:
- messageReceivedin interface- ChannelListener
- Parameters:
- msg- Serializable
- sender- - the source of the message
 
- 
acceptDescription copied from interface:ChannelListenerInvoked by the channel to determine if the listener will process this message or not.- Specified by:
- acceptin interface- ChannelListener
- Parameters:
- msg- Serializable
- sender- Member
- Returns:
- boolean
 
 
-