org.ow2.jonas.web.base
Class War

java.lang.Object
  extended by org.ow2.jonas.web.base.War
All Implemented Interfaces:
WarMBean

public class War
extends Object
implements WarMBean

This class is representing a War (a web application) structure which is composed of : - the URL of the war file. - the URL of the ear containing this war. - the name of the host on which this war is deployed. - the context root of this war. - compliance to the java 2 delegation model. - Content of the web.xml file - Content of the jonas-web.xml file - List of the servlets name - A permission manager

Author:
Florent Benoit

Constructor Summary
War(URL warURL, URL earURL, String hostName, String contextRoot, boolean java2DelegationModel, String xmlContent, String jonasXmlContent, String[] servletsName)
          Construct a War with the specified name, of the specified ear.
 
Method Summary
 boolean equals(War war)
          Return true if only if the specified war is equal to this war.
 String getContextId()
          Gets a contextId for this module.
 String getContextRoot()
          Get the context root of this war.
 URL getEarURL()
          Get the URL of the ear containing this war.
 String getHostName()
          Get the name of the host on which this war is deployed.
 boolean getJava2DelegationModel()
          Context classloader must follow the java2 delegation model ?
 String getJOnASXmlContent()
          Return the jonas-specific xml file.
 PermissionManager getPermissionManager()
          Gets the permission manager.
 String[] getServletsName()
          Return a list of all servlets available.
 URL getWarURL()
          Get the URL of the war file.
 String getXmlContent()
          Return the standard xml file.
 int hashCode()
           
 boolean isInEarCase()
          Return true if only if this war is in an ear file.
 void setPermissionManager(PermissionManager permissionManager)
          Set the permission manager.
 String toString()
          Return a string representation of the war.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

War

public War(URL warURL,
           URL earURL,
           String hostName,
           String contextRoot,
           boolean java2DelegationModel,
           String xmlContent,
           String jonasXmlContent,
           String[] servletsName)
Construct a War with the specified name, of the specified ear. (Used in the case of an ear application).

Parameters:
warURL - the URL of the war.
earURL - the URL of the ear containing this war.
hostName - the name of the host on which this war is deployed.
contextRoot - the context root of this war.
java2DelegationModel - the java2 delegation model compliance
xmlContent - content of the web.xml file
jonasXmlContent - content of the jonas-web.xml file
servletsName - name of the servlets
Method Detail

isInEarCase

public boolean isInEarCase()
Return true if only if this war is in an ear file.

Specified by:
isInEarCase in interface WarMBean
Returns:
true if only if this war is in an ear file.

getWarURL

public URL getWarURL()
Get the URL of the war file.

Specified by:
getWarURL in interface WarMBean
Returns:
the URL of the war file.

getEarURL

public URL getEarURL()
Get the URL of the ear containing this war.

Specified by:
getEarURL in interface WarMBean
Returns:
the URL of the war file.

getHostName

public String getHostName()
Get the name of the host on which this war is deployed.

Specified by:
getHostName in interface WarMBean
Returns:
the name of the host on which this war is deployed.

getContextRoot

public String getContextRoot()
Get the context root of this war.

Specified by:
getContextRoot in interface WarMBean
Returns:
the context root of this war.

getJava2DelegationModel

public boolean getJava2DelegationModel()
Context classloader must follow the java2 delegation model ?

Specified by:
getJava2DelegationModel in interface WarMBean
Returns:
true if the context's classloader must follow the java 2 delegation model.

getXmlContent

public String getXmlContent()
Return the standard xml file.

Specified by:
getXmlContent in interface WarMBean
Returns:
the standard xml file

getJOnASXmlContent

public String getJOnASXmlContent()
Return the jonas-specific xml file.

Specified by:
getJOnASXmlContent in interface WarMBean
Returns:
the jonas-specific xml file

getServletsName

public String[] getServletsName()
Return a list of all servlets available.

Specified by:
getServletsName in interface WarMBean
Returns:
a list of all servlets available

setPermissionManager

public void setPermissionManager(PermissionManager permissionManager)
Set the permission manager.

Parameters:
permissionManager - permission manager to set

getPermissionManager

public PermissionManager getPermissionManager()
Gets the permission manager.

Returns:
permission manager

getContextId

public String getContextId()
Gets a contextId for this module.

Returns:
contextId

equals

public boolean equals(War war)
Return true if only if the specified war is equal to this war.

Parameters:
war - the war to compare for the equality.
Returns:
true if only if the specified war is equal to this war.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Returns:
an hashcode for this object
See Also:
Object.hashCode()

toString

public String toString()
Return a string representation of the war. Used for debug.

Overrides:
toString in class Object
Returns:
a string representation of the war.


Copyright © 2010 OW2 Consortium. All Rights Reserved.