You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2009/02/09 04:30:40 UTC
svn commit: r742240 - in /servicemix/smx4/nmr/trunk/jbi/management: ./
src/main/java/org/apache/servicemix/jbi/management/
src/main/java/org/apache/servicemix/jbi/task/
Author: ffang
Date: Mon Feb 9 03:30:40 2009
New Revision: 742240
URL: http://svn.apache.org/viewvc?rev=742240&view=rev
Log:
[SMX4NMR-18]add necessary ant tasks
Added:
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/DeployServiceAssemblyTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallComponentTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallSharedLibraryTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/JbiTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListBindingComponentsTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceAssembliesTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceEnginesTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListSharedLibrariesTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownComponentTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownServiceAssemblyTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartComponentTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartServiceAssemblyTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopComponentTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopServiceAssemblyTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UndeployServiceAssemblyTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallComponentTask.java (with props)
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallSharedLibraryTask.java (with props)
Modified:
servicemix/smx4/nmr/trunk/jbi/management/pom.xml
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/management/AdminService.java
servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/management/DefaultNamingStrategy.java
Modified: servicemix/smx4/nmr/trunk/jbi/management/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/pom.xml?rev=742240&r1=742239&r2=742240&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/pom.xml (original)
+++ servicemix/smx4/nmr/trunk/jbi/management/pom.xml Mon Feb 9 03:30:40 2009
@@ -44,6 +44,11 @@
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.ant</artifactId>
+ <version>${ant.version}</version>
+ </dependency>
</dependencies>
<build>
@@ -63,4 +68,4 @@
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
Modified: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/management/AdminService.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/management/AdminService.java?rev=742240&r1=742239&r2=742240&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/management/AdminService.java (original)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/management/AdminService.java Mon Feb 9 03:30:40 2009
@@ -36,6 +36,14 @@
*/
public class AdminService implements AdminServiceMBean, BundleContextAware {
+ public static final String DEFAULT_NAME = "ServiceMix4";
+
+ public static final String DEFAULT_DOMAIN = "org.apache.servicemix";
+
+ public static final String DEFAULT_CONNECTOR_PATH = "/jmxrmi";
+
+ public static final int DEFAULT_CONNECTOR_PORT = 1099;
+
private BundleContext bundleContext;
private DefaultNamingStrategy namingStrategy;
Modified: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/management/DefaultNamingStrategy.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/management/DefaultNamingStrategy.java?rev=742240&r1=742239&r2=742240&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/management/DefaultNamingStrategy.java (original)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/management/DefaultNamingStrategy.java Mon Feb 9 03:30:40 2009
@@ -22,12 +22,16 @@
import javax.management.ObjectName;
import javax.management.MalformedObjectNameException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.runtime.impl.ManagementContext;
/**
*/
public class DefaultNamingStrategy implements NamingStrategy {
+ private static final Log LOG= LogFactory.getLog(DefaultNamingStrategy.class);
+
private String jmxDomainName;
public String getJmxDomainName() {
@@ -89,5 +93,28 @@
public ObjectName createObjectName(Map<String, String> props) {
return ManagementContext.createObjectName(getJmxDomainName(), props);
}
+
+ public static ObjectName getSystemObjectName(String domainName, String containerName, Class interfaceType) {
+ String tmp = domainName + ":ContainerName=" + containerName + ",Type=SystemService,Name=" + getSystemServiceName(interfaceType);
+ ObjectName result = null;
+ try {
+ result = new ObjectName(tmp);
+ } catch (MalformedObjectNameException e) {
+ LOG.error("Failed to build ObjectName:", e);
+ } catch (NullPointerException e) {
+ LOG.error("Failed to build ObjectName:", e);
+ }
+ return result;
+ }
+
+ public static String getSystemServiceName(Class interfaceType) {
+ String name = interfaceType.getName();
+ name = name.substring(name.lastIndexOf('.') + 1);
+ if (name.endsWith("MBean")) {
+ name = name.substring(0, name.length() - 5);
+ }
+ return name;
+ }
+
}
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/DeployServiceAssemblyTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/DeployServiceAssemblyTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/DeployServiceAssemblyTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/DeployServiceAssemblyTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import java.io.File;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Install an Assembly
+ *
+ * @version $Revision$
+ */
+public class DeployServiceAssemblyTask extends JbiTask {
+
+ private String file; // archivePath to install
+
+ private boolean deferExceptions;
+
+ public boolean isDeferExceptions() {
+ return deferExceptions;
+ }
+
+ public void setDeferExceptions(boolean deferExceptions) {
+ this.deferExceptions = deferExceptions;
+ }
+
+ /**
+ * @return Returns the archivePath.
+ */
+ public String getFile() {
+ return file;
+ }
+
+ /**
+ * @param file
+ * The archivePath to set.
+ */
+ public void setFile(String file) {
+ this.file = file;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (file == null) {
+ throw new BuildException("null file - file should be an archive");
+ }
+ if (!file.endsWith(".zip") && !file.endsWith(".jar")) {
+ throw new BuildException("file: " + file + " is not an archive");
+ }
+ File archive = new File(file);
+ String location = archive.getAbsolutePath();
+ if (!archive.isFile()) {
+ // if it's not a file, assume it's a url and pass it along
+ location = file;
+ }
+ acs.deployServiceAssembly(location);
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/DeployServiceAssemblyTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/DeployServiceAssemblyTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallComponentTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallComponentTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallComponentTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallComponentTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Install a Component
+ *
+ * @version $Revision$
+ */
+public class InstallComponentTask extends JbiTask {
+
+ private String file; // file to install
+
+ private String paramsFile;
+
+ private List nestedParams;
+
+ private boolean deferExceptions;
+
+ public boolean isDeferExceptions() {
+ return deferExceptions;
+ }
+
+ public void setDeferExceptions(boolean deferExceptions) {
+ this.deferExceptions = deferExceptions;
+ }
+
+ /**
+ * @return Returns the file.
+ */
+ public String getFile() {
+ return file;
+ }
+
+ /**
+ * @param file
+ * The file to set.
+ */
+ public void setFile(String file) {
+ this.file = file;
+ }
+
+ public String getParams() {
+ return paramsFile;
+ }
+
+ public void setParams(String params) {
+ this.paramsFile = params;
+ }
+
+ public Param createParam() {
+ Param p = new Param();
+ if (nestedParams == null) {
+ nestedParams = new ArrayList();
+ }
+ nestedParams.add(p);
+ return p;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (file == null) {
+ throw new BuildException("null file - file should be an archive");
+ }
+ if (!file.endsWith(".zip") && !file.endsWith(".jar")) {
+ throw new BuildException("file: " + file + " is not an archive");
+ }
+ File archive = new File(file);
+ String location = archive.getAbsolutePath();
+ if (!archive.isFile()) {
+ // if it's not a file, assume it's a url and pass it along
+ location = file;
+ }
+ Properties props = getProperties();
+ acs.installComponent(location);
+ }
+
+ private Properties getProperties() throws IOException {
+ Properties props = new Properties();
+ if (paramsFile != null) {
+ props.load(new FileInputStream(paramsFile));
+ }
+ if (nestedParams != null) {
+ for (Iterator iter = nestedParams.iterator(); iter.hasNext();) {
+ Param p = (Param) iter.next();
+ props.setProperty(p.getName(), p.getValue());
+ }
+ }
+ return props;
+ }
+
+ public static class Param {
+ private String name;
+
+ private String value;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallComponentTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallComponentTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallSharedLibraryTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallSharedLibraryTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallSharedLibraryTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallSharedLibraryTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import java.io.File;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Install a shared library
+ *
+ * @version $Revision$
+ */
+public class InstallSharedLibraryTask extends JbiTask {
+
+ private String file; // shared library URI to install
+
+ private boolean deferExceptions;
+
+ public boolean isDeferExceptions() {
+ return deferExceptions;
+ }
+
+ public void setDeferExceptions(boolean deferExceptions) {
+ this.deferExceptions = deferExceptions;
+ }
+
+ /**
+ * @return Returns the file.
+ */
+ public String getFile() {
+ return file;
+ }
+
+ /**
+ * @param file
+ * The shared library URI to set.
+ */
+ public void setFile(String file) {
+ this.file = file;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (file == null) {
+ throw new BuildException("null file - file should be an archive");
+ }
+ if (!file.endsWith(".zip") && !file.endsWith(".jar")) {
+ throw new BuildException("file: " + file + " is not an archive");
+ }
+ File archive = new File(file);
+ String location = archive.getAbsolutePath();
+ if (!archive.isFile()) {
+ // if it's not a file, assume it's a url and pass it along
+ location = file;
+ }
+ acs.installSharedLibrary(location);
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallSharedLibraryTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/InstallSharedLibraryTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/JbiTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/JbiTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/JbiTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/JbiTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,306 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.MBeanServerInvocationHandler;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.servicemix.jbi.management.AdminService;
+import org.apache.servicemix.jbi.management.DefaultNamingStrategy;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+
+/**
+ * A bean for connecting to a remote JMX MBeanServer
+ *
+ * @version $Revision$
+ */
+public abstract class JbiTask extends Task {
+
+ private String serverProtocol = "rmi";
+
+ private String host = "localhost";
+
+ private String containerName = AdminService.DEFAULT_NAME;
+
+ private String jmxDomainName = AdminService.DEFAULT_DOMAIN;
+
+ private int port = AdminService.DEFAULT_CONNECTOR_PORT;
+
+ private String jndiPath = AdminService.DEFAULT_CONNECTOR_PATH;
+
+ private String username;
+
+ private String password;
+
+ private boolean failOnError = true;
+
+ private JMXConnector jmxConnector;
+
+
+ /**
+ * Get the JMXServiceURL - built from the protocol used and host names
+ *
+ * @return the url
+ */
+ public JMXServiceURL getServiceURL() throws MalformedURLException {
+ JMXServiceURL url = null;
+ url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + host + ":" + port + jndiPath);
+ return url;
+ }
+
+ /**
+ * Get a JMXConnector from a url
+ *
+ * @param url
+ * @return the JMXConnector
+ * @throws IOException
+ */
+ public JMXConnector getJMXConnector(JMXServiceURL url) throws IOException {
+ String[] credentials = new String[] {getUsername(), getPassword() };
+ Map<String, Object> environment = new HashMap<String, Object>();
+ environment.put(JMXConnector.CREDENTIALS, credentials);
+ return JMXConnectorFactory.connect(url, environment);
+ }
+
+ /**
+ * initialize the connection
+ *
+ * @throws BuildException
+ */
+ public void connect() throws IOException {
+ this.jmxConnector = getJMXConnector(getServiceURL());
+ }
+
+ /**
+ * close any internal remote connections
+ *
+ */
+ public void close() {
+ if (this.jmxConnector != null) {
+ try {
+ jmxConnector.close();
+ } catch (IOException e) {
+ log("Caught an error closing the jmxConnector" + e.getMessage(), Project.MSG_WARN);
+ }
+ }
+ }
+
+ /**
+ * Get a servicemix internal system management instance, from it's class
+ * name
+ *
+ * @param systemClass
+ * @return the object name
+ */
+ protected ObjectName getObjectName(Class systemClass) {
+ return DefaultNamingStrategy.getSystemObjectName(jmxDomainName, containerName, systemClass);
+ }
+
+ /**
+ * Get the AdminCommandsService
+ *
+ * @return the main administration service MBean
+ * @throws IOException
+ */
+ public AdminCommandsServiceMBean getAdminCommandsService() throws IOException {
+ ObjectName objectName = getObjectName(AdminCommandsServiceMBean.class);
+
+ return (AdminCommandsServiceMBean) MBeanServerInvocationHandler.newProxyInstance(jmxConnector.getMBeanServerConnection(),
+ objectName, AdminCommandsServiceMBean.class, true);
+ }
+
+ /**
+ * @return Returns the containerName.
+ */
+ public String getContainerName() {
+ return containerName;
+ }
+
+ /**
+ * @param containerName
+ * The containerName to set.
+ */
+ public void setContainerName(String containerName) {
+ this.containerName = containerName;
+ }
+
+ /**
+ * @return Returns the jmxDomainName.
+ */
+ public String getJmxDomainName() {
+ return jmxDomainName;
+ }
+
+ /**
+ * @param jmxDomainName
+ * The jmxDomainName to set.
+ */
+ public void setJmxDomainName(String jmxDomainName) {
+ this.jmxDomainName = jmxDomainName;
+ }
+
+ /**
+ * @return Returns the jndiPath.
+ */
+ public String getJndiPath() {
+ return jndiPath;
+ }
+
+ /**
+ * @param jndiPath
+ * The jndiPath to set.
+ */
+ public void setJndiPath(String jndiPath) {
+ this.jndiPath = jndiPath;
+ }
+
+ /**
+ * @return Returns the namingHost.
+ */
+ public String getHost() {
+ return host;
+ }
+
+ /**
+ * @param host
+ * The namingHost to set.
+ */
+ public void setHost(String host) {
+ this.host = host;
+ }
+
+ /**
+ * @return Returns the namingPort.
+ */
+ public int getPort() {
+ return port;
+ }
+
+ /**
+ * @param port
+ * The namingPort to set.
+ */
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ /**
+ * @return Returns the serverProtocol.
+ */
+ public String getServerProtocol() {
+ return serverProtocol;
+ }
+
+ /**
+ * @param serverProtocol
+ * The serverProtocol to set.
+ */
+ public void setServerProtocol(String serverProtocol) {
+ this.serverProtocol = serverProtocol;
+ }
+
+ /**
+ * @return Returns the passwd.
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * @param password
+ * The passwd to set.
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ /**
+ * @return Returns the username.
+ */
+ public String getUsername() {
+ return username;
+ }
+
+ /**
+ * @param username
+ * The username to set.
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ /**
+ * @return Returns the failOnError.
+ */
+ public boolean isFailOnError() {
+ return failOnError;
+ }
+
+ /**
+ * @param failOnError
+ * The failOnError to set.
+ */
+ public void setFailOnError(boolean failOnError) {
+ this.failOnError = failOnError;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void execute() throws BuildException {
+ AdminCommandsServiceMBean acs;
+ try {
+ log("Retrieving remote admin interface", Project.MSG_DEBUG);
+ connect();
+ acs = getAdminCommandsService();
+ } catch (Throwable e) {
+ log("Error accessing ServiceMix administration: " + e.getMessage(), Project.MSG_WARN);
+ if (isFailOnError()) {
+ throw new BuildException("Error accessing ServiceMix administration", e);
+ } else {
+ return;
+ }
+ }
+ try {
+ log("Executing command", Project.MSG_DEBUG);
+ doExecute(acs);
+ } catch (Throwable e) {
+ log("Error executing command: " + e.getMessage(), Project.MSG_WARN);
+ if (isFailOnError()) {
+ throw new BuildException("Error accessing ServiceMix administration", e);
+ } else {
+ return;
+ }
+ }
+ }
+
+ protected abstract void doExecute(AdminCommandsServiceMBean acs) throws Exception;
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/JbiTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/JbiTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListBindingComponentsTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListBindingComponentsTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListBindingComponentsTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListBindingComponentsTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.Project;
+
+/**
+ * ListBindingComponentsTask
+ *
+ * @version $Revision:
+ */
+public class ListBindingComponentsTask extends JbiTask {
+
+ private String sharedLibraryName;
+
+ private String serviceAssemblyName;
+
+ private String bindingComponentName;
+
+ private String state;
+
+ private String xmlOutput;
+
+ /**
+ * @return the xmlOutput
+ */
+ public String isXmlOutput() {
+ return xmlOutput;
+ }
+
+ /**
+ * @param xmlOutput
+ * the xmlOutput to set
+ */
+ public void setXmlOutput(String xmlOutput) {
+ this.xmlOutput = xmlOutput;
+ }
+
+ /**
+ *
+ * @return shared library name
+ */
+ public String getSharedLibraryName() {
+ return sharedLibraryName;
+ }
+
+ /**
+ *
+ * @param sharedLibraryName
+ */
+ public void setSharedLibraryName(String sharedLibraryName) {
+ this.sharedLibraryName = sharedLibraryName;
+ }
+
+ /**
+ *
+ * @return service assembly name
+ */
+ public String getServiceAssemblyName() {
+ return serviceAssemblyName;
+ }
+
+ /**
+ *
+ * @param serviceAssemblyName
+ */
+ public void setServiceAssemblyName(String serviceAssemblyName) {
+ this.serviceAssemblyName = serviceAssemblyName;
+ }
+
+ /**
+ *
+ * @return binding component name
+ */
+ public String getBindingComponentName() {
+ return bindingComponentName;
+ }
+
+ /**
+ *
+ * @param bindingComponentName
+ */
+ public void setBindingComponentName(String bindingComponentName) {
+ this.bindingComponentName = bindingComponentName;
+ }
+
+ /**
+ *
+ * @return component state
+ */
+ public String getState() {
+ return state;
+ }
+
+ /**
+ *
+ * @param state
+ * Sets the component state
+ */
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ String result = acs.listComponents(true, false, getState(), getSharedLibraryName(), getServiceAssemblyName());
+ if (xmlOutput != null) {
+ getProject().setProperty(xmlOutput, result);
+ }
+ log(result, Project.MSG_WARN);
+ }
+
+}
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListBindingComponentsTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListBindingComponentsTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceAssembliesTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceAssembliesTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceAssembliesTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceAssembliesTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.Project;
+
+/**
+ * List deployed Service Assemblies
+ *
+ * @version $Revision$
+ */
+public class ListServiceAssembliesTask extends JbiTask {
+
+ private String state;
+
+ private String componentName;
+
+ private String serviceAssemblyName;
+
+ private String xmlOutput;
+
+ /**
+ * @return the xmlOutput
+ */
+ public String isXmlOutput() {
+ return xmlOutput;
+ }
+
+ /**
+ * @param xmlOutput
+ * the xmlOutput to set
+ */
+ public void setXmlOutput(String xmlOutput) {
+ this.xmlOutput = xmlOutput;
+ }
+
+ /**
+ *
+ * @return the state
+ */
+ public String getState() {
+ return state;
+ }
+
+ /**
+ *
+ * @param state
+ * Sets the state
+ */
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ /**
+ *
+ * @return the component name
+ */
+ public String getComponentName() {
+ return componentName;
+ }
+
+ /**
+ *
+ * @param componentName
+ * Sets the component name
+ */
+ public void setComponentName(String componentName) {
+ this.componentName = componentName;
+ }
+
+ /**
+ *
+ * @return service assembly name
+ */
+ public String getServiceAssemblyName() {
+ return serviceAssemblyName;
+ }
+
+ /**
+ *
+ * @param serviceAssemblynname
+ * Sets the service assembly name
+ */
+ public void setServiceAssemblyName(String serviceAssemblynname) {
+ this.serviceAssemblyName = serviceAssemblynname;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ String result = acs.listServiceAssemblies(getState(), getComponentName(), getServiceAssemblyName());
+ if (xmlOutput != null) {
+ getProject().setProperty(xmlOutput, result);
+ }
+ log(result, Project.MSG_WARN);
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceAssembliesTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceAssembliesTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceEnginesTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceEnginesTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceEnginesTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceEnginesTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.Project;
+
+/**
+ * ListServiceEnginesTask
+ *
+ * @version $Revision:
+ */
+public class ListServiceEnginesTask extends JbiTask {
+
+ private String state;
+
+ private String serviceAssemblyName;
+
+ private String sharedLibraryName;
+
+ private String xmlOutput;
+
+ /**
+ * @return the xmlOutput
+ */
+ public String isXmlOutput() {
+ return xmlOutput;
+ }
+
+ /**
+ * @param xmlOutput
+ * the xmlOutput to set
+ */
+ public void setXmlOutput(String xmlOutput) {
+ this.xmlOutput = xmlOutput;
+ }
+
+ /**
+ *
+ * @return the state
+ */
+ public String getState() {
+ return state;
+ }
+
+ /**
+ *
+ * @param state
+ * Sets the state
+ */
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ /**
+ *
+ * @return service assembly name
+ */
+ public String getServiceAssemblyName() {
+ return serviceAssemblyName;
+ }
+
+ /**
+ *
+ * @param serviceAssemblyName
+ * the service assembly name to set
+ */
+ public void setServiceAssemblyName(String serviceAssemblyName) {
+ this.serviceAssemblyName = serviceAssemblyName;
+ }
+
+ /**
+ *
+ * @return The shared library name
+ */
+ public String getSharedLibraryName() {
+ return sharedLibraryName;
+ }
+
+ /**
+ *
+ * @param sharedLibraryName
+ * Sets the shared library name
+ */
+ public void setSharedLibraryName(String sharedLibraryName) {
+ this.sharedLibraryName = sharedLibraryName;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ String result = acs.listComponents(false, true, getState(), getSharedLibraryName(), getServiceAssemblyName());
+ if (xmlOutput != null) {
+ getProject().setProperty(xmlOutput, result);
+ }
+ log(result, Project.MSG_WARN);
+ }
+
+}
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceEnginesTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListServiceEnginesTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListSharedLibrariesTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListSharedLibrariesTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListSharedLibrariesTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListSharedLibrariesTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.Project;
+
+/**
+ * ListSharedLibrariesTask
+ *
+ * @version $Revision:
+ */
+public class ListSharedLibrariesTask extends JbiTask {
+
+ private String componentName;
+
+ private String sharedLibraryName;
+
+ private String xmlOutput;
+
+ /**
+ * @return the xmlOutput
+ */
+ public String isXmlOutput() {
+ return xmlOutput;
+ }
+
+ /**
+ * @param xmlOutput
+ * the xmlOutput to set
+ */
+ public void setXmlOutput(String xmlOutput) {
+ this.xmlOutput = xmlOutput;
+ }
+
+ /**
+ *
+ * @return component name
+ */
+ public String getComponentName() {
+ return componentName;
+ }
+
+ /**
+ *
+ * @param componentName
+ * The component name to set
+ */
+ public void setComponentName(String componentName) {
+ this.componentName = componentName;
+ }
+
+ /**
+ *
+ * @return shared library name
+ */
+ public String getSharedLibraryName() {
+ return sharedLibraryName;
+ }
+
+ /**
+ *
+ * @param sharedLibraryName
+ * the shared library name to set
+ */
+ public void setSharedLibraryName(String sharedLibraryName) {
+ this.sharedLibraryName = sharedLibraryName;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ String result = acs.listSharedLibraries(getComponentName(), getSharedLibraryName());
+ if (xmlOutput != null) {
+ getProject().setProperty(xmlOutput, result);
+ }
+ log(result, Project.MSG_WARN);
+ }
+
+}
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListSharedLibrariesTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ListSharedLibrariesTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownComponentTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownComponentTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownComponentTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownComponentTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Shutdown a Component
+ *
+ * @version $Revision$
+ */
+public class ShutDownComponentTask extends JbiTask {
+
+ private String name;
+
+ /**
+ * @return Returns the componentName.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name
+ * The component name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (name == null) {
+ throw new BuildException("null componentName");
+ }
+ acs.shutdownComponent(name);
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownComponentTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownComponentTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownServiceAssemblyTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownServiceAssemblyTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownServiceAssemblyTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownServiceAssemblyTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Shut down a Service Assembly
+ *
+ * @version $Revision$
+ */
+public class ShutDownServiceAssemblyTask extends JbiTask {
+
+ private String name;
+
+ /**
+ * @return Returns the assembly name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name The assembly name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (name == null) {
+ throw new BuildException("null service assembly name");
+ }
+ acs.shutdownServiceAssembly(name);
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownServiceAssemblyTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/ShutDownServiceAssemblyTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartComponentTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartComponentTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartComponentTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartComponentTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Start a Component
+ *
+ * @version $Revision$
+ */
+public class StartComponentTask extends JbiTask {
+
+ private String name;
+
+ /**
+ * @return Returns the component name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name The componentName to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (name == null) {
+ throw new BuildException("null componentName");
+ }
+ acs.startComponent(name);
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartComponentTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartComponentTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartServiceAssemblyTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartServiceAssemblyTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartServiceAssemblyTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartServiceAssemblyTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Start a Service Assembly
+ *
+ * @version $Revision$
+ */
+public class StartServiceAssemblyTask extends JbiTask {
+
+ private String name; //assembly name to get descriptor for
+
+ /**
+ * @return Returns the assembly name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name The assembly name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (name == null) {
+ throw new BuildException("null service assembly name");
+ }
+ acs.startServiceAssembly(name);
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartServiceAssemblyTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StartServiceAssemblyTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopComponentTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopComponentTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopComponentTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopComponentTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Stop a Component
+ *
+ * @version $Revision$
+ */
+public class StopComponentTask extends JbiTask {
+
+ private String name;
+
+ /**
+ * @return Returns the component name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name The component name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (name == null) {
+ throw new BuildException("null componentName");
+ }
+ acs.stopComponent(name);
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopComponentTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopComponentTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopServiceAssemblyTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopServiceAssemblyTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopServiceAssemblyTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopServiceAssemblyTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Stop a Service Assembly
+ *
+ * @version $Revision$
+ */
+public class StopServiceAssemblyTask extends JbiTask {
+
+ private String name; //assembly name to stop.
+
+ /**
+ * @return Returns the assembly name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name The assembly name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (name == null) {
+ throw new BuildException("null componentName");
+ }
+ acs.stopServiceAssembly(name);
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopServiceAssemblyTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/StopServiceAssemblyTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UndeployServiceAssemblyTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UndeployServiceAssemblyTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UndeployServiceAssemblyTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UndeployServiceAssemblyTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Uninstall an Assembly
+ *
+ * @version $Revision$
+ */
+public class UndeployServiceAssemblyTask extends JbiTask {
+
+ private String name; //assembly name to uninstall
+
+ /**
+ * @return Returns the assemblyName.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name The assembly name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (name == null) {
+ throw new BuildException("null componentName");
+ }
+ acs.undeployServiceAssembly(name);
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UndeployServiceAssemblyTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UndeployServiceAssemblyTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallComponentTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallComponentTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallComponentTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallComponentTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Uninstall a Component
+ *
+ * @version $Revision$
+ */
+public class UninstallComponentTask extends JbiTask {
+
+ private String name; //component name to uninstall
+
+ /**
+ * @return Returns the component name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name The component name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (name == null) {
+ throw new BuildException("null componentName");
+ }
+ acs.uninstallComponent(name);
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallComponentTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallComponentTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallSharedLibraryTask.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallSharedLibraryTask.java?rev=742240&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallSharedLibraryTask.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallSharedLibraryTask.java Mon Feb 9 03:30:40 2009
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.task;
+
+import org.apache.servicemix.jbi.management.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Uninstall a shared library
+ *
+ * @version $Revision$
+ */
+public class UninstallSharedLibraryTask extends JbiTask {
+
+ private String name; //shared Library name to uninstall
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
+ if (name == null) {
+ throw new BuildException("null componentName");
+ }
+ acs.uninstallSharedLibrary(name);
+ }
+
+}
\ No newline at end of file
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallSharedLibraryTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx4/nmr/trunk/jbi/management/src/main/java/org/apache/servicemix/jbi/task/UninstallSharedLibraryTask.java
------------------------------------------------------------------------------
svn:keywords = Rev Date