public abstract class CloudMembershipProvider extends MembershipProviderBase implements Heartbeat, ChannelListener
| Modifier and Type | Field and Description |
|---|---|
protected int |
connectionTimeout |
protected static String |
CUSTOM_ENV_PREFIX |
protected long |
expirationTime |
protected Map<String,String> |
headers |
protected String |
localIp |
protected MessageDigest |
md5 |
protected int |
port |
protected int |
readTimeout |
protected static StringManager |
sm |
protected Instant |
startTime |
protected StreamProvider |
streamProvider |
protected String |
url |
executor, membership, membershipListener, service| Constructor and Description |
|---|
CloudMembershipProvider() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(Serializable msg,
Member sender)
Invoked by the channel to determine if the listener will process this message or not.
|
protected abstract Member[] |
fetchMembers()
Fetch current cluster members from the cloud orchestration.
|
protected static String |
getEnv(String... keys)
Get value of environment variable.
|
protected String |
getNamespace()
Get the Kubernetes namespace, or "tomcat" if the Kubernetes environment variable
cannot be found (with a warning log about the missing namespace).
|
void |
heartbeat()
Heartbeat invocation for resources cleanup etc
|
void |
init(Properties properties) |
void |
messageReceived(Serializable msg,
Member sender)
Receive a message from the channel
|
void |
start(int level) |
boolean |
stop(int level) |
protected void |
updateMember(Member member,
boolean add)
Add or remove specified member.
|
getMember, getMembers, hasMembers, setMembershipListener, setMembershipServiceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCodeprotected static final StringManager sm
protected static final String CUSTOM_ENV_PREFIX
protected String url
protected StreamProvider streamProvider
protected int connectionTimeout
protected int readTimeout
protected Instant startTime
protected MessageDigest md5
protected String localIp
protected int port
protected long expirationTime
protected static String getEnv(String... keys)
keys - the environment variablesprotected String getNamespace()
public void init(Properties properties) throws IOException
init in interface MembershipProviderinit in class MembershipProviderBaseIOExceptionpublic void start(int level)
throws Exception
start in interface MembershipProviderExceptionpublic boolean stop(int level)
throws Exception
stop in interface MembershipProviderExceptionpublic void heartbeat()
Heartbeatprotected abstract Member[] fetchMembers()
protected void updateMember(Member member, boolean add)
member - the member to addadd - true if the member is added, false otherwisepublic void messageReceived(Serializable msg, Member sender)
ChannelListenermessageReceived in interface ChannelListenermsg - Serializablesender - - the source of the messagepublic boolean accept(Serializable msg, Member sender)
ChannelListeneraccept in interface ChannelListenermsg - Serializablesender - MemberCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.