All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ow2.petals.microkernel.api.container.ServiceAssemblyLifeCycle Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
/**
 * Copyright (c) 2007-2012 EBM WebSourcing, 2012-2016 Linagora
 * 
 * This program/library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or (at your
 * option) any later version.
 * 
 * This program/library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program/library; If not, see http://www.gnu.org/licenses/
 * for the GNU Lesser General Public License version 2.1.
 */
package org.ow2.petals.microkernel.api.container;

import java.util.Collection;
import java.util.List;

import javax.jbi.JBIException;
import javax.jbi.management.DeploymentServiceMBean;

import org.ow2.petals.jbi.descriptor.original.generated.ServiceAssembly;

/**
 * The LifeCycle interface of a service assembly.
 * 
 * @author Christophe DENEUX - Linagora
 */
public interface ServiceAssemblyLifeCycle {

    public static final String COMPONENT_LOGGER_NAME = "Petals.Container.Lifecycle.ServiceAssemblyLifeCycle";

    /**
     * Name of the server interface of the Fractal component associated to the JBI service assembly life cycle
     */
    public static final String FRACTAL_SRV_ITF_NAME = "service";

    public Collection getServiceUnitLifeCycles();

    public ServiceAssembly getServiceAssembly();

    /**
     * Initialize the life-cycle. This is not the init() step of the life-cycle.
     * 
     * @param mbeanName
     *            name of the MBean for this LifeCycle. In fact, the
     *            DeploymentServiceMBean name is used as there is no
     *            SALifeCycleMBean
     * @param log
     * @throws JBIException
     */
    public void init(final ServiceAssembly serviceAssembly) throws JBIException;

    /**
     * Used by recovery only
     */
    public List init() throws JBIException;

    public List start() throws JBIException;

    public void shutDown() throws JBIException;

    public void stop() throws JBIException;

    /**
     * Register a ServiceUnitLifeCycle into a synchronized map of the
     * ServiceAssemblyLifeCycle
     * 
     * @param suName
     *            name of a service unit
     * @param serviceUnitLifeCycle
     *            life cycle of the service unit
     * @throws JBIException
     */
    public void registerSU(ServiceUnitLifeCycle serviceUnitLifeCycle) throws JBIException;

    /**
     * Unregister a ServiceUnitLifeCycle from a synchronized map of the
     * ServiceAssemblyLifeCycle
     * 
     * @param suName
     *            name of a service unit
     */
    public void unregisterSU(ServiceUnitLifeCycle serviceUnitLifeCycle);

    public boolean isShutdownState();

    public boolean isStartedState();

    public boolean isStoppedState();

    /**
     * @return one of the states declared in {@link DeploymentServiceMBean}.
     */
    public String getCurrentState();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy