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) |
getMember, getMembers, hasMembers, setMembershipListener, setMembershipService
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode
protected 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 MembershipProvider
init
in class MembershipProviderBase
IOException
public void start(int level) throws Exception
start
in interface MembershipProvider
Exception
public boolean stop(int level) throws Exception
stop
in interface MembershipProvider
Exception
public void heartbeat()
Heartbeat
protected abstract Member[] fetchMembers()
public void messageReceived(Serializable msg, Member sender)
ChannelListener
messageReceived
in interface ChannelListener
msg
- Serializablesender
- - the source of the messagepublic boolean accept(Serializable msg, Member sender)
ChannelListener
accept
in interface ChannelListener
msg
- Serializablesender
- MemberCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.