public class ContainerRegistrar
extends java.lang.Object
implements org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>, org.springframework.context.ApplicationContextAware
ZooKeeperConnection
used by this
registrar is closed, that ephemeral node will be eagerly deleted. Since the ZooKeeperConnection
typically has
its lifecycle managed by Spring, that would be the normal behavior when the owning ApplicationContext
is
itself closed.Constructor and Description |
---|
ContainerRegistrar(ZooKeeperConnection zkConnection,
ContainerAttributes containerAttributes,
ContainerRepository containerRepository,
org.springframework.xd.dirt.server.container.DeploymentListener deploymentListener)
Create an instance that will register the provided
ContainerAttributes whenever the underlying
ZooKeeperConnection is established. |
Modifier and Type | Method and Description |
---|---|
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
public ContainerRegistrar(ZooKeeperConnection zkConnection, ContainerAttributes containerAttributes, ContainerRepository containerRepository, org.springframework.xd.dirt.server.container.DeploymentListener deploymentListener)
ContainerAttributes
whenever the underlying
ZooKeeperConnection
is established. If that connection is already established at the time this instance
receives a ContextRefreshedEvent
, the attributes will be registered then. Otherwise, registration occurs
within a callback that is invoked for connected events as well as reconnected events.containerAttributes
- runtime and configured attributes for the containercontainerRepository
- repository for the containerszkConnection
- ZooKeeper connectionpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>