001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.deployment;
023:
024: import javax.management.ObjectName;
025:
026: /**
027: * The common interface for sub-deployer components which
028: * perform the actual deployment services for application
029: * components.
030: *
031: * @jmx:mbean extends="org.jboss.system.ServiceMBean"
032: *
033: * @version <tt>$Revision: 57205 $</tt>
034: * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
035: * @author <a href="mailto:toby.allsopp@peace.com">Toby Allsopp</a>
036: * @author <a href="mailto:marc.fleury@jboss.org">Marc Fleury</a>
037: * @author <a href="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
038: */
039: public interface SubDeployer {
040: /** The notification type send when a SubDeployer completes init */
041: public static final String INIT_NOTIFICATION = "org.jboss.deployment.SubDeployer.init";
042: /** The notification type send when a SubDeployer completes create */
043: public static final String CREATE_NOTIFICATION = "org.jboss.deployment.SubDeployer.create";
044: /** The notification type send when a SubDeployer completes start */
045: public static final String START_NOTIFICATION = "org.jboss.deployment.SubDeployer.start";
046: /** The notification type send when a SubDeployer completes stop */
047: public static final String STOP_NOTIFICATION = "org.jboss.deployment.SubDeployer.stop";
048: /** The notification type send when a SubDeployer completes destroy */
049: public static final String DESTROY_NOTIFICATION = "org.jboss.deployment.SubDeployer.destroy";
050:
051: /*
052: * Indicative relative suffix order.
053: *
054: * Avoid using those constants, they'll be removed. It is
055: * preferable to set the suffix order per suffix using
056: * SubDeployerExt.setEnhancedSuffixes
057: */
058:
059: /** @deprecated */
060: public static final int RELATIVE_ORDER_100 = 100;
061: /** @deprecated */
062: public static final int RELATIVE_ORDER_200 = 200;
063: /** @deprecated */
064: public static final int RELATIVE_ORDER_300 = 300;
065: /** @deprecated */
066: public static final int RELATIVE_ORDER_400 = 400;
067: /** @deprecated */
068: public static final int RELATIVE_ORDER_500 = 500;
069: /** @deprecated */
070: public static final int RELATIVE_ORDER_600 = 600;
071: /** @deprecated */
072: public static final int RELATIVE_ORDER_700 = 700;
073: /** @deprecated */
074: public static final int RELATIVE_ORDER_800 = 800;
075: /** @deprecated */
076: public static final int RELATIVE_ORDER_900 = 900;
077:
078: /**
079: * Get the JMX ObjectName of the service that provides the SubDeployer
080: * @return JMX ObjectName of the service
081: *
082: * @jmx:managed-attribute
083: */
084: public ObjectName getServiceName();
085:
086: /**
087: * Get an array of suffixes of interest to this subdeployer
088: * @return array of suffix strings
089: *
090: * @jmx:managed-attribute
091: */
092: public String[] getSuffixes();
093:
094: /**
095: * Get the relative order of the specified suffixes
096: * @return the relative order of the specified suffixes
097: *
098: * @jmx:managed-attribute
099: */
100: public int getRelativeOrder();
101:
102: /**
103: * The <code>accepts</code> method is called by MainDeployer to
104: * determine which deployer is suitable for a DeploymentInfo.
105: *
106: * @param sdi a <code>DeploymentInfo</code> value
107: * @return a <code>boolean</code> value
108: *
109: * @jmx:managed-operation
110: */
111: boolean accepts(DeploymentInfo sdi);
112:
113: /**
114: * The <code>init</code> method lets the deployer set a few properties
115: * of the DeploymentInfo, such as the watch url.
116: *
117: * @param sdi a <code>DeploymentInfo</code> value
118: * @throws DeploymentException if an error occurs
119: *
120: * @jmx:managed-operation
121: */
122: void init(DeploymentInfo sdi) throws DeploymentException;
123:
124: /**
125: * Set up the components of the deployment that do not
126: * refer to other components
127: *
128: * @param sdi a <code>DeploymentInfo</code> value
129: * @throws DeploymentException if an error occurs
130: *
131: * @jmx:managed-operation
132: */
133: void create(DeploymentInfo sdi) throws DeploymentException;
134:
135: /**
136: * The <code>start</code> method sets up relationships with other components.
137: *
138: * @param sdi a <code>DeploymentInfo</code> value
139: * @throws DeploymentException if an error occurs
140: *
141: * @jmx:managed-operation
142: */
143: void start(DeploymentInfo sdi) throws DeploymentException;
144:
145: /**
146: * The <code>stop</code> method removes relationships between components.
147: *
148: * @param sdi a <code>DeploymentInfo</code> value
149: * @throws DeploymentException if an error occurs
150: *
151: * @jmx:managed-operation
152: */
153: void stop(DeploymentInfo sdi) throws DeploymentException;
154:
155: /**
156: * The <code>destroy</code> method removes individual components
157: *
158: * @param sdi a <code>DeploymentInfo</code> value
159: * @throws DeploymentException if an error occurs
160: *
161: * @jmx:managed-operation
162: */
163: void destroy(DeploymentInfo sdi) throws DeploymentException;
164: }
|