Class JBossWAR
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.spi.deployable.AbstractDeployable
-
- org.codehaus.cargo.container.deployable.WAR
-
- org.codehaus.cargo.container.jboss.deployable.JBossWAR
-
- All Implemented Interfaces:
Deployable,Loggable
public class JBossWAR extends WAR
Extension that supports custom JBoss descriptor files such as thejboss-web.xmlone. For example, this allows returning the right web context even if it has been defined in thejboss-web.xmlfile.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsJBossWebContext()booleancontainsJBossWebFile()StringgetContext()StringgetVirtualHost()voidinformJBossWebContext(Logger logger)When a WAR file has a context root set in itsWEB-INF/jboss-web.xmlfile, then this overrides any other context set in the Codehaus Cargo deployable.-
Methods inherited from class org.codehaus.cargo.container.deployable.WAR
getBaseFilename, getExtraClasspath, getFilename, getName, getType, setContext, setExtraClasspath
-
Methods inherited from class org.codehaus.cargo.container.spi.deployable.AbstractDeployable
equals, getFile, getFileHandler, getVersion, hashCode, isExpanded, setFileHandler, setLogger, setVersion, toString
-
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger
-
-
-
-
Constructor Detail
-
JBossWAR
public JBossWAR(String war)
- Parameters:
war- the location of the WAR being wrapped. This must point to either a WAR file or an expanded WAR directory.
-
-
Method Detail
-
getContext
public String getContext()
- Overrides:
getContextin classWAR- Returns:
- the context defined in
jboss-web.xmlif any (including, if present, the virtual host name as a prefix). If there is nojboss-web.xmlor if it doesn't define any root context, then returnWAR.getContext().
-
getVirtualHost
public String getVirtualHost()
- Returns:
- the virtual host element found in the
jboss-web.xmlfile or null if not defined
-
containsJBossWebFile
public boolean containsJBossWebFile()
- Returns:
- true if the WAR contains a
WEB-INF/jboss-web.xmlfile
-
containsJBossWebContext
public boolean containsJBossWebContext()
- Returns:
- true if the WAR contains a
WEB-INF/jboss-web.xmlfile with a context
-
informJBossWebContext
public void informJBossWebContext(Logger logger)
When a WAR file has a context root set in itsWEB-INF/jboss-web.xmlfile, then this overrides any other context set in the Codehaus Cargo deployable. Inform the user about it when necessary.
This information message is output only once perJBossWARfile name.- Parameters:
logger- logger to user for informing.
-
-