org.objectweb.jonas_ws.wsgen.archive
Class WebApp

java.lang.Object
  extended byorg.objectweb.jonas_ws.wsgen.archive.J2EEArchive
      extended byorg.objectweb.jonas_ws.wsgen.archive.WebApp
All Implemented Interfaces:
Archive, WsClient, WsEndpoint
Direct Known Subclasses:
DummyWebApp

public class WebApp
extends J2EEArchive
implements WsClient, WsEndpoint

a WebApp is a wrapper class around a Web Archive.

Author:
Guillaume Sauthier

Field Summary
protected  Application app
          Application containing the webapp
 
Fields inherited from class org.objectweb.jonas_ws.wsgen.archive.J2EEArchive
archive, i18n, logger
 
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.
 Application getApplication()
          Returns the container application (can be null).
 java.util.Map getDescriptors()
          Returns a Map of name to Document for each modified Descriptor of the archive.
 org.w3c.dom.Document getJonasWebAppDoc()
          Returns the Document of the jonas-web.xml file.
 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.
 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_ws.wsgen.archive.J2EEArchive
addDirectory, addDirectoryIn, addFile, addFile, addFileIn, getContainedFiles, getInputStream, getManifest, getName, getRootFile, isPacked
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

app

protected Application app
Application containing the webapp

Constructor Detail

WebApp

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

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

WebApp

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

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

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.

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.