[jboss-svn-commits] JBL Code SVN: r37672 - labs/jbossesb/branches/JBESB_4_10_CP/product/tools/jonplugin/as5/src/main/java/org/jbosson/plugins/jbossesb.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Oct 25 22:50:09 EDT 2011
Author: tcunning
Date: 2011-10-25 22:50:08 -0400 (Tue, 25 Oct 2011)
New Revision: 37672
Modified:
labs/jbossesb/branches/JBESB_4_10_CP/product/tools/jonplugin/as5/src/main/java/org/jbosson/plugins/jbossesb/ESB5Component.java
Log:
JBESB-3703
Patch around the removal of RemoteDeployer.
Modified: labs/jbossesb/branches/JBESB_4_10_CP/product/tools/jonplugin/as5/src/main/java/org/jbosson/plugins/jbossesb/ESB5Component.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_10_CP/product/tools/jonplugin/as5/src/main/java/org/jbosson/plugins/jbossesb/ESB5Component.java 2011-10-25 17:20:58 UTC (rev 37671)
+++ labs/jbossesb/branches/JBESB_4_10_CP/product/tools/jonplugin/as5/src/main/java/org/jbosson/plugins/jbossesb/ESB5Component.java 2011-10-26 02:50:08 UTC (rev 37672)
@@ -10,6 +10,7 @@
import org.apache.commons.lang.exception.ExceptionUtils;
import org.jboss.on.common.jbossas.JBPMWorkflowManager;
import org.jboss.on.common.jbossas.JBossASPaths;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.content.PackageType;
@@ -28,8 +29,9 @@
import org.rhq.plugins.jbossas5.connection.RemoteProfileServiceConnectionProvider;
import org.rhq.plugins.jbossas5.deploy.Deployer;
import org.rhq.plugins.jbossas5.deploy.LocalDeployer;
-import org.rhq.plugins.jbossas5.deploy.RemoteDeployer;
+import java.lang.reflect.Constructor;
+
import com.jboss.jbossnetwork.product.jbpm.handlers.ControlActionFacade;
/**
@@ -234,10 +236,32 @@
protected Deployer getDeployer() {
ProfileServiceConnection profileServiceConnection = getConnection();
+
+ ClassLoader classLoader = this.getClass().getClassLoader();
+
if (runningEmbedded()) {
return new LocalDeployer(profileServiceConnection);
} else {
- return new RemoteDeployer(profileServiceConnection, this.resourceContext);
+ try {
+ Class clazz = classLoader.loadClass("org.rhq.plugins.jbossas5.deploy.RemoteDeployer");
+ Constructor constructor = clazz.getDeclaredConstructor(ProfileServiceConnection.class, ResourceContext.class);
+ return (Deployer) constructor.newInstance(profileServiceConnection, this.resourceContext);
+
+ } catch (Exception e) {
+ try {
+ Class remoteIClazz = classLoader.loadClass("org.rhq.plugins.jbossas5.deploy.PackageDownloader");
+
+ Class remoteDClazz = classLoader.loadClass("org.rhq.plugins.jbossas5.deploy.RemoteDownloader");
+ Constructor remoteDConstructor = remoteDClazz.getDeclaredConstructor(ResourceContext.class, boolean.class, ProfileServiceConnection.class);
+
+ Class clazz = classLoader.loadClass("org.rhq.plugins.jbossas5.deploy.ManagedComponentDeployer");
+ Constructor constructor = clazz.getDeclaredConstructor(ProfileServiceConnection.class, remoteIClazz);
+ return (Deployer) constructor.newInstance(profileServiceConnection,
+ (remoteDConstructor.newInstance(this.resourceContext, false, profileServiceConnection)));
+ } catch (Exception ef) {
+ return null;
+ }
+ }
}
}
More information about the jboss-svn-commits
mailing list