You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jb...@apache.org on 2004/07/06 07:34:19 UTC
cvs commit: incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/factories DeploymentFactoryImpl.java
jboynes 2004/07/05 22:34:19
Modified: modules/deployment/src/java/org/apache/geronimo/deployment/plugin/factories
DeploymentFactoryImpl.java
Log:
Log unchecked exceptions as some factories eat them
Fix display name
Revision Changes Path
1.12 +27 -18 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/factories/DeploymentFactoryImpl.java
Index: DeploymentFactoryImpl.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/factories/DeploymentFactoryImpl.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DeploymentFactoryImpl.java 2 Jun 2004 06:50:41 -0000 1.11
+++ DeploymentFactoryImpl.java 6 Jul 2004 05:34:19 -0000 1.12
@@ -43,7 +43,7 @@
public static final String URI_PREFIX = "deployer:geronimo:";
public String getDisplayName() {
- return "Geronimo";
+ return "Apache Geronimo";
}
public String getProductVersion() {
@@ -67,23 +67,32 @@
return null;
}
- uri = uri.substring(URI_PREFIX.length());
- if (uri.startsWith("jmx")) {
-
- Map environment = new HashMap();
- String[] credentials = new String[]{username, password};
- environment.put(JMXConnector.CREDENTIALS, credentials);
-
- try {
- JMXServiceURL address = new JMXServiceURL("service:" + uri);
- JMXConnector jmxConnector = JMXConnectorFactory.connect(address, environment);
- return new JMXDeploymentManager(jmxConnector);
- } catch (IOException e) {
- throw new DeploymentManagerCreationException(e.getMessage());
+ try {
+ uri = uri.substring(URI_PREFIX.length());
+ if (uri.startsWith("jmx")) {
+
+ Map environment = new HashMap();
+ String[] credentials = new String[]{username, password};
+ environment.put(JMXConnector.CREDENTIALS, credentials);
+
+ try {
+ JMXServiceURL address = new JMXServiceURL("service:" + uri);
+ JMXConnector jmxConnector = JMXConnectorFactory.connect(address, environment);
+ return new JMXDeploymentManager(jmxConnector);
+ } catch (IOException e) {
+ throw new DeploymentManagerCreationException(e.getMessage());
+ }
+ } else {
+ throw new DeploymentManagerCreationException("Invalid URI: " + uri);
}
- } else {
- throw new DeploymentManagerCreationException("Invalid URI: " + uri);
-
+ } catch (RuntimeException e) {
+ // some DeploymentManagerFactories suppress unchecked exceptions - log and rethrow
+ e.printStackTrace();
+ throw e;
+ } catch (Error e) {
+ // some DeploymentManagerFactories suppress unchecked exceptions - log and rethrow
+ e.printStackTrace();
+ throw e;
}
}