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.xml
one. For example, this allows returning the right web context even if it has been defined in thejboss-web.xml
file.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsJBossWebContext()
boolean
containsJBossWebFile()
String
getContext()
String
getVirtualHost()
void
informJBossWebContext(Logger logger)
When a WAR file has a context root set in itsWEB-INF/jboss-web.xml
file, 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:
getContext
in classWAR
- Returns:
- the context defined in
jboss-web.xml
if any (including, if present, the virtual host name as a prefix). If there is nojboss-web.xml
or 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.xml
file or null if not defined
-
containsJBossWebFile
public boolean containsJBossWebFile()
- Returns:
- true if the WAR contains a
WEB-INF/jboss-web.xml
file
-
containsJBossWebContext
public boolean containsJBossWebContext()
- Returns:
- true if the WAR contains a
WEB-INF/jboss-web.xml
file with a context
-
informJBossWebContext
public void informJBossWebContext(Logger logger)
When a WAR file has a context root set in itsWEB-INF/jboss-web.xml
file, 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 perJBossWAR
file name.- Parameters:
logger
- logger to user for informing.
-
-