geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r480044 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core: ./ commands/
Date Tue, 28 Nov 2006 14:02:55 GMT
Author: sppatel
Date: Tue Nov 28 06:02:54 2006
New Revision: 480044

URL: http://svn.apache.org/viewvc?view=rev&rev=480044
Log:
provide api to allow configurable timeout values for publish commands

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerDelegate.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/IDeploymentCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerDelegate.java?view=diff&rev=480044&r1=480043&r2=480044
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerDelegate.java
Tue Nov 28 06:02:54 2006
@@ -66,6 +66,8 @@
 	public static final String PROPERTY_PING_INTERVAL = "pingInterval";
 	
 	public static final String PROPERTY_MAX_PINGS = "maxPings";
+	
+	public static final String PROPERTY_PUBLISH_TIMEOUT = "publishTimeout";
 
 	public static final String CONSOLE_INFO = "--long";
 
@@ -291,6 +293,11 @@
 		return Integer.parseInt(maxPings);
 	}
 	
+	public long getPublishTimeout() {
+		String timeout = getInstanceProperty(PROPERTY_PUBLISH_TIMEOUT);
+		return Long.parseLong(timeout);
+	}
+	
 	public void setPingDelay(Integer delay) {
 		setInstanceProperty(PROPERTY_PING_DELAY, delay.toString());
 	}
@@ -302,6 +309,10 @@
 	public void setMaxPings(Integer maxPings) {
 		setInstanceProperty(PROPERTY_MAX_PINGS, maxPings.toString());
 	}
+	
+	public void setPublishTimeout(long timeout) {
+		setInstanceProperty(PROPERTY_PUBLISH_TIMEOUT, Long.toString(timeout));
+	}
 
 	public String discoverDeploymentFactoryClassName(IPath jarPath) {
 		try {
@@ -327,6 +338,7 @@
 		setPingDelay(new Integer(10000));
 		setMaxPings(new Integer(40));
 		setPingInterval(new Integer(5000));
+		setPublishTimeout(900000);
 	}
 
 	public String getInstanceProperty(String name) {

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?view=diff&rev=480044&r1=480043&r2=480044
==============================================================================
--- 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
Tue Nov 28 06:02:54 2006
@@ -54,5 +54,7 @@
 	public int getPingInterval();
 	
 	public int getMaxPings();
+	
+	public long getPublishTimeout();
 
 }

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?view=diff&rev=480044&r1=480043&r2=480044
==============================================================================
--- 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
Tue Nov 28 06:02:54 2006
@@ -31,17 +31,23 @@
 	private IServer server;
 
 	private IModule module;
+	
+	private long timeout;
 
 	public AbstractDeploymentCommand(IServer server, IModule module) {
 		super();
 		this.server = server;
 		this.module = module;
+		timeout = getGeronimoServer().getPublishTimeout();
 	}
 
 	public DeploymentManager getDeploymentManager() throws CoreException {
 		return DeploymentCommandFactory.getDeploymentManager(server);
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.geronimo.st.core.commands.IDeploymentCommand#getModule()
+	 */
 	public IModule getModule() {
 		return module;
 	}
@@ -52,5 +58,12 @@
 	
 	public IGeronimoServer getGeronimoServer() {
 		return (IGeronimoServer) getServer().getAdapter(IGeronimoServer.class);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.geronimo.st.core.commands.IDeploymentCommand#getTimeout()
+	 */
+	public long getTimeout() {
+		return timeout;
 	}
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/IDeploymentCommand.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/IDeploymentCommand.java?view=diff&rev=480044&r1=480043&r2=480044
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/IDeploymentCommand.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/IDeploymentCommand.java
Tue Nov 28 06:02:54 2006
@@ -47,5 +47,7 @@
 	public CommandType getCommandType();
 
 	public IModule getModule();
+	
+	public long getTimeout();
 
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.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/SynchronizedDeploymentOp.java?view=diff&rev=480044&r1=480043&r2=480044
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java
Tue Nov 28 06:02:54 2006
@@ -62,8 +62,6 @@
 public class SynchronizedDeploymentOp implements ProgressListener,
 		IDeploymentCommand {
 
-	private static final long TIMEOUT = 900000;
-
 	private IDeploymentCommand command;
 
 	private MultiStatus status = null;
@@ -107,7 +105,7 @@
 			po.addProgressListener(this);
 
 			try {
-				wait(TIMEOUT);
+				wait(getTimeout());
 			} catch (InterruptedException e) {
 			}
 
@@ -168,6 +166,10 @@
 	 */
 	public IModule getModule() {
 		return command.getModule();
+	}
+	
+	public long getTimeout() {
+		return command.getTimeout();
 	}
 	
     public void messageToStatus(int severity, String source, boolean error) {



Mime
View raw message