BEA Systems, Inc.

weblogic.deploy.api.model
Class WebLogicDeployableObject

java.lang.Object
  extended by weblogic.deploy.api.model.WebLogicDeployableObject
All Implemented Interfaces:
DeployableObject, weblogic.deploy.api.internal.Closable
Direct Known Subclasses:
WebLogicJ2eeApplicationObject

public class WebLogicDeployableObject
extends Object
implements DeployableObject, weblogic.deploy.api.internal.Closable

This class is the WebLogic Server implementation of DeployableObject.

WebLogicDeployableObject encapsulates a single module for deployment purposes. A deployment tool uses the constructors for this class to present an application module to the deployer. When the tool is done with this object it is highly recommended that it be formally closed (see WebLogicDeployableObject.close() ). This ensures resources are closed and removes any temporary files that may have been created.

Applications can be part of a parent installation directory. This directory structure has the following organization:

 
 install-root (eg myapp)
 -- app
 ----- archive (eg myapp.ear)
 -- plan
 ----- deployment plan (eg plan.xml)
 ----- external descriptors (eg META-INF/weblogic-application.xml ...)
 
 


Nested Class Summary
protected  class WebLogicDeployableObject.DDRootFields
           
 
Field Summary
protected  weblogic.deploy.api.internal.utils.ClassLoaderControl clf
           
protected  String contextRoot
           
protected  WebLogicDeployableObject.DDRootFields ddRoot
           
protected  boolean deleteOnClose
           
protected  boolean haveAppRoot
          indicates whether user provided an app root
protected  weblogic.deploy.api.internal.utils.LibrarySpec[] libraries
           
protected  File plan
           
protected  weblogic.j2ee.descriptor.wl.DeploymentPlanBean planBean
           
protected  File plandir
           
protected  weblogic.utils.classloaders.ClassFinder resourceFinder
           
protected  String uri
          for embedded modules, this is uri to their root
 
Constructor Summary
protected WebLogicDeployableObject(File module, ModuleType moduleType, WebLogicJ2eeApplicationObject parent, String uri, String altdd, File installDir, File plan, File plandir)
           
 
Method Summary
 void addRootBean(String uriArg, weblogic.descriptor.DescriptorBean db, ModuleType mt)
           
 void close()
          Closes application resources and removes temporary files.
protected  void closeGCL()
           
protected  void closeResourceFinder()
           
protected  void closeVJF()
           
static WebLogicDeployableObject createDeployableObject(File app)
          Deprecated. since WLS 9.2.
static WebLogicDeployableObject createDeployableObject(File app, File appRoot)
          Deprecated. since WLS 9.2.
static WebLogicDeployableObject createDeployableObject(File app, File appRoot, File plan, File plandir, weblogic.deploy.api.internal.utils.LibrarySpec[] libraries)
          Deprecated. since WLS 9.2.
static WebLogicDeployableObject createLazyDeployableObject(File app, File appRoot)
          Deprecated. since WLS 9.2.
 Enumeration entries()
          Returns an enumeration of the module file entries.
 DDBean[] getChildBean(String xpath)
          Returns DDBeans based on the specified xpath expression, relative to the root element of the primary descriptor of this DeployableObject.
 Class getClassFromScope(String className)
          Returns the Class object from this module for the named class, or null if there is no class.
 String getContextRoot()
           
 DDBeanRoot getDDBeanRoot()
          Returns the root DDBean for this module.
 DDBeanRoot getDDBeanRoot(String filename)
          Returns a DDBeanRoot object for the named XML instance document.
 DDBeanRoot[] getDDBeanRoots()
          List of DDBeanRoot objects representing all of the known deployment descriptors for this module
protected  InputStream getDDStream(String altdd, ModuleType moduleType)
           
 weblogic.descriptor.DescriptorBean getDescriptorBean()
          Typed descriptor bean tree for this modules standard descriptor.
 InputStream getEntry(String name)
          Returns an InputStream for the given entry name.
 weblogic.deploy.api.internal.utils.LibrarySpec[] getLibraries()
           
 String getModuleDTDVersion()
          Deprecated. As of version 1.1, replaced by DDBeanRoot.getDDBeanRootVersion()
 WebLogicJ2eeApplicationObject getParent()
           
 File getPlan()
           
 weblogic.j2ee.descriptor.wl.DeploymentPlanBean getPlanBean()
           
 File getPlandir()
           
 weblogic.utils.classloaders.ClassFinder getResourceFinder()
           
protected  InputStream getStreamFromParent(String uri, String name)
           
 String[] getText(String xpath)
          Returns XML content for each matching element in this module's descriptor.
 ModuleType getType()
          Returns the ModuleType of the deployment descriptor (for example, the EAR, JAR, WAR, or RAR) that this DeployableObject represents.
 void setContextRoot(String contextRoot)
           
protected  void setDDBeanRoot(DDBeanRoot root)
           
protected  void setLibraries(weblogic.deploy.api.internal.utils.LibrarySpec[] libraries)
           
protected  void setPlan(File plan)
           
protected  void setPlanDir(File plandir)
           
 void setResourceFinder(weblogic.utils.classloaders.ClassFinder finder)
           
protected  void setupDDBeanRoot(weblogic.deploy.api.model.internal.DDBeanRootImpl root)
           
protected  void setUri(String u)
           
 String toString()
          Returns a String representation of the module type and archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

uri

protected String uri
for embedded modules, this is uri to their root


haveAppRoot

protected boolean haveAppRoot
indicates whether user provided an app root


ddRoot

protected WebLogicDeployableObject.DDRootFields ddRoot

clf

protected weblogic.deploy.api.internal.utils.ClassLoaderControl clf

plan

protected File plan

plandir

protected File plandir

planBean

protected weblogic.j2ee.descriptor.wl.DeploymentPlanBean planBean

libraries

protected weblogic.deploy.api.internal.utils.LibrarySpec[] libraries

deleteOnClose

protected boolean deleteOnClose

resourceFinder

protected weblogic.utils.classloaders.ClassFinder resourceFinder

contextRoot

protected String contextRoot
Constructor Detail

WebLogicDeployableObject

protected WebLogicDeployableObject(File module,
                                   ModuleType moduleType,
                                   WebLogicJ2eeApplicationObject parent,
                                   String uri,
                                   String altdd,
                                   File installDir,
                                   File plan,
                                   File plandir)
                            throws IOException
Throws:
IOException
Method Detail

setLibraries

protected void setLibraries(weblogic.deploy.api.internal.utils.LibrarySpec[] libraries)

getPlandir

public File getPlandir()

getPlan

public File getPlan()

getPlanBean

public weblogic.j2ee.descriptor.wl.DeploymentPlanBean getPlanBean()
                                                           throws IOException
Throws:
IOException

addRootBean

public void addRootBean(String uriArg,
                        weblogic.descriptor.DescriptorBean db,
                        ModuleType mt)

setPlanDir

protected void setPlanDir(File plandir)

setPlan

protected void setPlan(File plan)

setupDDBeanRoot

protected void setupDDBeanRoot(weblogic.deploy.api.model.internal.DDBeanRootImpl root)
                        throws IOException,
                               InvalidModuleException
Throws:
IOException
InvalidModuleException

getDDStream

protected InputStream getDDStream(String altdd,
                                  ModuleType moduleType)
                           throws FileNotFoundException
Throws:
FileNotFoundException

getType

public ModuleType getType()
Returns the ModuleType of the deployment descriptor (for example, the EAR, JAR, WAR, or RAR) that this DeployableObject represents.

Specified by:
getType in interface DeployableObject

getChildBean

public DDBean[] getChildBean(String xpath)
Returns DDBeans based on the specified xpath expression, relative to the root element of the primary descriptor of this DeployableObject. Returns null if no DDBeans match the xpath expression.

Specified by:
getChildBean in interface DeployableObject

getClassFromScope

public Class getClassFromScope(String className)
Returns the Class object from this module for the named class, or null if there is no class. The scope is the module itself. This method honors the aplication's manifest class path. For EARs, this provides access to the application level classes only.

Specified by:
getClassFromScope in interface DeployableObject

getDDBeanRoot

public DDBeanRoot getDDBeanRoot()
Returns the root DDBean for this module. If this object was created through SessionHelper.inspect() then it may throw an unchecked RuntimeException indicating parse failures

Specified by:
getDDBeanRoot in interface DeployableObject

setDDBeanRoot

protected void setDDBeanRoot(DDBeanRoot root)

getText

public String[] getText(String xpath)
Returns XML content for each matching element in this module's descriptor.

Specified by:
getText in interface DeployableObject
Parameters:
xpath - Is an xpath expression relative to root element of this module.

getDDBeanRoot

public DDBeanRoot getDDBeanRoot(String filename)
                         throws FileNotFoundException,
                                javax.enterprise.deploy.model.exceptions.DDBeanCreateException
Returns a DDBeanRoot object for the named XML instance document. Use this method to return DDBeanRoot objects for secondary deployment descriptor XML instance documents, such as WSDL files or weblogic-cmp-jar.xml. The file may be in either the archive or in the external configuration directory (install-root/plan).

The descriptor will be parsed and a full tree of DDBean's are created.

Specified by:
getDDBeanRoot in interface DeployableObject
Parameters:
filename - The full path name of the XML instance document to return, specified from the root of the module. The path must be either relative to the root of this module, or in the same relative location in the module's external configuration directory.
Returns:
A DDBeanRoot object for the XML data.
Throws:
FileNotFoundException - If the named file cannot be found
javax.enterprise.deploy.model.exceptions.DDBeanCreateException - If an error is encountered while creating the DDBeanRoot object.

entries

public Enumeration entries()
Returns an enumeration of the module file entries. All elements in the enumeration are of type String. Each String in the returned enumeration represents a file name relative to the root of the module.

Specified by:
entries in interface DeployableObject
Returns:
An enumeration of the archive file entries. An empty enumeration is returned if any IO errors occur.

getEntry

public InputStream getEntry(String name)
Returns an InputStream for the given entry name. The file name must be relative to the root of the module.

Specified by:
getEntry in interface DeployableObject
Parameters:
name - The file name relative to the root of the module.
Returns:
The InputStream for the given entry name, or null if not found.

getStreamFromParent

protected InputStream getStreamFromParent(String uri,
                                          String name)
                                   throws IOException
Throws:
IOException

getModuleDTDVersion

public String getModuleDTDVersion()
Deprecated. As of version 1.1, replaced by DDBeanRoot.getDDBeanRootVersion()

A convenience method to return the deployment descriptor document version number of the primary deployment descriptor for this module (for example, web.xml, ejb-jar.xml, ra.xml, application.xml, or application-client.xml.) This method does not return the version number for documents such as webservices.xml and webservicesclient.xml; use DDBeanRoot.getDDBeanRootVersion instead. This method is deprecated. Use DDBeanRoot.getDDBeanRootVersion instead.

Specified by:
getModuleDTDVersion in interface DeployableObject
Returns:
A string that describes the version number of the XML instance document. Null is returned if no version number was found.

getDescriptorBean

public weblogic.descriptor.DescriptorBean getDescriptorBean()
                                                     throws IOException
Typed descriptor bean tree for this modules standard descriptor.

Throws:
IOException

createDeployableObject

public static WebLogicDeployableObject createDeployableObject(File app)
                                                       throws InvalidModuleException,
                                                              IOException
Deprecated. since WLS 9.2.

Create a DeployableObject for an application. The object returned implements a DeployableObject, or J2eeApplicationObject if the application is an EAR. This factory method is intended for use when the application is not contained within an installation root directory.

Parameters:
app - is the archive or root directory of the application.
Throws:
InvalidModuleException
IOException

createDeployableObject

public static WebLogicDeployableObject createDeployableObject(File app,
                                                              File appRoot)
                                                       throws InvalidModuleException,
                                                              IOException
Deprecated. since WLS 9.2.

Create a DeployableObject for an application. The object returned implements a DeployableObject, or J2eeApplicationObject if the application is an EAR.

Parameters:
app - is the archive or root directory of the application.
appRoot - is application's installation root directory.
Throws:
InvalidModuleException
IOException

createDeployableObject

public static WebLogicDeployableObject createDeployableObject(File app,
                                                              File appRoot,
                                                              File plan,
                                                              File plandir,
                                                              weblogic.deploy.api.internal.utils.LibrarySpec[] libraries)
                                                       throws IOException,
                                                              InvalidModuleException,
                                                              ConfigurationException
Deprecated. since WLS 9.2.

Create a DeployableObject for an application. The object returned implements a DeployableObject, or J2eeApplicationObject if the application is an EAR.

Parameters:
app - is the archive or root directory of the application.
appRoot - is application's installation root directory. May be null.
plan - is the deployment plan to use for this session. May be null.
plandir - is the plan directory to use for this session. If null the plan directory is derived from the plan or app root provided.
libraries - is a collection of library references to merge with the app. This argument allows for the presence of multiple directories and plans to be associated with the app. If null then no attempt will be made to merge.
Throws:
IOException
InvalidModuleException
ConfigurationException

getLibraries

public weblogic.deploy.api.internal.utils.LibrarySpec[] getLibraries()

createLazyDeployableObject

public static WebLogicDeployableObject createLazyDeployableObject(File app,
                                                                  File appRoot)
                                                           throws InvalidModuleException,
                                                                  IOException
Deprecated. since WLS 9.2.

This method is deprecated.

Throws:
InvalidModuleException
IOException

toString

public String toString()
Returns a String representation of the module type and archive.

Overrides:
toString in class Object

getDDBeanRoots

public DDBeanRoot[] getDDBeanRoots()
List of DDBeanRoot objects representing all of the known deployment descriptors for this module


getParent

public WebLogicJ2eeApplicationObject getParent()

setUri

protected void setUri(String u)

close

public void close()
Closes application resources and removes temporary files.

Specified by:
close in interface weblogic.deploy.api.internal.Closable

closeGCL

protected void closeGCL()

closeResourceFinder

protected void closeResourceFinder()

closeVJF

protected void closeVJF()

setResourceFinder

public void setResourceFinder(weblogic.utils.classloaders.ClassFinder finder)

getResourceFinder

public weblogic.utils.classloaders.ClassFinder getResourceFinder()

getContextRoot

public String getContextRoot()

setContextRoot

public void setContextRoot(String contextRoot)

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs92
Copyright 2006 BEA Systems Inc.