org.codehaus.mojo.jboss
Class StartAndWaitMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.jboss.AbstractJBossServerMojo
          extended by org.codehaus.mojo.jboss.StartMojo
              extended by org.codehaus.mojo.jboss.StartAndWaitMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
StartAndWaitMojoDeprecated, WaitAppStartMojo

public class StartAndWaitMojo
extends StartMojo

Starts JBoss and waits until the server is started.

Since:
1.4
Author:
J-C, Fuzail Sarang
Requires a Maven project to run:
false
Is defined by the goal name:
start-and-wait

Field Summary
protected  String hostName
          The host JBoss is running on.
protected  String namingPort
          The port for the naming service.
static long ONE_SECOND
          One second in millis.
protected  int retry
          Maximum number of retries to get JBoss JMX MBean connection.
protected  int retryWait
          Wait in ms before each retry of the JBoss JMX MBean connection.
protected  int timeout
          Time in ms to start the application server (once JMX MBean connection has been reached).
 
Fields inherited from class org.codehaus.mojo.jboss.StartMojo
options, startOptions, STARTUP_COMMAND
 
Fields inherited from class org.codehaus.mojo.jboss.AbstractJBossServerMojo
jbossHome, serverName
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
StartAndWaitMojo()
           
 
Method Summary
 void execute()
          Main plugin execution.
protected  InitialContext getInitialContext()
          Set up the context information for connecting the the jboss server.
protected  boolean isStarted(javax.management.MBeanServerConnection server)
          Check if the server has finished startup.
 
Methods inherited from class org.codehaus.mojo.jboss.AbstractJBossServerMojo
checkConfig, getPassword, getUsername, launch, launchUnixScript, launchWindowsBatch
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONE_SECOND

public static final long ONE_SECOND
One second in millis.

See Also:
Constant Field Values

retry

protected int retry
Maximum number of retries to get JBoss JMX MBean connection.

Is defined by:
expression:
${jboss.retry}
default-value:
4

retryWait

protected int retryWait
Wait in ms before each retry of the JBoss JMX MBean connection.

Is defined by:
expression:
${jboss.retryWait}
default-value:
5000

timeout

protected int timeout
Time in ms to start the application server (once JMX MBean connection has been reached).

Is defined by:
expression:
${jboss.timeout}
default-value:
20000

namingPort

protected String namingPort
The port for the naming service.

Is defined by:
expression:
${jboss.namingPort}
default-value:
1099

hostName

protected String hostName
The host JBoss is running on.

Is defined by:
expression:
${jboss.hostname}
default-value:
localhost
Constructor Detail

StartAndWaitMojo

public StartAndWaitMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Main plugin execution.

Specified by:
execute in interface org.apache.maven.plugin.Mojo
Overrides:
execute in class StartMojo
Throws:
org.apache.maven.plugin.MojoExecutionException

isStarted

protected boolean isStarted(javax.management.MBeanServerConnection server)
                     throws Exception
Check if the server has finished startup. Will throw one of several exceptions if the server connection fails.

Parameters:
s -
Returns:
Throws:
Exception

getInitialContext

protected InitialContext getInitialContext()
                                    throws org.apache.maven.plugin.MojoExecutionException
Set up the context information for connecting the the jboss server.

Returns:
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2005-2012 Codehaus. All Rights Reserved.