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: * @(#)DeploymentServiceMBean.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.management;
030:
031: /**
032: * This DeploymentServiceMBean extends the public interface. This has additional
033: * operations to :
034: * <br/>
035: * <ul>
036: * <li> Get the state of a particular service unit </li>
037: * <li> Deploy a service assembly from the repository </li>
038: * <li> allow forceful shutdown and undeploy of service assemblies </li>
039: * </ul>
040: * @author Sun Microsystems, Inc.
041: */
042: public interface DeploymentServiceMBean extends
043: javax.jbi.management.DeploymentServiceMBean {
044: /**
045: * Get the state of a service unit deployed to a component.
046: * <br/>
047: * If the service unit is deployed to the component then one of the states :
048: * "Started", "Stopped" or "Shutdown" is returned.
049: *
050: * @return the actual state of the deployed service unit or "Unknown".
051: * @param componentName - the component name
052: * @param serviceUnitName - name of the service unit
053: * @exception javax.jbi.JBIException if the component is not installed or if the
054: * service unit is not deployed to the component.
055: * @see javax.jbi.management.DeploymentServiceMBean
056: */
057: String getServiceUnitState(String componentName,
058: String serviceUnitName) throws javax.jbi.JBIException;
059:
060: /**
061: * Returns the deployment descriptor of the Service Unit that was
062: * deployed to the JBI enviroment, serialized to a <code>String</code>.
063: *
064: * @param serviceAssemblyName name of the service assembly to be queried;
065: * must be non-null and non-empty
066: * @param serviceUnitName name of the service unit to be queried;
067: * must be non-null and non-empty
068: * @return descriptor of the Service Unit; must be non-null
069: * @exception Exception if a processing error occurs
070: */
071: public String getServiceUnitDescriptor(String serviceAssemblyName,
072: String serviceUnitName) throws Exception;
073:
074: /**
075: * Deploy a Service Assembly from the Repository.
076: * <br/>
077: * If the service assembly is not there in the DAS repository a exception will
078: * be thrown.
079: *
080: * @param serviceAssemblyName - name of the registered service assembly.
081: * @return a status management message with details on the service assembly deployment.
082: * @exception javax.jbi.JBIException if the service assembly is not registered or
083: * deploy fails.
084: */
085: String deployFromRepository(String serviceAssemblyName)
086: throws javax.jbi.JBIException;
087:
088: /**
089: * Undeploys the given Service Assembly from the JBI environment.
090: *
091: * @param serviceAssemblyName name of the Service Assembly that is to be
092: * undeployed; must be non-null and non-empty
093: * @param force if this flag is set to true any undeployment errors thrown
094: * from the component will be ignored as the service assembly is forcefully
095: * undeployed.
096: * @return Result/Status of the current undeployment; must conform to
097: * JBI management result/status XML schema; must be non-null and
098: * non-empty
099: * @exception Exception if compelete undeployment fails
100: */
101: String undeploy(String serviceAssemblyName, boolean force)
102: throws Exception;
103:
104: /**
105: * Undeploys the given Service Assembly from the JBI environment.
106: *
107: * @param serviceAssemblyName name of the Service Assembly that is to be
108: * undeployed; must be non-null and non-empty
109: * @param force if this flag is set to true any undeployment errors thrown
110: * from the component will be ignored as the service assembly is forcefully
111: * undeployed.
112: * @param keep if true the service assembly archive should not be removed
113: * from the domain. If false the archive is removed if the service
114: * assembly is not deployed on any instances.
115: * @return Result/Status of the current undeployment; must conform to
116: * JBI management result/status XML schema; must be non-null and
117: * non-empty
118: * @exception Exception if compelete undeployment fails
119: */
120: String undeploy(String serviceAssemblyName, boolean force,
121: boolean keep) throws Exception;
122:
123: /**
124: * Shut down the service assembly.
125: *
126: * @param serviceAssemblyName name of the assembly to be shut down; must be
127: * non-null and non-empty
128: * @param force if this flag is true, the service assembly is shutdown forcefully.
129: * Any exceptions thrown by the component for service unit shutdown are ignored.
130: * @return result / status string giving the results of shutting down
131: * each service unit in the assembly; must be non-null and non-empty
132: * @exception Exception if there is no such assembly
133: * @exception Exception if the assembly fails to shut down
134: */
135: String shutDown(String serviceAssemblyName, boolean force)
136: throws Exception;
137: }
|