org.objectweb.jonas_lib.genbase.archive
Class EjbJar

java.lang.Object
  extended by org.objectweb.jonas_lib.genbase.archive.J2EEArchive
      extended by org.objectweb.jonas_lib.genbase.archive.EjbJar
All Implemented Interfaces:
Archive, WsEndpoint

public class EjbJar
extends J2EEArchive
implements WsEndpoint

EjbJar represents an EjbJar J2EE Archive.

Author:
Guillaume Sauthier

Constructor Summary
EjbJar(Archive archive)
          Create a new EjbJar not contained in Application
EjbJar(Archive archive, Application app)
          Create a new EjbJar contained in Application
 
Method Summary
 void addClasses(java.io.File classes)
          Add *.class from directory in the archive.
 Application getApplication()
          Return the container application of this EjbJar
 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 getEjbs()
          Returns the List of Ejb contained in this EjbJar.
 org.w3c.dom.Document getJonasEjbJarDoc()
          Returns the Document of the jonas-ejb-jar.xml file.
 java.io.InputStream getJonasEjbJarInputStream()
          Returns the InputStream of the jonas-ejb-jar.xml file.
 org.w3c.dom.Document getJonasWebservicesDoc()
          Return the Document of the the jonas-webservices.xml
 java.io.InputStream getJonasWebservicesInputStream()
          Returns the InputStream of the jonas-webservices.xml file.
 java.util.List getServiceDescs()
          Returns the list of webservice-description elements contained by a module.
 java.lang.String getWarName()
           
 void initialize()
          Initialize the Archive.
 boolean omit(java.lang.String name)
          Returns true if filename must be omitted in the archive.
 void setApplication(Application app)
          Set the container application of this EjbJar
 
Methods inherited from class org.objectweb.jonas_lib.genbase.archive.J2EEArchive
addDirectory, addDirectoryIn, addFile, addFile, addFileIn, close, getArchive, getContainedFiles, getI18n, getInputStream, getLogger, getManifest, getModuleClassloader, getName, 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

EjbJar

public EjbJar(Archive archive)
       throws GenBaseException
Create a new EjbJar not contained in Application

Parameters:
archive - the archive file
Throws:
GenBaseException - When init fails

EjbJar

public EjbJar(Archive archive,
              Application app)
       throws GenBaseException
Create a new EjbJar contained in Application

Parameters:
archive - the archive file
app - container application
Throws:
GenBaseException - When init fails
Method Detail

initialize

public void initialize()
                throws GenBaseException
Initialize the Archive.

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

getEjbs

public java.util.List getEjbs()
Returns the List of Ejb contained in this EjbJar.

Returns:
the List of Ejb contained in this EjbJar.

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 *.class from directory in the archive.

Parameters:
classes - directory containing classes files.

getWarName

public java.lang.String getWarName()
Returns:
Returns the desired war filename (jonas-webservices/war)

getContextRoot

public java.lang.String getContextRoot()
Specified by:
getContextRoot in interface WsEndpoint
Returns:
Returns the desired context-root (jonas-webservices/context-root)

setApplication

public void setApplication(Application app)
Set the container application of this EjbJar

Parameters:
app - container application

getApplication

public Application getApplication()
Return the container application of this EjbJar

Returns:
the container application of this EjbJar

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.

getJonasEjbJarDoc

public org.w3c.dom.Document getJonasEjbJarDoc()
Returns the Document of the jonas-ejb-jar.xml file.

Returns:
the Document of the jonas-ejb-jar.xml file.

getJonasWebservicesDoc

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

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

getJonasEjbJarInputStream

public java.io.InputStream getJonasEjbJarInputStream()
                                              throws java.io.IOException
Returns the InputStream of the jonas-ejb-jar.xml file.

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

getJonasWebservicesInputStream

public java.io.InputStream getJonasWebservicesInputStream()
                                                   throws java.io.IOException
Returns the InputStream of the jonas-webservices.xml file.

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