# Class InstanceContainer

java.lang.Object
org.apache.zookeeper.test.system.InstanceContainer

All Implemented Interfaces:
  `AsyncCallback, AsyncCallback.ChildrenCallback, Watcher`

public class InstanceContainer extends Object implements Watcher, AsyncCallback.ChildrenCallback
This class starts up,

## Nested Class Summary

### Nested classes/interfaces inherited from interface AsyncCallback

`AsyncCallback.ACLCallback, AsyncCallback.AllChildrenNumberCallback, AsyncCallback.Children2Callback, AsyncCallback.ChildrenCallback, AsyncCallback.Create2Callback, AsyncCallback.DataCallback, AsyncCallback.EphemeralsCallback, AsyncCallback.MultiCallback, AsyncCallback.StatCallback, AsyncCallback.StringCallback, AsyncCallback.VoidCallback`

### Nested classes/interfaces inherited from interface Watcher

`Watcher.Event, Watcher.WatcherType`

## Constructor Summary

Constructors
Constructor
Description
`InstanceContainer(String name, String zkHostPort, String prefix)`

## Method Summary

Modifier and Type
Method
Description
`static void`
`main(String[] args)`
`void`
`process(WatchedEvent event)`
`void`
`processResult(int rc, String path, Object ctx, List<String> children)`
Process the result of the asynchronous call.
`void`
`run()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### InstanceContainer

public InstanceContainer(String name, String zkHostPort, String prefix) throws UnknownHostException

Throws:
  `UnknownHostException`

## Method Details

### run

public void run() throws IOException, InterruptedException, KeeperException

Throws:
  `IOException`
  `InterruptedException`
  `KeeperException`

### main

public static void main(String[] args) throws UnknownHostException, IOException, InterruptedException, KeeperException

Parameters:
  `args` - the first parameter is the instance name, the second is the ZooKeeper spec. if the instance name is the empty string or "hostname", the hostname will be used.
Throws:
  `InterruptedException`
  `IOException`
  `UnknownHostException`
  `KeeperException`

### process

public void process(WatchedEvent event)

Specified by:
  `process` in interface `Watcher`

### processResult

public void processResult(int rc, String path, Object ctx, List<String> children)
Description copied from interface: `AsyncCallback.ChildrenCallback`
Process the result of the asynchronous call.

On success, rc is `KeeperException.Code.OK`.

On failure, rc is set to the corresponding failure code in `KeeperException`.

- `KeeperException.Code.NONODE` - The node on given path doesn't exist for some API calls.

Specified by:
  `processResult` in interface `AsyncCallback.ChildrenCallback`
Parameters:
  `rc` - The return code or the result of the call.
  `path` - The path that we passed to asynchronous calls.
  `ctx` - Whatever context object that we passed to asynchronous calls.
  `children` - An unordered array of children of the node on given path.
See Also:
  - `ZooKeeper.getChildren(String, boolean, AsyncCallback.ChildrenCallback, Object)`
  - `ZooKeeper.getChildren(String, Watcher, AsyncCallback.ChildrenCallback, Object)`