Author: djencks Date: Wed Feb 9 16:43:00 2005 New Revision: 153137 URL: http://svn.apache.org/viewcvs?view=rev&rev=153137 Log: GERONIMO-573. Expose retry count and retry interval properties
Modified: geronimo/trunk/plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/WaitForStarted.java Modified: geronimo/trunk/plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/WaitForStarted.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/WaitForStarted.java?view=diff&r1=153136&r2=153137 ============================================================================== --- geronimo/trunk/plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/WaitForStarted.java (original) +++ geronimo/trunk/plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/WaitForStarted.java Wed Feb 9 16:43:00 2005 @@ -33,6 +33,7 @@ public class WaitForStarted extends AbstractModuleCommand { private int maxTries = 40; + private int retryIntervalMilliseconds = 1000; private MBeanServerConnection mbServerConnection; private KernelMBean kernel; @@ -46,6 +47,14 @@ this.id = id; } + public void setMaxTries(int maxTries) { + this.maxTries = maxTries; + } + + public void setRetryIntervalMilliseconds(int retryIntervalMilliseconds) { + this.retryIntervalMilliseconds = retryIntervalMilliseconds; + } + public void execute() throws Exception { String uri = getUri().substring(DeploymentFactoryImpl.URI_PREFIX.length()); if (!uri.startsWith("jmx")) { @@ -70,7 +79,7 @@ if (tries == 0) { throw new Exception("Could not connect"); } - Thread.sleep(1000); + Thread.sleep(retryIntervalMilliseconds); } } } finally { @@ -86,7 +95,7 @@ } catch (NoSuchConfigException e) { //hasn't been loaded yet, keep trying } - Thread.sleep(1000); + Thread.sleep(retryIntervalMilliseconds); } throw new Exception("Configuration is not yet started"); }