geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r411446 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/ org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/ org.apache.geronimo.st.v1.core/src/org/apache/g...
Date Sat, 03 Jun 2006 17:16:34 GMT
Author: sppatel
Date: Sat Jun  3 10:16:33 2006
New Revision: 411446

URL: http://svn.apache.org/viewvc?rev=411446&view=rev
Log:
fix 1.1 server to use test env configuration

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GenericGeronimoServerBehaviour.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/IGeronimoServer.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServer.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServer.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GenericGeronimoServerBehaviour.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GenericGeronimoServerBehaviour.java?rev=411446&r1=411445&r2=411446&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GenericGeronimoServerBehaviour.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GenericGeronimoServerBehaviour.java
Sat Jun  3 10:16:33 2006
@@ -217,8 +217,7 @@
 	}
 
 	protected IStatus distribute(IModule module) throws Exception {
-		IDeploymentCommand cmd = DeploymentCommandFactory
-				.createDistributeCommand(module, getServer(), getGeronimoServer().isTestEnvironment());
+		IDeploymentCommand cmd = DeploymentCommandFactory.createDistributeCommand(module, getServer());
 		return cmd.execute(_monitor);
 	}
 
@@ -243,8 +242,7 @@
 	}
 
 	protected IStatus reDeploy(IModule module) throws Exception {
-		IDeploymentCommand cmd = DeploymentCommandFactory
-				.createRedeployCommand(module, getServer(), getGeronimoServer().isTestEnvironment());
+		IDeploymentCommand cmd = DeploymentCommandFactory.createRedeployCommand(module, getServer());
 		return cmd.execute(_monitor);
 	}
 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/IGeronimoServer.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/IGeronimoServer.java?rev=411446&r1=411445&r2=411446&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/IGeronimoServer.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/IGeronimoServer.java
Sat Jun  3 10:16:33 2006
@@ -40,6 +40,10 @@
 
 	public IGeronimoVersionHandler getVersionHandler();
 	
-	public boolean isTestEnvironment();
+	public boolean isPersistant();
+	
+	public boolean isInPlace();
+	
+	public boolean isRunFromWorkspace();
 
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java?rev=411446&r1=411445&r2=411446&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java
Sat Jun  3 10:16:33 2006
@@ -17,6 +17,7 @@
 
 import javax.enterprise.deploy.spi.DeploymentManager;
 
+import org.apache.geronimo.st.core.IGeronimoServer;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.wst.server.core.IModule;
 import org.eclipse.wst.server.core.IServer;
@@ -43,5 +44,9 @@
 
 	public IServer getServer() {
 		return server;
+	}
+	
+	public IGeronimoServer getGeronimoServer() {
+		return (IGeronimoServer) getServer().getAdapter(IGeronimoServer.class);
 	}
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java?rev=411446&r1=411445&r2=411446&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java
Sat Jun  3 10:16:33 2006
@@ -19,6 +19,7 @@
 
 import org.apache.geronimo.st.core.DeploymentUtils;
 import org.apache.geronimo.st.core.GeronimoUtils;
+import org.apache.geronimo.st.core.IGeronimoServer;
 import org.apache.geronimo.st.core.internal.Trace;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.wst.common.componentcore.internal.StructureEdit;
@@ -29,19 +30,18 @@
 
 abstract public class DeployCommand extends AbstractDeploymentCommand {
 
-	boolean inPlace;
-
 	/**
 	 * @param server
 	 * @param module
 	 */
-	public DeployCommand(IServer server, IModule module, boolean inPlace) {
+	public DeployCommand(IServer server, IModule module) {
 		super(server, module);
 	}
 
 	public File getTargetFile() {
 		File file = null;
-		if (inPlace && !GeronimoUtils.isEarModule(getModule())) {
+		IGeronimoServer gs = getGeronimoServer();
+		if (gs.isRunFromWorkspace() && !GeronimoUtils.isEarModule(getModule())) {
 			StructureEdit moduleCore = StructureEdit.getStructureEditForRead(getModule().getProject());
 			try {
 				WorkbenchComponent component = moduleCore.getComponent();
@@ -52,14 +52,12 @@
 					moduleCore.dispose();
 			}
 		} else {
-			String version = getServer().getRuntime().getRuntimeType().getVersion();
-			IPath outputDir = DeploymentUtils.STATE_LOC.append("server_"
-					+ getServer().getId());
+			IPath outputDir = DeploymentUtils.STATE_LOC.append("server_" + getServer().getId());
 			outputDir.toFile().mkdirs();
-			if ("1.0".equals(version)) {
-				file = DeploymentUtils.createJarFile(getModule(), outputDir);
-			} else {
+			if(gs.isInPlace()) {
 				file = DeploymentUtils.generateExplodedConfiguration(getModule(), outputDir).toFile();
+			} else {
+				file = DeploymentUtils.createJarFile(getModule(), outputDir);
 			}
 		}
 		

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java?rev=411446&r1=411445&r2=411446&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java
Sat Jun  3 10:16:33 2006
@@ -47,10 +47,10 @@
 	 * @return
 	 * @throws CoreException
 	 */
-	public static IDeploymentCommand createDistributeCommand(IModule module, IServer server,
boolean inPlace) throws CoreException {
+	public static IDeploymentCommand createDistributeCommand(IModule module, IServer server)
throws CoreException {
 		IGeronimoServerBehavior gs = (IGeronimoServerBehavior) server.loadAdapter(IGeronimoServerBehavior.class,
null);
 		Target[] targets = gs.getTargets();
-		return new SynchronizedDeploymentOp(new DistributeCommand(server, module, targets, inPlace));
+		return new SynchronizedDeploymentOp(new DistributeCommand(server, module, targets));
 	}
 
 	/**
@@ -80,8 +80,8 @@
 	 * @return
 	 * @throws CoreException
 	 */
-	public static IDeploymentCommand createRedeployCommand(IModule module, IServer server, boolean
inPlace) throws CoreException {
-		return new SynchronizedDeploymentOp(new RedeployCommand(server, module, inPlace));
+	public static IDeploymentCommand createRedeployCommand(IModule module, IServer server) throws
CoreException {
+		return new SynchronizedDeploymentOp(new RedeployCommand(server, module));
 	}
 
 	/**

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java?rev=411446&r1=411445&r2=411446&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java
Sat Jun  3 10:16:33 2006
@@ -33,8 +33,8 @@
 
 	Target[] targets;
 
-	public DistributeCommand(IServer server, IModule module, Target[] targets, boolean inPlace)
{
-		super(server, module, inPlace);
+	public DistributeCommand(IServer server, IModule module, Target[] targets) {
+		super(server, module);
 		this.targets = targets;
 	}
 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java?rev=411446&r1=411445&r2=411446&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java
Sat Jun  3 10:16:33 2006
@@ -31,8 +31,8 @@
 
 class RedeployCommand extends DeployCommand {
 
-	public RedeployCommand(IServer server, IModule module, boolean inPlace) {
-		super(server, module, inPlace);
+	public RedeployCommand(IServer server, IModule module) {
+		super(server, module);
 	}
 
 	/*

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServer.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServer.java?rev=411446&r1=411445&r2=411446&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServer.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServer.java
Sat Jun  3 10:16:33 2006
@@ -102,13 +102,25 @@
 			versionHandler = new GeronimoV1VersionHandler();
 		return versionHandler;
 	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.geronimo.st.core.IGeronimoServer#isTestEnvironment()
+	
+	/* (non-Javadoc)
+	 * @see org.apache.geronimo.st.core.IGeronimoServer#isPersistant()
 	 */
-	public boolean isTestEnvironment() {
+	public boolean isPersistant() {
+		return true;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.apache.geronimo.st.core.IGeronimoServer#isInPlace()
+	 */
+	public boolean isInPlace() {
+		return false;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.apache.geronimo.st.core.IGeronimoServer#isRunFromWorkspace()
+	 */
+	public boolean isRunFromWorkspace() {
 		return false;
 	}
 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServer.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServer.java?rev=411446&r1=411445&r2=411446&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServer.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServer.java
Sat Jun  3 10:16:33 2006
@@ -92,7 +92,7 @@
 	 */
 	public void configureDeploymentManager(DeploymentManager dm) {
 		((JMXDeploymentManager) dm).setLogConfiguration(true, true);
-		boolean enableInPlace = SocketUtil.isLocalhost(getServer().getHost());
+		boolean enableInPlace = SocketUtil.isLocalhost(getServer().getHost()) && isInPlace();
 		setInPlaceDeployment(dm, enableInPlace);
 	}
 
@@ -112,40 +112,36 @@
 	}
 	
 	/* (non-Javadoc)
-	 * @see org.apache.geronimo.st.core.IGeronimoServer#isTestEnvironment()
+	 * @see org.apache.geronimo.st.core.IGeronimoServer#isPersistant()
 	 */
-	public boolean isTestEnvironment() {
-		return true;
-	}
-	
 	public boolean isPersistant() {
 		return getAttribute(PROPERTY_PERSISTENT, false);
-		//return Boolean.getBoolean((String) getServerInstanceProperties().get(PROPERTY_PERSISTENT));
 	}
 	
+	/* (non-Javadoc)
+	 * @see org.apache.geronimo.st.core.IGeronimoServer#isInPlace()
+	 */
 	public boolean isInPlace() {
 		return getAttribute(PROPERTY_IN_PLACE, false);
-		//return Boolean.getBoolean((String) getServerInstanceProperties().get(PROPERTY_IN_PLACE));
 	}
 	
+	/* (non-Javadoc)
+	 * @see org.apache.geronimo.st.core.IGeronimoServer#isRunFromWorkspace()
+	 */
 	public boolean isRunFromWorkspace() {
 		return getAttribute(PROPERTY_RUN_FROM_WORKSPACE, false);
-		//return Boolean.getBoolean((String) getServerInstanceProperties().get(PROPERTY_RUN_FROM_WORKSPACE));
 	}
 	
 	public void setPersistent(boolean enable) {
 		setAttribute(PROPERTY_PERSISTENT, enable);
-		//getServerInstanceProperties().put(PROPERTY_PERSISTENT, Boolean.toString(enable));
 	}
 	
 	public void setInPlace(boolean enable) {
 		setAttribute(PROPERTY_IN_PLACE, enable);
-		//getServerInstanceProperties().put(PROPERTY_IN_PLACE, Boolean.toString(enable));
 	}
 	
 	public void setRunFromWorkspace(boolean enable) {
 		setAttribute(PROPERTY_RUN_FROM_WORKSPACE, enable);
-		//getServerInstanceProperties().put(PROPERTY_RUN_FROM_WORKSPACE, Boolean.toString(enable));
 	}
 	
 	/* (non-Javadoc)

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java?rev=411446&r1=411445&r2=411446&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java
Sat Jun  3 10:16:33 2006
@@ -177,7 +177,7 @@
 	}
 
 	protected void setupLaunch(ILaunch launch, String launchMode, IProgressMonitor monitor)
throws CoreException {
-		if (SocketUtil.isLocalhost(getServer().getHost())) {
+		if (SocketUtil.isLocalhost(getServer().getHost()) && getGeronimoServer().isRunFromWorkspace())
{
 			getServer().addServerListener(new ConfigStoreInstaller());
 		}
 		super.setupLaunch(launch, launchMode, monitor);
@@ -189,7 +189,7 @@
 	 * @see org.apache.geronimo.st.core.IGeronimoServerBehavior#getTargets()
 	 */
 	public Target[] getTargets() {
-		if (getGeronimoServer().isTestEnvironment()) {
+		if (getGeronimoServer().isRunFromWorkspace()) {
 			AbstractNameQuery query = new AbstractNameQuery("org.apache.geronimo.devtools.EclipseAwareConfigurationStore");
 			Set set = getKernel().listGBeans(query);
 			if (!set.isEmpty()) {



Mime
View raw message