Distributed Mode

Introduction

In the distributed mode, we add to make some decisions on the behavior of a container when it is stopped.

In the following page, we will list all the aspects of the behavior of a container that is stopping or stopped.

Impact on the Endpoints

All the Endpoints of the stopped container are kept in the JNDI directory.

To know if a endpoint is in a started or stopped container, we can check it using the EndpointService which will ask it to the DistributedJMXFactoryImpl.

The only way to know if a endpoint is reachabled is to check if its container is stopped. We can retrieve the state of a container by extracting its related ContainerInformation in the JNDI directory.

Impact on Joram

We add a shutdown hook to the class which launch Petals (Launcher) which stop correctly a Petals container (by invoking the stopFc method on each Fractal components).

Thus if we are in a console, when we want to stop a Petals container, we just have to hit CTRL+C.

If we are in Eclipse, we have to invoke the same command as to launch Petals with the argument stop.

If Joram is stopped correctly it will save its state in files that can be found in the directory joram/id_of_the_container. When the container will be started again, Joram will reload this files.