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(File classes)
          Add Archive classes.
 void close()
          Close this archive
 Application getApplication()
          Returns the container application (can be null).
 Document getContextDoc()
          Returns the Document of the context.xml file
 String getContextRoot()
           
 Map getDescriptors()
          Returns a Map of name to Document for each modified Descriptor of the archive.
 List getEjbRefDescs()
          Returns the list of ejb-ref elements contained by a module.
 Document getJonasWebAppDoc()
          Returns the Document of the jonas-web.xml file.
 Document getJonasWebservicesDoc()
          Returns the Document of the jonas-webservices.xml file.
 String getName()
          Returns the name of the Archive.
 List getServiceDescs()
          Returns the list of webservice-description elements contained by a module.
 List getServiceRefDescs()
          Returns the list of service-ref elements contained by a module.
 Document getWebAppDoc()
          Returns the Document of the web.xml file.
 Document getWebJettyDoc()
          Returns the Document of the web-=jetty.xml file
 Document getWebservicesDoc()
          Returns the Document of the webservices.xml file.
 void initialize()
          Initialize the Archive.
 Document newContextDoc()
          Returns a new Document of the context.xml file
 Document newWebJettyDoc()
          Returns a new Document of the web-jetty.xml file
 boolean omit(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 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 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 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(File classes)
Add Archive classes.

Parameters:
classes - root directory containing classes.

getWebAppDoc

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

Returns:
the Document of the web.xml file.

getJonasWebAppDoc

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

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

getWebservicesDoc

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

Returns:
the Document of the webservices.xml file.

getJonasWebservicesDoc

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

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

newContextDoc

public Document newContextDoc()
                       throws GenBaseException
Returns a new Document of the context.xml file

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

newWebJettyDoc

public Document newWebJettyDoc()
                        throws GenBaseException
Returns a new Document of the web-jetty.xml file

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

getContextDoc

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

Returns:
the Document of the context.xml file.

getWebJettyDoc

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

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

getDescriptors

public 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(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 String getContextRoot()
Specified by:
getContextRoot in interface WsEndpoint
Returns:
Returns the context-root to use for this group of Services.

getEjbRefDescs

public 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


Copyright © 2007 OW2 Consortium. All Rights Reserved.