001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)DeployerMBean.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.framework;
030:
031: import com.sun.jbi.ServiceUnitState;
032:
033: /**
034: * This is the framework-provided version of the DeployerMBean for use with
035: * the ServiceUnitManager SPI of a component.
036: *
037: * @author Sun Microsystems, Inc.
038: */
039: public interface DeployerMBean {
040: /**
041: * Deploy a Service Unit to the component. This is called to deploy the
042: * specified artifact to the component.
043: * @param serviceUnitName the name of the Service Unit being deployed.
044: * @param serviceUnitRootPath the full path to the Service Unit artifact
045: * root directory.
046: * @throws javax.jbi.management.DeploymentException if the deployment
047: * operation is unsuccessful.
048: * @return a deployment status message.
049: */
050: String deploy(String serviceUnitName, String serviceUnitRootPath)
051: throws javax.jbi.management.DeploymentException;
052:
053: /**
054: * Return a list of all Service Units currently deployed to the component.
055: * @return array of Service Unit name strings.
056: */
057: String[] getDeployments();
058:
059: /**
060: * Get the current state of a Service Unit.
061: * @param serviceUnitName The unique name of the Service Unit.
062: * @return The service unit state.
063: */
064: ServiceUnitState getServiceUnitState(String serviceUnitName);
065:
066: /**
067: * Return a boolean value indicating whether the Service Unit is currently
068: * deployed.
069: * @param serviceUnitName the name of the Service Unit.
070: * @return true if the Service Unit is deployed, false if not.
071: */
072: boolean isDeployed(String serviceUnitName);
073:
074: /**
075: * Undeploy a Service Unit from the component. The Service Unit must be
076: * shut down before it can be undeployed.
077: * @param serviceUnitName the name of the Service Unit being undeployed.
078: * @param serviceAssemblyName the name of the parent Service Assembly
079: * of the Service Unit.
080: * @throws javax.jbi.management.DeploymentException if the undeploy
081: * operation is unsuccessful.
082: * @return A status message.
083: */
084: String undeploy(String serviceUnitName, String serviceAssemblyName)
085: throws javax.jbi.management.DeploymentException;
086:
087: /**
088: * Undeploy a Service Unit from the component. The Service Unit must be
089: * shut down before it can be undeployed, unless the force options is set,
090: * in which case all state checks are skipped.
091: * @param serviceUnitName the name of the Service Unit being undeployed.
092: * @param serviceAssemblyName the name of the parent Service Assembly
093: * of the Service Unit.
094: * @param force when set to true, indicates a forced undeploy, which
095: * causes undeployment to be completed regardless of any errors which
096: * may occur in the component's Service Unit Manager.
097: * @throws javax.jbi.management.DeploymentException if the undeploy
098: * operation is unsuccessful.
099: * @return A status message.
100: */
101: String undeploy(String serviceUnitName, String serviceAssemblyName,
102: boolean force)
103: throws javax.jbi.management.DeploymentException;
104:
105: /**
106: * Initialize a Service Unit. This is the first phase of a two-phase
107: * start, where the component must prepare to receive service requests
108: * related to the Service Unit (if any).
109: * @param serviceUnitName the name of the Service Unit being initialized.
110: * @param serviceUnitRootPath the absolute path to the directory, which
111: * has the extracted service unit contents.
112: * @throws javax.jbi.management.DeploymentException if the Service Unit is
113: * not deployed, or is in an incorrect state.
114: */
115: void init(String serviceUnitName, String serviceUnitRootPath)
116: throws javax.jbi.management.DeploymentException;
117:
118: /**
119: * Shut down a Service Unit. This causes the Service Unit to return to the
120: * state it was in after <code>deploy()</code> and before <code>init()</code>.
121: * @param serviceUnitName the name of the Service Unit being shut down.
122: * @throws javax.jbi.management.DeploymentException if the Service Unit
123: * is not deployed, or is in an incorrect state.
124: */
125: void shutDown(String serviceUnitName)
126: throws javax.jbi.management.DeploymentException;
127:
128: /**
129: * Shut down a Service Unit. This causes the Service Unit to return to the
130: * state it was in after <code>deploy()</code> and before <code>init()</code>.
131: * If the force option is set, then the operation proceeds regardless of
132: * of any errors in state or in the component's Service Unit Manager.
133: * @param serviceUnitName the name of the Service Unit being shut down.
134: * @param force when set to true, indicates a forced shutdown, which
135: * causes the shutdown to be completed regardless of any errors which
136: * may occur in the component's Service Unit Manager.
137: * @throws javax.jbi.management.DeploymentException if the Service Unit
138: * is not deployed, or is in an incorrect state.
139: */
140: void shutDown(String serviceUnitName, boolean force)
141: throws javax.jbi.management.DeploymentException;
142:
143: /**
144: * Start a Service Unit. This is the second phase of a two-phase start,
145: * where the component can now initiate service requests related to the
146: * Service Unit.
147: * @param serviceUnitName the name of the Service Unit being started.
148: * @throws javax.jbi.management.DeploymentException if the Service Unit
149: * is not deployed, or is in an incorrect state.
150: */
151: void start(String serviceUnitName)
152: throws javax.jbi.management.DeploymentException;
153:
154: /**
155: * Stop a Service Unit. This causes the component to cease generating
156: * service requests related to the Service Unit. This returns the Service
157: * Unit to a state equivalent to after <code>init()</code> was called.
158: * @param serviceUnitName the name of the Service Unit being stopped.
159: * @throws javax.jbi.management.DeploymentException if the Service Unit
160: * is not deployed, or is in an incorrect state.
161: */
162: void stop(String serviceUnitName)
163: throws javax.jbi.management.DeploymentException;
164: }
|