org.objectweb.jonas_ws.wsgen.archive
Class Application

java.lang.Object
  extended byorg.objectweb.jonas_ws.wsgen.archive.J2EEArchive
      extended byorg.objectweb.jonas_ws.wsgen.archive.Application
All Implemented Interfaces:
Archive
Direct Known Subclasses:
DummyApplication

public class Application
extends J2EEArchive

Application is a wrapper around an ear (packaged as a jar or as an unpacked jar).

Author:
Guillaume Sauthier

Field Summary
protected  org.w3c.dom.Document app
          application Descriptor
protected  java.util.List clients
          list of embded clients archive.
protected  java.net.URLClassLoader commonCL
          Common Libs ClassLoader
protected  java.net.URLClassLoader earCL
          Common ClassLoader for Application
protected  java.net.URLClassLoader ejbCL
          EJB Jar ClassLoader
protected  java.util.List ejbjars
          list of embded ejbjars archive.
protected  java.util.List pathFiles
          libs path File
protected  java.util.List webapps
          list of embded webapps archive.
 
Fields inherited from class org.objectweb.jonas_ws.wsgen.archive.J2EEArchive
archive, i18n, logger
 
Constructor Summary
Application(Archive archive)
          Creates a new Application archive.
 
Method Summary
 void addClient(Client client)
          Add a new Client in the Application.
 void addEjbJar(EjbJar ejbjar)
          Add a new EjbJar in the Application.
 void addWebApp(WebApp webapp, java.lang.String context)
          Add a new WebApp in the Application.
 org.w3c.dom.Document getApplicationDoc()
          Returns the Document of the application.xml file.
 java.io.InputStream getApplicationInputStream()
          Returns the InputStream of the application.xml file.
 java.util.Iterator getClients()
          Returns the Iterator of WebApp contained in this Application.
 java.util.Map getDescriptors()
          Returns a Map of name to Document for each modified Descriptor of the archive.
 java.net.URLClassLoader getEARClassLoader()
          Returns the ClassLoader of this ear archive.
 java.net.URLClassLoader getEJBClassLoader()
          Returns the ClassLoader of the ejbs within this archive.
 java.util.Iterator getEjbJars()
          Returns the Iterator of EjbJar contained in this Application.
 java.lang.String getName()
          Returns the name of the Archive.
 java.util.Iterator getWebApps()
          Returns the Iterator of WebApp contained in this Application.
protected  void init()
          Initialize the Application.
protected  void loadDescriptors()
          Load Deployment Descriptor of an Application.
 boolean omit(java.lang.String name)
          Returns true if filename must be omitted in the archive.
 
Methods inherited from class org.objectweb.jonas_ws.wsgen.archive.J2EEArchive
addDirectory, addDirectoryIn, addFile, addFile, addFileIn, getContainedFiles, getInputStream, getManifest, getRootFile, isPacked
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clients

protected java.util.List clients
list of embded clients archive.


webapps

protected java.util.List webapps
list of embded webapps archive.


ejbjars

protected java.util.List ejbjars
list of embded ejbjars archive.


app

protected org.w3c.dom.Document app
application Descriptor


earCL

protected java.net.URLClassLoader earCL
Common ClassLoader for Application


ejbCL

protected java.net.URLClassLoader ejbCL
EJB Jar ClassLoader


commonCL

protected java.net.URLClassLoader commonCL
Common Libs ClassLoader


pathFiles

protected java.util.List pathFiles
libs path File

Constructor Detail

Application

public Application(Archive archive)
            throws WsGenException
Creates a new Application archive.

Parameters:
archive - the file containing the application archive.
Throws:
WsGenException - When Init fails
Method Detail

init

protected void init()
             throws WsGenException
Initialize the Application. Creates modules lists, unpack if not unpacked.

Throws:
WsGenException - When application unpack fails or when Decriptors cannot be parsed or found.

loadDescriptors

protected void loadDescriptors()
                        throws WsGenException
Load Deployment Descriptor of an Application.

Throws:
WsGenException - When parsing of application.xml fails

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()

getApplicationDoc

public org.w3c.dom.Document getApplicationDoc()
Returns the Document of the application.xml file.

Returns:
the Document of the application.xml file.

getApplicationInputStream

public java.io.InputStream getApplicationInputStream()
                                              throws java.io.IOException
Returns the InputStream of the application.xml file.

Returns:
the InputStream of the application.xml file.
Throws:
java.io.IOException - When InputStream of application.xml cannot be returned

addEjbJar

public void addEjbJar(EjbJar ejbjar)
Add a new EjbJar in the Application.

Parameters:
ejbjar - the added EjbJar

addClient

public void addClient(Client client)
Add a new Client in the Application.

Parameters:
client - the added Client

addWebApp

public void addWebApp(WebApp webapp,
                      java.lang.String context)
Add a new WebApp in the Application.

Parameters:
webapp - the added webapp
context - context of the webapp

getEjbJars

public java.util.Iterator getEjbJars()
Returns the Iterator of EjbJar contained in this Application.

Returns:
the Iterator of EjbJar contained in this Application.

getWebApps

public java.util.Iterator getWebApps()
Returns the Iterator of WebApp contained in this Application.

Returns:
the Iterator of WebApp contained in this Application.

getClients

public java.util.Iterator getClients()
Returns the Iterator of WebApp contained in this Application.

Returns:
the Iterator of WebApp contained in this Application.

getEARClassLoader

public java.net.URLClassLoader getEARClassLoader()
Returns the ClassLoader of this ear archive.

Returns:
the ClassLoader of this ear archive.

getEJBClassLoader

public java.net.URLClassLoader getEJBClassLoader()
Returns the ClassLoader of the ejbs within this archive.

Returns:
the ClassLoader of the ejbs within this archive.

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.