Oracle Fusion Middleware
Oracle WebLogic Server API Reference
12c Release 1 (12.1.1)

Part Number E24391-02

weblogic.deploy.api.tools
Class SessionHelper

java.lang.Object
  extended by weblogic.deploy.api.tools.SessionHelper

public class SessionHelper
extends Object

Convenience methods for deployment tools based on the javax.enterprise.deploy package.


Method Summary
 void close()
          Closes resources associated with the current DeployableObject and DeploymentConfiguration.
 File getApplication()
          The application archive.
 File getApplicationRoot()
          Root directory potentially containing "app" and "plan" subdirectories as default locations for application files and deployment plan information.
 WebLogicDeploymentConfiguration getConfiguration()
          The current configuration.
 TargetModuleID[] getDefaultJMSTargetModuleIDs(DomainMBean domain, TargetMBean[] deploymentTargets, String appName, String name)
          Creates TargetModuleID objects for a JMS module contained withing this application.
 WebLogicDeployableObject getDeployableObject()
          The root deployable object.
static WebLogicDeploymentManager getDeploymentManager(String host, String port)
          Allocate a connected DeploymentManager.
static WebLogicDeploymentManager getDeploymentManager(String host, String port, String userName, String password)
          Allocate a connected DeploymentManager.
static WebLogicDeploymentManager getDeploymentManager(String protocol, String host, String port, String userName, String password)
          Allocate a connected DeploymentManager.
static WebLogicDeploymentManager getDisconnectedDeploymentManager()
          Allocate a disconnected DeploymentManager.
static SessionHelper getInstance(WebLogicDeploymentManager dm)
          get a SessionHelper for a DeploymentManager
 ModuleInfo getModuleInfo()
          Collects module information based on an application's structure configuration.
 File getPlan()
          The deployment plan.
 File getPlandir()
          Override of external descriptors location
static WebLogicDeploymentManager getRemoteDeploymentManager(String host, String port, String userName, String password)
          Allocate a connected DeploymentManager.
static WebLogicDeploymentManager getRemoteDeploymentManager(String protocol, String host, String port, String userName, String password)
          Allocate a connected DeploymentManager.
 Target getTarget(TargetMBean target)
          Given a TargetMBean, returns a jsr88 Target object
 void initializeConfiguration()
          Populates the configuration based on current values of this object's properties.
 void inspect()
          Creates DeployableObject's for the application without parsing most deployment descriptors.
 boolean isFullInit()
          Indicates whether SessionHelper.initializeConfiguration() should perform a full initialization of the session.
 boolean isUpdatePlanVersion()
          Indicates whether the plan version should be updated automatically prior to saving a new plan.
 void saveApplicationRoot()
          Saves all application artifacts, using a new app root structure.
 void savePlan()
          Saves new copy of deployment plan along with any external documents in the plan directory.
 void setApplication(File application)
          Establishes location of the application.
 void setApplicationRoot(File root)
          Establishes installation root for the application and plan information.
 void setFullInit(boolean fullInit)
          Specifies the amount of work involved in SessionHelper.initializeConfiguration().
 void setPlan(File plan)
          Establishes location of the deployment plan.
 void setPlandir(File plandir)
          Override the plan directory implied by the application root or plan
 void setUpdatePlanVersion(boolean updatePlanVersion)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

close

public void close()
Closes resources associated with the current DeployableObject and DeploymentConfiguration. Any further reference to these will have indeterminate results. It is recommended this method be invoked when done with configuration, otherwise the application archives will remain in an opened state.

The DeploymentManager is left alone. To release its resources WebLogicDeploymentManager.release() should be invoked.


getApplication

public File getApplication()
The application archive. May be an archived file or directory.

Returns:
location of application archive

setApplication

public void setApplication(File application)
Establishes location of the application. May implicitly establish location of application install root directory and deployment plan if parent directory is "app".

Parameters:
application - specifies the location of the applications files.

getPlan

public File getPlan()
The deployment plan.

Returns:
location of deployment plan.

setPlan

public void setPlan(File plan)
Establishes location of the deployment plan. May implicitly establish location of application install root directory if parent directory is "plan".

Parameters:
plan - specifies the location of the deployment plan.

getPlandir

public File getPlandir()
Override of external descriptors location


setPlandir

public void setPlandir(File plandir)
Override the plan directory implied by the application root or plan

Parameters:
plandir -

getApplicationRoot

public File getApplicationRoot()
Root directory potentially containing "app" and "plan" subdirectories as default locations for application files and deployment plan information.

Returns:
installation root directory for the application artifacts

setApplicationRoot

public void setApplicationRoot(File root)
Establishes installation root for the application and plan information. May implicitly establish locations for the archive and deployment plan.

Parameters:
root - is application installation root directory.

isFullInit

public boolean isFullInit()
Indicates whether SessionHelper.initializeConfiguration() should perform a full initialization of the session. A full initialization involves filling out all DConfigBeans for the application configuration. The alternative is for SessionHelper.initializeConfiguration() to only access the root elements. This is much faster for large applications. The default is true.


setFullInit

public void setFullInit(boolean fullInit)
Specifies the amount of work involved in SessionHelper.initializeConfiguration(). This should be set to true (the default) if the goal is to look up and update individual elements in the configuration descriptors. If the goal is to build a plan template, then this should be set to false.

Parameters:
fullInit -

isUpdatePlanVersion

public boolean isUpdatePlanVersion()
Indicates whether the plan version should be updated automatically prior to saving a new plan. This will only work if the plan's current version is either null (no version) or in a float format (eg 1.0)


setUpdatePlanVersion

public void setUpdatePlanVersion(boolean updatePlanVersion)

getInstance

public static SessionHelper getInstance(WebLogicDeploymentManager dm)
get a SessionHelper for a DeploymentManager


getDisconnectedDeploymentManager

public static WebLogicDeploymentManager getDisconnectedDeploymentManager()
                                                                  throws DeploymentManagerCreationException
Allocate a disconnected DeploymentManager. The session will not be able to request any deployment operations.

Throws:
DeploymentManagerCreationException

getDeploymentManager

public static WebLogicDeploymentManager getDeploymentManager(String protocol,
                                                             String host,
                                                             String port,
                                                             String userName,
                                                             String password)
                                                      throws DeploymentManagerCreationException
Allocate a connected DeploymentManager. The session will be able to request deployment operations. The session is assumed to be local to the admin server.

Throws:
DeploymentManagerCreationException

getDeploymentManager

public static WebLogicDeploymentManager getDeploymentManager(String host,
                                                             String port,
                                                             String userName,
                                                             String password)
                                                      throws DeploymentManagerCreationException
Allocate a connected DeploymentManager. The session will be able to request deployment operations. The session is assumed to be local to the admin server.

Throws:
DeploymentManagerCreationException

getRemoteDeploymentManager

public static WebLogicDeploymentManager getRemoteDeploymentManager(String host,
                                                                   String port,
                                                                   String userName,
                                                                   String password)
                                                            throws DeploymentManagerCreationException
Allocate a connected DeploymentManager. The session will be able to request deployment operations. The session is assumed to be remote to the admin server.

Throws:
DeploymentManagerCreationException

getRemoteDeploymentManager

public static WebLogicDeploymentManager getRemoteDeploymentManager(String protocol,
                                                                   String host,
                                                                   String port,
                                                                   String userName,
                                                                   String password)
                                                            throws DeploymentManagerCreationException
Allocate a connected DeploymentManager. The session will be able to request deployment operations. The session is assumed to be remote to the admin server.

Throws:
DeploymentManagerCreationException

getDeploymentManager

public static WebLogicDeploymentManager getDeploymentManager(String host,
                                                             String port)
                                                      throws DeploymentManagerCreationException
Allocate a connected DeploymentManager. The session will be able to request deployment operations. The session is assumed to already have set up a context with the admin server.

Throws:
DeploymentManagerCreationException

getDeployableObject

public WebLogicDeployableObject getDeployableObject()
The root deployable object. initializeConfiguration must be invoked prior to this method.


getConfiguration

public WebLogicDeploymentConfiguration getConfiguration()
The current configuration. initializeConfiguration must be invoked prior to this method.


initializeConfiguration

public void initializeConfiguration()
                             throws ConfigurationException,
                                    IOException,
                                    InvalidModuleException
Populates the configuration based on current values of this object's properties.

Throws:
ConfigurationException
IOException
InvalidModuleException

inspect

public void inspect()
             throws IOException,
                    InvalidModuleException,
                    ConfigurationException
Creates DeployableObject's for the application without parsing most deployment descriptors. Hence some descriptor problems may not be detected until they are first accessed through WebLogicDeployableObject.getDDBeanRoot().

Throws:
IOException
InvalidModuleException
ConfigurationException

getModuleInfo

public ModuleInfo getModuleInfo()
                         throws IOException,
                                ConfigurationException
Collects module information based on an application's structure configuration.

Returns:
Hierarchical objects matching the application structure.
Throws:
IOException
ConfigurationException

savePlan

public void savePlan()
              throws IllegalStateException,
                     ConfigurationException,
                     FileNotFoundException
Saves new copy of deployment plan along with any external documents in the plan directory. The new plan is saved to the location specified by SessionHelper.getPlan(). The plan directory is specified in the plan itself.

Throws:
IllegalStateException - if SessionHelper.initializeConfiguration() has not been invoked
ConfigurationException - if there are problems with the application descriptors
FileNotFoundException - if the current plan is a directory

saveApplicationRoot

public void saveApplicationRoot()
                         throws IOException,
                                ConfigurationException,
                                IllegalStateException
Saves all application artifacts, using a new app root structure. This updates all associated properties accordingly, placing all artifacts under the root directory specified in SessionHelper.getApplicationRoot().

Throws:
IOException - for any IO errors
ConfigurationException - if there are problems with the application descriptors
IllegalStateException - if SessionHelper.initializeConfiguration() has not been invoked

getDefaultJMSTargetModuleIDs

public TargetModuleID[] getDefaultJMSTargetModuleIDs(DomainMBean domain,
                                                     TargetMBean[] deploymentTargets,
                                                     String appName,
                                                     String name)
                                              throws ConfigurationException
Creates TargetModuleID objects for a JMS module contained withing this application. The objects returned provide for default JMS submodule targeting only. When deploying the application, these object can be included with the application level TargetModuleID objects. The session must have been initialized prior to using this method.

Parameters:
domain - is the DomainMBean providing access to the domian configuration
deploymentTargets - is a list of targets where the application is to be deployed
appName - is the name the application will be deployed under
name - is the name of the JMS module, eg my-jms.xml. For a standalone JMS module this is the module's filename. For an embedded JMS module, the name must match the name assigned to the module in the weblogic-application.xml descriptor.
Returns:
JMS module targeting objects, or null if not relevant. This would be the case if the application already has targeting setup for the JMS submodules, or if there is no JMS module with the provided name in the application.
Throws:
ConfigurationException

getTarget

public Target getTarget(TargetMBean target)
Given a TargetMBean, returns a jsr88 Target object


Copyright 1996, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Oracle WebLogic Server API Reference
12c Release 1 (12.1.1)

Part Number E24391-02