Package com.alibaba.druid.pool.ha.node
Class ZookeeperNodeRegister
java.lang.Object
com.alibaba.druid.pool.ha.node.ZookeeperNodeRegister
A register which is used to register a node to an ephemeral node.
- Author:
- DigitalSonic
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Close the current GroupMember.void
destroy()
org.apache.curator.framework.CuratorFramework
getPath()
void
init()
Init a CuratorFramework if there's no CuratorFramework provided.boolean
register
(String nodeId, List<ZookeeperNodeInfo> payload) Register a Node which has a Properties as the payload.void
setClient
(org.apache.curator.framework.CuratorFramework client) void
void
setZkConnectString
(String zkConnectString)
-
Constructor Details
-
ZookeeperNodeRegister
public ZookeeperNodeRegister()
-
-
Method Details
-
init
public void init()Init a CuratorFramework if there's no CuratorFramework provided. -
register
Register a Node which has a Properties as the payload.CAUTION: only one node can be registered, if you want to register another one, call deregister first
- Parameters:
payload
- The information used to generate the payload Properties- Returns:
- true, register successfully; false, skip the registeration
-
deregister
public void deregister()Close the current GroupMember. -
destroy
public void destroy()- See Also:
-
setClient
public void setClient(org.apache.curator.framework.CuratorFramework client) -
getClient
public org.apache.curator.framework.CuratorFramework getClient() -
getZkConnectString
-
setZkConnectString
-
getPath
-
setPath
-