servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoeh...@apache.org
Subject svn commit: r676821 - in /servicemix/sandbox/cargo-servicemix/cargo-container-servicemix: ./ src/main/java/org/apache/servicemix/cargo/container/ src/main/java/org/apache/servicemix/cargo/container/internal/
Date Tue, 15 Jul 2008 07:46:03 GMT
Author: kkoehler
Date: Tue Jul 15 00:46:02 2008
New Revision: 676821

URL: http://svn.apache.org/viewvc?rev=676821&view=rev
Log:
enhanced configuration for the plugin

Modified:
    servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/   (props changed)
    servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xStandaloneLocalConfiguration.java
    servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/AbstractServiceMixInstalledLocalContainer.java
    servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/ServiceMixJMXUtil.java

Propchange: servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Jul 15 00:46:02 2008
@@ -0,0 +1,3 @@
+target
+.project
+.classpath

Modified: servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xStandaloneLocalConfiguration.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xStandaloneLocalConfiguration.java?rev=676821&r1=676820&r2=676821&view=diff
==============================================================================
--- servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xStandaloneLocalConfiguration.java
(original)
+++ servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xStandaloneLocalConfiguration.java
Tue Jul 15 00:46:02 2008
@@ -24,49 +24,82 @@
 import org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration;
 
 /**
- * ServiceMix {@link org.codehaus.cargo.container.configuration.Configuration} implementation.
- *  
+ * ServiceMix {@link org.codehaus.cargo.container.configuration.Configuration}
+ * implementation.
+ * 
  * @version $Revision$
  */
-public class ServiceMix3xStandaloneLocalConfiguration extends AbstractStandaloneLocalConfiguration
-{
-    /**
-     * constructor.
-     * 
-     * @param dir directory
-     */
-    public ServiceMix3xStandaloneLocalConfiguration(String dir) 
-    {
-        super(dir);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    protected void doConfigure(LocalContainer arg0) throws Exception 
-    {
-        
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public ConfigurationCapability getCapability() 
-    {
-        return new ConfigurationCapability() 
-        {
-        
-            public boolean supportsProperty(String arg0) 
-            {
-                return false;
-            }
-        
-            public Map getProperties() 
-            {
-                return Collections.EMPTY_MAP;
-            }
-        
-        };
-    }
+public class ServiceMix3xStandaloneLocalConfiguration extends AbstractStandaloneLocalConfiguration
{
+	
+	/**
+	 * Time in ms between deployment finished checks.
+	 */
+	private int timeInMsBetweenDeploymentChecks = 7500;
+	
+	/**
+	 * Time in ms between server startup finished checks.
+	 */
+	private int timeInMsBetweenStartupChecks = 1000;
 
+	private int serverStartupMaxRetryCount = 60;
+	
+	/**
+	 * constructor.
+	 * 
+	 * @param dir
+	 *            directory
+	 */
+	public ServiceMix3xStandaloneLocalConfiguration(String dir) {
+		super(dir);
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	protected void doConfigure(LocalContainer arg0) throws Exception {
+
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	public ConfigurationCapability getCapability() {
+		return new ConfigurationCapability() {
+
+			public boolean supportsProperty(String arg0) {
+				return false;
+			}
+
+			public Map getProperties() {
+				return Collections.EMPTY_MAP;
+			}
+
+		};
+	}
+
+	public int getTimeInMsBetweenDeploymentChecks() {
+		return timeInMsBetweenDeploymentChecks;
+	}
+
+	public void setTimeInMsBetweenDeploymentChecks(int timeBetweenDeploymentChecks) {
+		this.timeInMsBetweenDeploymentChecks = timeBetweenDeploymentChecks;
+	}
+
+	
+	public int getTimeInMsBetweenStartupChecks() {
+		return timeInMsBetweenStartupChecks;
+	}
+
+	public void setTimeInMsBetweenStartupChecks(int timeInMsBetweenStartupChecks) {
+		this.timeInMsBetweenStartupChecks = timeInMsBetweenStartupChecks;
+	}
+
+	public int getServerStartupMaxRetryCount() {
+		return serverStartupMaxRetryCount;
+	}
+
+	public void setServerStartupMaxRetryCount(int serverStartupMaxRetryCount) {
+		this.serverStartupMaxRetryCount = serverStartupMaxRetryCount;
+	}
+	
 }

Modified: servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/AbstractServiceMixInstalledLocalContainer.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/AbstractServiceMixInstalledLocalContainer.java?rev=676821&r1=676820&r2=676821&view=diff
==============================================================================
--- servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/AbstractServiceMixInstalledLocalContainer.java
(original)
+++ servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/AbstractServiceMixInstalledLocalContainer.java
Tue Jul 15 00:46:02 2008
@@ -21,6 +21,7 @@
 import java.io.FileNotFoundException;
 import java.util.jar.JarFile;
 
+import org.apache.servicemix.cargo.container.ServiceMix3xStandaloneLocalConfiguration;
 import org.apache.tools.ant.taskdefs.Java;
 import org.apache.tools.ant.types.FileSet;
 import org.apache.tools.ant.types.Path;
@@ -49,6 +50,8 @@
 
     private AntContainerExecutorThread serviceMixRunner;
     
+    private ServiceMix3xStandaloneLocalConfiguration configuration;
+    
     /**
      * {@inheritDoc}
      * @see AbstractInstalledLocalContainer#AbstractInstalledLocalContainer(LocalConfiguration)
@@ -56,6 +59,11 @@
     public AbstractServiceMixInstalledLocalContainer(LocalConfiguration configuration)
     {
         super(configuration);
+        
+        if (configuration instanceof ServiceMix3xStandaloneLocalConfiguration) {
+        	this.configuration = (ServiceMix3xStandaloneLocalConfiguration) configuration;
+        }
+        
     }
 
     /**
@@ -180,7 +188,6 @@
     
     protected void waitForCompletion(boolean waitForStarting) throws InterruptedException
{
         
-        
         if (waitForStarting)
         {
             waitForContainerStart();
@@ -190,7 +197,7 @@
      
     private void waitForContainerStart()
     {
-        int retryCount = 60;
+        int retryCount = configuration.getServerStartupMaxRetryCount();
         
         Object serverState = null;
         
@@ -198,7 +205,7 @@
         {
             try {
                 
-                Thread.sleep(1000);
+                Thread.sleep(configuration.getTimeInMsBetweenStartupChecks());
                 retryCount--;
                 
                 serverState = ServiceMixJMXUtil.getServerState();
@@ -223,7 +230,7 @@
             int newDeploymentCount = -1;
             while ((oldDeploymentCount != newDeploymentCount) || newDeploymentCount == -1)
{
                 oldDeploymentCount = ServiceMixJMXUtil.getDeploymentCount();
-                Thread.sleep(5000);
+                Thread.sleep(configuration.getTimeInMsBetweenDeploymentChecks());
                 newDeploymentCount = ServiceMixJMXUtil.getDeploymentCount();
             }
         } catch (Exception e) {

Modified: servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/ServiceMixJMXUtil.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/ServiceMixJMXUtil.java?rev=676821&r1=676820&r2=676821&view=diff
==============================================================================
--- servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/ServiceMixJMXUtil.java
(original)
+++ servicemix/sandbox/cargo-servicemix/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/ServiceMixJMXUtil.java
Tue Jul 15 00:46:02 2008
@@ -22,12 +22,8 @@
 import java.util.Map;
 import java.util.Set;
 
-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;



Mime
View raw message