/*  
 * JBoss, Home of Professional Open Source
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.deployment;

import javax.management.ObjectName;

import org.jboss.system.ServiceMBean;

/**
 * MBean interface for SubDeployers
 * 
 * @version <tt>$Revision: 1.1.6.4 $</tt>
 */
public interface SubDeployerMBean extends ServiceMBean
{
   // Attributes ----------------------------------------------------
   
   /**
    * Get the JMX ObjectName of the service that provides the SubDeployer
    * @return JMX ObjectName of the service
    */
   ObjectName getServiceName();

   /**
    * Get an array of suffixes of interest to this subdeployer
    * @return array of suffix strings
    */
   String[] getSuffixes();

   /**
    * Get the relative order of the specified suffixes
    * @return the relative order of the specified suffixes
    */
   int getRelativeOrder();

   // Operations ----------------------------------------------------
   
   /**
    * The <code>accepts</code> method is called by MainDeployer
    * to determine which deployer is suitable for a DeploymentInfo.
    * @param sdi a <code>DeploymentInfo</code> value
    * @return a <code>boolean</code> value
    */
   boolean accepts(DeploymentInfo sdi);

   /**
    * The <code>init</code> method lets the deployer set a few
    * properties of the DeploymentInfo, such as the watch url.
    * @param sdi a <code>DeploymentInfo</code> value
    * @throws DeploymentException if an error occurs
    */
   void init(DeploymentInfo sdi) throws DeploymentException;

   /**
    * Set up the components of the deployment that do not
    * refer to other components.
    * @param sdi a <code>DeploymentInfo</code> value
    * @throws DeploymentException if an error occurs
    */
   void create(DeploymentInfo sdi) throws DeploymentException;

   /**
    * The <code>start</code> method sets up relationships
    * with other components.
    * @param sdi a <code>DeploymentInfo</code> value
    * @throws DeploymentException if an error occurs
    */
   void start(DeploymentInfo sdi) throws DeploymentException;

   /**
    * The <code>stop</code> method removes relationships
    * between components.
    * @param sdi a <code>DeploymentInfo</code> value
    * @throws DeploymentException if an error occurs
    */
   void stop(DeploymentInfo sdi) throws DeploymentException;

   /**
    * The <code>destroy</code> method removes individual
    * components
    * @param sdi a <code>DeploymentInfo</code> value
    * @throws DeploymentException if an error occurs
    */
   void destroy(DeploymentInfo sdi) throws DeploymentException;

}
