org.objectweb.dolphin.resources.deploy.model
Class AbstractDeployable

java.lang.Object
  extended byorg.objectweb.dolphin.resources.deploy.model.AbstractDeployable
All Implemented Interfaces:
javax.enterprise.deploy.model.DeployableObject
Direct Known Subclasses:
EarDeployable, RarDeployable, SimpleDeployable

public class AbstractDeployable
extends java.lang.Object
implements javax.enterprise.deploy.model.DeployableObject

Used to handle deployable objects at deployment.

Author:
markus

Nested Class Summary
static class AbstractDeployable.UnknownModuleTypeException
          Indicates that the ModuleType could not be guessed.
 
Method Summary
static void copyInputStreamToFile(java.io.InputStream inputStream, java.io.File outputFile)
          Copies the content of an InputStream into the given file.
static javax.enterprise.deploy.model.DeployableObject createFromFile(java.io.File archive)
          Loads a DeployableObject from a file.
static javax.enterprise.deploy.model.DeployableObject createFromUrl(java.net.URL url)
          Creates a deployable object from the module archive given as a URL.
 java.util.Enumeration entries()
           
 javax.enterprise.deploy.model.DDBean[] getChildBean(java.lang.String xpath)
           
 java.lang.Class getClassFromScope(java.lang.String className)
           
 javax.enterprise.deploy.model.DDBeanRoot getDDBeanRoot()
           
 javax.enterprise.deploy.model.DDBeanRoot getDDBeanRoot(java.lang.String arg0)
           
 java.io.InputStream getEntry(java.lang.String arg0)
           
 java.lang.String getModuleDTDVersion()
           
 java.lang.String[] getText(java.lang.String xpath)
           
 javax.enterprise.deploy.shared.ModuleType getType()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDDBeanRoot

public javax.enterprise.deploy.model.DDBeanRoot getDDBeanRoot()
Specified by:
getDDBeanRoot in interface javax.enterprise.deploy.model.DeployableObject
See Also:
DeployableObject.getDDBeanRoot()

getChildBean

public javax.enterprise.deploy.model.DDBean[] getChildBean(java.lang.String xpath)
Specified by:
getChildBean in interface javax.enterprise.deploy.model.DeployableObject
See Also:
DeployableObject.getChildBean(java.lang.String)

getText

public java.lang.String[] getText(java.lang.String xpath)
Specified by:
getText in interface javax.enterprise.deploy.model.DeployableObject
See Also:
DeployableObject.getText(java.lang.String)

getClassFromScope

public java.lang.Class getClassFromScope(java.lang.String className)
Specified by:
getClassFromScope in interface javax.enterprise.deploy.model.DeployableObject
See Also:
DeployableObject.getClassFromScope(java.lang.String)

getModuleDTDVersion

public java.lang.String getModuleDTDVersion()
Specified by:
getModuleDTDVersion in interface javax.enterprise.deploy.model.DeployableObject
See Also:
DeployableObject.getModuleDTDVersion()

getType

public javax.enterprise.deploy.shared.ModuleType getType()
Specified by:
getType in interface javax.enterprise.deploy.model.DeployableObject
See Also:
DeployableObject.getType()

createFromFile

public static javax.enterprise.deploy.model.DeployableObject createFromFile(java.io.File archive)
                                                                     throws AbstractDeployable.UnknownModuleTypeException,
                                                                            javax.xml.parsers.ParserConfigurationException,
                                                                            java.io.IOException,
                                                                            org.xml.sax.SAXException
Loads a DeployableObject from a file.

Parameters:
archive -
Returns:
DeployableObject
Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
AbstractDeployable.UnknownModuleTypeException

createFromUrl

public static javax.enterprise.deploy.model.DeployableObject createFromUrl(java.net.URL url)
                                                                    throws java.io.IOException,
                                                                           javax.xml.parsers.ParserConfigurationException,
                                                                           org.xml.sax.SAXException,
                                                                           AbstractDeployable.UnknownModuleTypeException
Creates a deployable object from the module archive given as a URL.

Parameters:
url - Specifies the module archive.
Returns:
In-Memory-Representation of the deployable module found in the module.
Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
AbstractDeployable.UnknownModuleTypeException

copyInputStreamToFile

public static void copyInputStreamToFile(java.io.InputStream inputStream,
                                         java.io.File outputFile)
                                  throws java.io.FileNotFoundException,
                                         java.io.IOException
Copies the content of an InputStream into the given file.

Parameters:
inputStream - InputStream where to read from.
outputFile - OutputStream where to write to.
Throws:
java.io.FileNotFoundException - when the output file is not existing.
java.io.IOException - when some IO operating crashed.

getDDBeanRoot

public javax.enterprise.deploy.model.DDBeanRoot getDDBeanRoot(java.lang.String arg0)
                                                       throws java.io.FileNotFoundException,
                                                              javax.enterprise.deploy.model.exceptions.DDBeanCreateException
Specified by:
getDDBeanRoot in interface javax.enterprise.deploy.model.DeployableObject
Throws:
java.io.FileNotFoundException
javax.enterprise.deploy.model.exceptions.DDBeanCreateException

entries

public java.util.Enumeration entries()
Specified by:
entries in interface javax.enterprise.deploy.model.DeployableObject

getEntry

public java.io.InputStream getEntry(java.lang.String arg0)
Specified by:
getEntry in interface javax.enterprise.deploy.model.DeployableObject