### Lifecycle States within the JBI Environment

Stateful JBI artifacts such as Binding Components, Service Engines, and Service Assemblies, are managed for the whole domain (repository and one or more targets) and can also be managed per target.

Within a cluster environment, JBI components and Service Assemblies can have the following status in a domain:

- Enabled on all targets

  The component or Service Assembly is running on all the targets.

- Disabled on all targets

  The component or Service Assembly is shutdown (or stopped) on all the targets.

- Enabled on {n} targets

  The component or Service Assembly is started on some of the targets (but shutdown on at least one target).

- No targets

  The component is installed to the domain only (and is installed on zero non-domain targets) or the Service Assembly is deployed to the domain only (and deployed on zero non-domain targets).

On a particular target (a cluster or a standalone server instance), JBI components and Service Assemblies can have the following lifecycle states:

- Started

  The component or Service Assembly has been successfully started and is running on the target (in the case of a cluster, it is running on all the instances in the cluster).

- Stopped

  The component or Service Assembly has been stopped (which implies it was previously started). See the component documentation for the use of this state.

- Shutdown

  The component or Service Assembly has been shut down. In this state, the component can be uninstalled and the Service Assembly can be undeployed.

The JBI Runtime persists the lifecycle states of JBI components and Service Assemblies. When the server shuts down and then restarts, JBI components and Service Assemblies revert to their state at the time the server shut down.

Note - When the server restarts, the JBI runtime attempts to revert to the "desired" state of a JBI component or a Service Assembly. For example, suppose you tried to start a JBI component but it did not start due to an error in the component. If you restart the server, the JBI runtime attempts to start the component again.