org.ow2.jonas.generators.genbase.archive
Class Application

java.lang.Object
  extended by org.ow2.jonas.generators.genbase.archive.J2EEArchive
      extended by org.ow2.jonas.generators.genbase.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

Constructor Summary
Application(Archive archive, org.ow2.util.ee.deploy.api.deployable.IDeployable deployable)
          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, String context)
          Add a new WebApp in the Application.
 void close()
          Close this archive
 Document getApp()
           
 Document getApplicationDoc()
          Returns the Document of the application.xml file.
 InputStream getApplicationInputStream()
          Returns the InputStream of the application.xml file.
 Iterator getClients()
          Returns the Iterator of WebApp contained in this Application.
 Map getDescriptors()
          Returns a Map of name to Document for each modified Descriptor of the archive.
 URLClassLoader getEARClassLoader()
          Returns the ClassLoader of this ear archive.
 URLClassLoader getEJBClassLoader()
          Returns the ClassLoader of the ejbs within this archive.
 Iterator getEjbJars()
          Returns the Iterator of EjbJar contained in this Application.
 String getName()
          Returns the name of the Archive.
 Iterator getWebApps()
          Returns the Iterator of WebApp contained in this Application.
protected  void init()
          Initialize the Application.
 void initialize()
          Initialize the Archive.
protected  void loadDescriptors()
          Load Deployment Descriptor of an Application.
 boolean omit(String name)
          Returns true if filename must be omitted in the archive.
 void setClients(List clients)
           
 void setEjbjars(List ejbjars)
           
 void setWebapps(List webapps)
           
 
Methods inherited from class org.ow2.jonas.generators.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

Application

public Application(Archive archive,
                   org.ow2.util.ee.deploy.api.deployable.IDeployable deployable)
            throws GenBaseException
Creates a new Application archive.

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

init

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

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

loadDescriptors

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

Throws:
GenBaseException - When parsing of application.xml fails

initialize

public void initialize()
                throws GenBaseException
Initialize the Archive.

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

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

getApplicationDoc

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

Returns:
the Document of the application.xml file.

getApplicationInputStream

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

Returns:
the InputStream of the application.xml file.
Throws:
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,
                      String context)
Add a new WebApp in the Application.

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

getEjbJars

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

Returns:
the Iterator of EjbJar contained in this Application.

getWebApps

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

Returns:
the Iterator of WebApp contained in this Application.

getClients

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

Returns:
the Iterator of WebApp contained in this Application.

getEARClassLoader

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

Returns:
the ClassLoader of this ear archive.

getEJBClassLoader

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

Returns:
the ClassLoader of the ejbs within this archive.

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.

setClients

public void setClients(List clients)
Parameters:
clients - The clients to set.

setEjbjars

public void setEjbjars(List ejbjars)
Parameters:
ejbjars - The ejbjars to set.

setWebapps

public void setWebapps(List webapps)
Parameters:
webapps - The webapps to set.

getApp

public Document getApp()
Returns:
Returns the app.

close

public void close()
Close this archive

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


Copyright © 2010 OW2 Consortium. All Rights Reserved.