Mail Archive Home | orchestra-commits List | April 2008 Index
| <-- Date Index --> | <-- Thread Index --> |
use proxy for remoteDeployerMBean.
--- trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/DeployAction.java 2008-04-23 07:50:56 UTC (rev 1458)
+++ trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/DeployAction.java 2008-04-24 09:32:52 UTC (rev 1459)
@@ -15,8 +15,10 @@
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.jbpm.xml.Parse;
+import org.ow2.novabpm.util.Misc;
import org.ow2.orchestra.deployment.Deployment;
import org.ow2.orchestra.exception.OrchestraException;
+import org.ow2.orchestra.jmx.RemoteDeployerMBean;
import org.ow2.orchestra.parsing.BpelImportParser;
public class DeployAction implements ClientAction {
@@ -43,11 +45,9 @@
QName processName = null;
try {
Parse parse = new Parse();
- Deployment bpelDeployment = BpelImportParser.parseBpelFromUrl(bpelURL,
- wsdls, parse);
- String[] deploySignature = { Deployment.class.getName(), Parse.class.getName() };
- Object[] deployParams = { bpelDeployment, parse };
- processName = (QName) JMXClient.callJMXMethod(jmxServiceUrl, jmxObjectName, "deploy", deploySignature, deployParams);
+ Deployment bpelDeployment = BpelImportParser.parseBpelFromUrl(bpelURL, wsdls, parse);
+ RemoteDeployerMBean remoteDeployer = Misc.getMBeanProxy(RemoteDeployerMBean.class, jmxServiceUrl, jmxObjectName);
+ processName = remoteDeployer.deploy(bpelDeployment, parse);
} catch (Exception e) {
throw new OrchestraException("Exception while deploying bpel from url : "
+ bpelURL, e);
--- trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/DeployBarAction.java 2008-04-23 07:50:56 UTC (rev 1458)
+++ trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/DeployBarAction.java 2008-04-24 09:32:52 UTC (rev 1459)
@@ -14,7 +14,9 @@
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+import org.ow2.novabpm.util.Misc;
import org.ow2.orchestra.exception.OrchestraException;
+import org.ow2.orchestra.jmx.RemoteDeployerMBean;
public class DeployBarAction implements ClientAction {
@@ -49,10 +51,8 @@
"couldn't read bar file from url " + barFile, e);
}
try {
- String[] deploySignature = { byte[].class.getName() };
- Object[] deployParams = { barBytes };
- processName = (QName) JMXClient.callJMXMethod(jmxServiceUrl,
- jmxObjectName, "deployBar", deploySignature, deployParams);
+ RemoteDeployerMBean remoteDeployer = Misc.getMBeanProxy(RemoteDeployerMBean.class, jmxServiceUrl, jmxObjectName);
+ processName = remoteDeployer.deployBar(barBytes);
} catch (Exception e) {
throw new OrchestraException("Exception while deploying barFile : "
+ barFile, e);
--- trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/InitAction.java 2008-04-23 07:50:56 UTC (rev 1458)
+++ trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/InitAction.java 2008-04-24 09:32:52 UTC (rev 1459)
@@ -9,7 +9,9 @@
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+import org.ow2.novabpm.util.Misc;
import org.ow2.orchestra.exception.OrchestraException;
+import org.ow2.orchestra.jmx.RemoteDeployerMBean;
public class InitAction implements ClientAction {
@@ -18,8 +20,8 @@
public static void init(String jmxServiceUrl, String jmxObjectName) {
try {
- JMXClient.callJMXMethod(jmxServiceUrl, jmxObjectName, "initialize", null,
- null);
+ RemoteDeployerMBean remoteDeployer = Misc.getMBeanProxy(RemoteDeployerMBean.class, jmxServiceUrl, jmxObjectName);
+ remoteDeployer.initialize();
} catch (Exception e) {
throw new OrchestraException(e);
}
--- trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/JMXClient.java 2008-04-23 07:50:56 UTC (rev 1458)
+++ trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/JMXClient.java 2008-04-24 09:32:52 UTC (rev 1459)
@@ -13,20 +13,9 @@
**/
package org.ow2.orchestra.jmxclient;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanServerConnection;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.HelpFormatter;
@@ -43,17 +32,6 @@
private JMXClient() {
}
- static Object callJMXMethod(String jmxServiceUrl, String jmxObjectName,
- String methodName, String[] signature, Object[] params)
- throws IOException, MalformedObjectNameException, NullPointerException,
- InstanceNotFoundException, MBeanException, ReflectionException {
- JMXServiceURL url = "" JMXServiceURL(jmxServiceUrl);
- JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
- MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
- ObjectName mbeanObjectName = ObjectName.getInstance(jmxObjectName);
- return mbsc.invoke(mbeanObjectName, methodName, params, signature);
- }
-
// Default service url of the JMX remote deployer
protected static String jmxServiceUrl;
--- trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/ListProcessAction.java 2008-04-23 07:50:56 UTC (rev 1458)
+++ trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/ListProcessAction.java 2008-04-24 09:32:52 UTC (rev 1459)
@@ -11,7 +11,9 @@
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+import org.ow2.novabpm.util.Misc;
import org.ow2.orchestra.exception.OrchestraException;
+import org.ow2.orchestra.jmx.RemoteDeployerMBean;
public class ListProcessAction implements ClientAction {
@@ -20,8 +22,8 @@
public static List<QName> list(String jmxServiceUrl, String jmxObjectName) {
try {
- return (List<QName>) JMXClient.callJMXMethod(jmxServiceUrl,
- jmxObjectName, "listProcess", null, null);
+ RemoteDeployerMBean remoteDeployer = Misc.getMBeanProxy(RemoteDeployerMBean.class, jmxServiceUrl, jmxObjectName);
+ return remoteDeployer.listProcess();
} catch (Exception e) {
throw new OrchestraException(e);
}
--- trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/StatusAction.java 2008-04-23 07:50:56 UTC (rev 1458)
+++ trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/StatusAction.java 2008-04-24 09:32:52 UTC (rev 1459)
@@ -12,6 +12,8 @@
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+import org.ow2.novabpm.util.Misc;
+import org.ow2.orchestra.jmx.RemoteDeployerMBean;
public class StatusAction implements ClientAction {
@@ -27,9 +29,8 @@
try {
List<QName> processNames = ListProcessAction.list(jmxServiceUrl,
jmxObjectName);
- Map<QName, List<String>> instances = (Map<QName, List<String>>) JMXClient
- .callJMXMethod(jmxServiceUrl, jmxObjectName, "listInstances", null,
- null);
+ RemoteDeployerMBean remoteDeployer = Misc.getMBeanProxy(RemoteDeployerMBean.class, jmxServiceUrl, jmxObjectName);
+ Map<QName, List<String>> instances = remoteDeployer.listInstances();
System.out.println("Orchestra is started");
System.out.println("List of deployed processes and running instances:");
for (QName name : processNames) {
--- trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/UndeployAction.java 2008-04-23 07:50:56 UTC (rev 1458)
+++ trunk/OrchestraPVM/jmxClient/src/java/org/ow2/orchestra/jmxclient/UndeployAction.java 2008-04-24 09:32:52 UTC (rev 1459)
@@ -10,7 +10,9 @@
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+import org.ow2.novabpm.util.Misc;
import org.ow2.orchestra.exception.OrchestraException;
+import org.ow2.orchestra.jmx.RemoteDeployerMBean;
public class UndeployAction implements ClientAction {
@@ -32,10 +34,8 @@
String jmxObjectName) {
boolean result = false;
try {
- String[] undeploySignature = { QName.class.getName() };
- Object[] undeployParams = { processQName };
- result = (Boolean) JMXClient.callJMXMethod(jmxServiceUrl, jmxObjectName,
- "undeploy", undeploySignature, undeployParams);
+ RemoteDeployerMBean remoteDeployer = Misc.getMBeanProxy(RemoteDeployerMBean.class, jmxServiceUrl, jmxObjectName);
+ result = remoteDeployer.undeploy(processQName);
} catch (Exception e) {
throw new OrchestraException(
"Exception caught while undeploying process : " + processQName, e);
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.