code: public void deployManaged(@Observes DeployManagedDeployments event) throws Exception {
          forEachManagedDeployment(new Operation<Container, Deployment>() {
              @Inject
              private Event<DeploymentEvent> event;
  
              @Override
              public void perform(Container container, Deployment deployment) throws Exception {
                  //when a container is manually controlled, the deployment is deployed automatically
                  //once the container is manually started, not now
                  if (!"manual".equals(container.getContainerConfiguration().getMode())) {
                      if (container.getState() != State.STARTED) {
                          throw new IllegalStateException("Trying to deploy a managed deployment "
                              + deployment.getDescription().getName()
                              + " to a non started managed container "
                              + container.getName());
                      }
                      event.fire(new DeployDeployment(container, deployment));
                  }
              }
          });
      }
docs: Deploy all deployments marked as managed = true.
  
  @throws Exception