org.objectweb.jonas_lib.genbase.archive
Class WebApp

java.lang.Object
  extended by org.objectweb.jonas_lib.genbase.archive.J2EEArchive
      extended by org.objectweb.jonas_lib.genbase.archive.WebApp
All Implemented Interfaces:
Archive, EjbRefModule, WsClient, WsEndpoint
Direct Known Subclasses:
DummyWebApp

public class WebApp
extends J2EEArchive
implements EjbRefModule, WsClient, WsEndpoint

A WebApp is a wrapper class around a Web Archive.

Author:
Guillaume Sauthier

Constructor Summary
WebApp(Archive archive)
          Create an alone WebApp (not in an ear).
WebApp(Archive archive, Application app)
          Create an embded WebApp.
 
Method Summary
 void addClasses(java.io.File classes)
          Add Archive classes.
 void close()
          Close this archive
 Application getApplication()
          Returns the container application (can be null).
 org.w3c.dom.Document getContextDoc()
          Returns the Document of the context.xml file
 java.lang.String getContextRoot()
           
 java.util.Map getDescriptors()
          Returns a Map of name to Document for each modified Descriptor of the archive.
 java.util.List getEjbRefDescs()
          Returns the list of ejb-ref elements contained by a module.
 org.w3c.dom.Document getJonasWebAppDoc()
          Returns the Document of the jonas-web.xml file.
 org.w3c.dom.Document getJonasWebservicesDoc()
          Returns the Document of the jonas-webservices.xml file.
 java.lang.String getName()
          Returns the name of the Archive.
 java.util.List getServiceDescs()
          Returns the list of webservice-description elements contained by a module.
 java.util.List getServiceRefDescs()
          Returns the list of service-ref elements contained by a module.
 org.w3c.dom.Document getWebAppDoc()
          Returns the Document of the web.xml file.
 org.w3c.dom.Document getWebJettyDoc()
          Returns the Document of the web-=jetty.xml file
 org.w3c.dom.Document getWebservicesDoc()
          Returns the Document of the webservices.xml file.
 void initialize()
          Initialize the Archive.
 org.w3c.dom.Document newContextDoc()
          Returns a new Document of the context.xml file
 org.w3c.dom.Document newWebJettyDoc()
          Returns a new Document of the web-jetty.xml file
 boolean omit(java.lang.String name)
          Returns true if filename must be omitted in the archive.
 void setApplication(Application app)
          Set the container application.
 
Methods inherited from class org.objectweb.jonas_lib.genbase.archive.J2EEArchive
addDirectory, addDirectoryIn, addFile, addFile, addFileIn, getArchive, getContainedFiles, getI18n, getInputStream, getLogger, getManifest, getModuleClassloader, getRootFile, isDTDsAllowed, isPacked, setArchive, setModuleClassloader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebApp

public WebApp(Archive archive)
       throws GenBaseException
Create an alone WebApp (not in an ear).

Parameters:
archive - file archive
Throws:
GenBaseException - When Init fails

WebApp

public WebApp(Archive archive,
              Application app)
       throws GenBaseException
Create an embded WebApp.

Parameters:
archive - Web Archive
app - container application
Throws:
GenBaseException - When init fails
Method Detail

getName

public java.lang.String getName()
Returns the name of the Archive. Overrides J2EEArchive.getName();

Specified by:
getName in interface Archive
Overrides:
getName in class J2EEArchive
Returns:
the name of the Archive.
See Also:
J2EEArchive.getName()

setApplication

public void setApplication(Application app)
Set the container application.

Parameters:
app - the container application.

getApplication

public Application getApplication()
Returns the container application (can be null).

Returns:
the container application (can be null).

getServiceRefDescs

public java.util.List getServiceRefDescs()
Returns the list of service-ref elements contained by a module.

Specified by:
getServiceRefDescs in interface WsClient
Returns:
the list of service-ref elements contained by a module.

getServiceDescs

public java.util.List getServiceDescs()
Returns the list of webservice-description elements contained by a module.

Specified by:
getServiceDescs in interface WsEndpoint
Returns:
the list of webservice-description elements contained by a module.

addClasses

public void addClasses(java.io.File classes)
Add Archive classes.

Parameters:
classes - root directory containing classes.

getWebAppDoc

public org.w3c.dom.Document getWebAppDoc()
Returns the Document of the web.xml file.

Returns:
the Document of the web.xml file.

getJonasWebAppDoc

public org.w3c.dom.Document getJonasWebAppDoc()
Returns the Document of the jonas-web.xml file.

Returns:
the Document of the jonas-web.xml file.

getWebservicesDoc

public org.w3c.dom.Document getWebservicesDoc()
Returns the Document of the webservices.xml file.

Returns:
the Document of the webservices.xml file.

getJonasWebservicesDoc

public org.w3c.dom.Document getJonasWebservicesDoc()
Returns the Document of the jonas-webservices.xml file.

Returns:
the Document of the jonas-webservices.xml file.

newContextDoc

public org.w3c.dom.Document newContextDoc()
                                   throws WsGenException
Returns a new Document of the context.xml file

Returns:
the Document of the context.xml file.
Throws:
WsGenException - if context.xml Document cannot be produced.

newWebJettyDoc

public org.w3c.dom.Document newWebJettyDoc()
                                    throws WsGenException
Returns a new Document of the web-jetty.xml file

Returns:
the document of the web-jetty.xml file
Throws:
WsGenException - if context.xml Document cannot be produced.

getContextDoc

public org.w3c.dom.Document getContextDoc()
Returns the Document of the context.xml file

Returns:
the Document of the context.xml file.

getWebJettyDoc

public org.w3c.dom.Document getWebJettyDoc()
Returns the Document of the web-=jetty.xml file

Returns:
the document of the web-jetty.xml file

getDescriptors

public java.util.Map getDescriptors()
Returns a Map of name to Document for each modified Descriptor of the archive.

Specified by:
getDescriptors in class J2EEArchive
Returns:
a Map of name to Document

omit

public boolean omit(java.lang.String name)
Returns true if filename must be omitted in the archive.

Specified by:
omit in class J2EEArchive
Parameters:
name - filename to be tested
Returns:
true if filename must be omitted.

initialize

public void initialize()
                throws GenBaseException
Initialize the Archive.

Specified by:
initialize in class J2EEArchive
Throws:
GenBaseException - When initialization fails.

getContextRoot

public java.lang.String getContextRoot()
Specified by:
getContextRoot in interface WsEndpoint
Returns:
Returns the context-root to use for this group of Services.

getEjbRefDescs

public java.util.List getEjbRefDescs()
Returns the list of ejb-ref elements contained by a module.

Specified by:
getEjbRefDescs in interface EjbRefModule
Returns:
the list of ejb-ref elements contained by a module.

close

public void close()
Close this archive

Specified by:
close in interface Archive
Overrides:
close in class J2EEArchive