public class ZookeeperServiceDiscovery extends Object implements org.springframework.context.ApplicationContextAware
Constructor and Description |
---|
ZookeeperServiceDiscovery(org.apache.curator.framework.CuratorFramework curator,
ZookeeperDiscoveryProperties properties,
org.apache.curator.x.discovery.details.InstanceSerializer<ZookeeperInstance> instanceSerializer) |
Modifier and Type | Method and Description |
---|---|
void |
build() |
protected void |
configureServiceDiscovery(AtomicReference<org.apache.curator.x.discovery.ServiceDiscovery<ZookeeperInstance>> serviceDiscovery,
org.apache.curator.framework.CuratorFramework curator,
ZookeeperDiscoveryProperties properties,
org.apache.curator.x.discovery.details.InstanceSerializer<ZookeeperInstance> instanceSerializer,
AtomicReference<org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance>> serviceInstance) |
protected void |
configureServiceInstance(AtomicReference<org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance>> serviceInstance,
String appName,
org.springframework.context.ApplicationContext context,
AtomicInteger port,
String host,
org.apache.curator.x.discovery.UriSpec uriSpec) |
protected AtomicBoolean |
getBuilt() |
protected org.apache.curator.framework.CuratorFramework |
getCurator() |
static String |
getIpAddress()
Return a non loopback IPv4 address for the machine running this process.
|
int |
getPort() |
org.apache.curator.x.discovery.ServiceDiscovery<ZookeeperInstance> |
getServiceDiscovery() |
protected AtomicReference<org.apache.curator.x.discovery.ServiceDiscovery<ZookeeperInstance>> |
getServiceDiscoveryRef() |
org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance> |
getServiceInstance() |
protected AtomicReference<org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance>> |
getServiceInstanceRef() |
void |
setApplicationContext(org.springframework.context.ApplicationContext context) |
void |
setPort(int port) |
public ZookeeperServiceDiscovery(org.apache.curator.framework.CuratorFramework curator, ZookeeperDiscoveryProperties properties, org.apache.curator.x.discovery.details.InstanceSerializer<ZookeeperInstance> instanceSerializer)
public int getPort()
public void setPort(int port)
public org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance> getServiceInstance()
public org.apache.curator.x.discovery.ServiceDiscovery<ZookeeperInstance> getServiceDiscovery()
public void setApplicationContext(org.springframework.context.ApplicationContext context) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void build()
protected void configureServiceInstance(AtomicReference<org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance>> serviceInstance, String appName, org.springframework.context.ApplicationContext context, AtomicInteger port, String host, org.apache.curator.x.discovery.UriSpec uriSpec)
protected void configureServiceDiscovery(AtomicReference<org.apache.curator.x.discovery.ServiceDiscovery<ZookeeperInstance>> serviceDiscovery, org.apache.curator.framework.CuratorFramework curator, ZookeeperDiscoveryProperties properties, org.apache.curator.x.discovery.details.InstanceSerializer<ZookeeperInstance> instanceSerializer, AtomicReference<org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance>> serviceInstance)
public static String getIpAddress()
NetworkInterface.getNetworkInterfaces()
is returned.NetworkInterface.getNetworkInterfaces()
,
NetworkInterface.getInetAddresses()
protected AtomicReference<org.apache.curator.x.discovery.ServiceDiscovery<ZookeeperInstance>> getServiceDiscoveryRef()
protected AtomicReference<org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance>> getServiceInstanceRef()
protected AtomicBoolean getBuilt()
protected org.apache.curator.framework.CuratorFramework getCurator()
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.