org.apache.felix.deploymentadmin.spi

## Class DeploymentSessionImpl

- java.lang.Object
- - org.apache.felix.deploymentadmin.spi.DeploymentSessionImpl

All Implemented Interfaces:
  org.osgi.framework.Constants, org.osgi.service.deploymentadmin.spi.DeploymentSession

    public class DeploymentSessionImpl
    extends Object
    implements org.osgi.service.deploymentadmin.spi.DeploymentSession, Constants

Represents a running deployment session.

### Field Summary

### Fields inherited from interface org.apache.felix.deploymentadmin.Constants

`BUNDLE_LOCATION_PREFIX, BUNDLE_SYMBOLICNAME, BUNDLE_VERSION, CODE_BAD_HEADER, CODE_BUNDLE_NAME_ERROR, CODE_BUNDLE_SHARING_VIOLATION, CODE_CANCELLED, CODE_COMMIT_ERROR, CODE_FOREIGN_CUSTOMIZER, CODE_MISSING_BUNDLE, CODE_MISSING_FIXPACK_TARGET, CODE_MISSING_HEADER, CODE_MISSING_RESOURCE, CODE_NOT_A_JAR, CODE_ORDER_ERROR, CODE_OTHER_ERROR, CODE_PROCESSOR_NOT_FOUND, CODE_RESOURCE_SHARING_VIOLATION, CODE_SIGNING_ERROR, CODE_TIMEOUT, DEPLOYMENTPACKAGE_CUSTOMIZER, DEPLOYMENTPACKAGE_FIXPACK, DEPLOYMENTPACKAGE_ICON, DEPLOYMENTPACKAGE_MISSING, DEPLOYMENTPACKAGE_NAME, DEPLOYMENTPACKAGE_SYMBOLICMAME, DEPLOYMENTPACKAGE_VERSION, EVENTPROPERTY_DEPLOYMENTPACKAGE_CURRENTVERSION, EVENTPROPERTY_DEPLOYMENTPACKAGE_NAME, EVENTPROPERTY_DEPLOYMENTPACKAGE_NEXTVERSION, EVENTPROPERTY_DEPLOYMENTPACKAGE_READABLENAME, EVENTPROPERTY_SUCCESSFUL, EVENTTOPIC_COMPLETE, EVENTTOPIC_INSTALL, EVENTTOPIC_UNINSTALL, RESOURCE_PROCESSOR, SERVICE_PID`

### Fields inherited from interface org.osgi.framework.Constants

`ACTIVATION_LAZY, BUNDLE_ACTIVATIONPOLICY, BUNDLE_ACTIVATOR, BUNDLE_CATEGORY, BUNDLE_CLASSPATH, BUNDLE_CONTACTADDRESS, BUNDLE_COPYRIGHT, BUNDLE_DESCRIPTION, BUNDLE_DOCURL, BUNDLE_LOCALIZATION, BUNDLE_LOCALIZATION_DEFAULT_BASENAME, BUNDLE_MANIFESTVERSION, BUNDLE_NAME, BUNDLE_NATIVECODE, BUNDLE_NATIVECODE_LANGUAGE, BUNDLE_NATIVECODE_OSNAME, BUNDLE_NATIVECODE_OSVERSION, BUNDLE_NATIVECODE_PROCESSOR, BUNDLE_REQUIREDEXECUTIONENVIRONMENT, BUNDLE_SYMBOLICNAME_ATTRIBUTE, BUNDLE_UPDATELOCATION, BUNDLE_VENDOR, BUNDLE_VERSION_ATTRIBUTE, DYNAMICIMPORT_PACKAGE, EXCLUDE_DIRECTIVE, EXPORT_PACKAGE, EXPORT_SERVICE, EXTENSION_BOOTCLASSPATH, EXTENSION_DIRECTIVE, EXTENSION_FRAMEWORK, FRAGMENT_ATTACHMENT_ALWAYS, FRAGMENT_ATTACHMENT_DIRECTIVE, FRAGMENT_ATTACHMENT_NEVER, FRAGMENT_ATTACHMENT_RESOLVETIME, FRAGMENT_HOST, FRAMEWORK_BEGINNING_STARTLEVEL, FRAMEWORK_BOOTDELEGATION, FRAMEWORK_BUNDLE_PARENT, FRAMEWORK_BUNDLE_PARENT_APP, FRAMEWORK_BUNDLE_PARENT_BOOT, FRAMEWORK_BUNDLE_PARENT_EXT, FRAMEWORK_BUNDLE_PARENT_FRAMEWORK, FRAMEWORK_EXECPERMISSION, FRAMEWORK_EXECUTIONENVIRONMENT, FRAMEWORK_LANGUAGE, FRAMEWORK_LIBRARY_EXTENSIONS, FRAMEWORK_OS_NAME, FRAMEWORK_OS_VERSION, FRAMEWORK_PROCESSOR, FRAMEWORK_SECURITY, FRAMEWORK_SECURITY_OSGI, FRAMEWORK_STORAGE, FRAMEWORK_STORAGE_CLEAN, FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT, FRAMEWORK_SYSTEMPACKAGES, FRAMEWORK_SYSTEMPACKAGES_EXTRA, FRAMEWORK_TRUST_REPOSITORIES, FRAMEWORK_VENDOR, FRAMEWORK_VERSION, FRAMEWORK_WINDOWSYSTEM, IMPORT_PACKAGE, IMPORT_SERVICE, INCLUDE_DIRECTIVE, MANDATORY_DIRECTIVE, OBJECTCLASS, PACKAGE_SPECIFICATION_VERSION, REQUIRE_BUNDLE, RESOLUTION_DIRECTIVE, RESOLUTION_MANDATORY, RESOLUTION_OPTIONAL, SELECTION_FILTER_ATTRIBUTE, SERVICE_DESCRIPTION, SERVICE_ID, SERVICE_RANKING, SERVICE_VENDOR, SINGLETON_DIRECTIVE, SUPPORTS_BOOTCLASSPATH_EXTENSION, SUPPORTS_FRAMEWORK_EXTENSION, SUPPORTS_FRAMEWORK_FRAGMENT, SUPPORTS_FRAMEWORK_REQUIREBUNDLE, SYSTEM_BUNDLE_LOCATION, SYSTEM_BUNDLE_SYMBOLICNAME, USES_DIRECTIVE, VERSION_ATTRIBUTE, VISIBILITY_DIRECTIVE, VISIBILITY_PRIVATE, VISIBILITY_REEXPORT`

### Constructor Summary

Constructors
Constructor and Description
`DeploymentSessionImpl(AbstractDeploymentPackage source, AbstractDeploymentPackage target, List commands, DeploymentAdminImpl admin, DeploymentAdminConfig config)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `call(boolean ignoreExceptions)` Calling this method will cause the commands specified for this session to be executed.
`boolean` `cancel()` Cancels the session if it is in progress.
`org.osgi.framework.BundleContext` `getBundleContext()` Returns the bundle context of the bundle this class is part of.
`DeploymentAdminConfig` `getConfiguration()`
`File` `getDataFile(org.osgi.framework.Bundle bundle)` Retrieve the base directory of the persistent storage area according to OSGi Core R4 6.1.6.10 for the given `BundleContext`.
`org.osgi.service.log.LogService` `getLog()` Returns the currently present log service.
`org.osgi.service.packageadmin.PackageAdmin` `getPackageAdmin()` Returns the currently present package admin.
`AbstractDeploymentPackage` `getSourceAbstractDeploymentPackage()` Returns the source deployment package as an `AbstractDeploymentPackage`.
`org.osgi.service.deploymentadmin.DeploymentPackage` `getSourceDeploymentPackage()`
`AbstractDeploymentPackage` `getTargetAbstractDeploymentPackage()` Returns the target deployment package as an `AbstractDeploymentPackage`.
`org.osgi.service.deploymentadmin.DeploymentPackage` `getTargetDeploymentPackage()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DeploymentSessionImpl

    public DeploymentSessionImpl(AbstractDeploymentPackage source,
                                 AbstractDeploymentPackage target,
                                 List commands,
                                 DeploymentAdminImpl admin,
                                 DeploymentAdminConfig config)

### Method Detail

#### call

    public void call(boolean ignoreExceptions)
              throws org.osgi.service.deploymentadmin.DeploymentException

Calling this method will cause the commands specified for this session to be executed. the commands will be rolled back if the session is canceled or if an exception is caused by one of the commands.

Throws:
  `org.osgi.service.deploymentadmin.DeploymentException` - If the session was canceled ( `DeploymentException.CODE_CANCELLED`) or if one of the commands caused an exception (`DeploymentException.*`)

#### cancel

    public boolean cancel()

Cancels the session if it is in progress.

Returns:
  true if a session was in progress and now canceled, false otherwise.

#### getBundleContext

    public org.osgi.framework.BundleContext getBundleContext()

Returns the bundle context of the bundle this class is part of.

Returns:
  The `BundleContext`.

#### getConfiguration

    public DeploymentAdminConfig getConfiguration()

Returns:
  the configuration for this session, is guaranteed to remain stable during this session, never `null`.

#### getDataFile

    public File getDataFile(org.osgi.framework.Bundle bundle)

Retrieve the base directory of the persistent storage area according to OSGi Core R4 6.1.6.10 for the given `BundleContext`.

Specified by:
  `getDataFile` in interface `org.osgi.service.deploymentadmin.spi.DeploymentSession`
Parameters:
  `bundle` - of which the storage area will be returned
Returns:
  a `File` that represents the base directory of the persistent storage area for the bundle

#### getLog

    public org.osgi.service.log.LogService getLog()

Returns the currently present log service.

Returns:
  The `LogService`.

#### getPackageAdmin

    public org.osgi.service.packageadmin.PackageAdmin getPackageAdmin()

Returns the currently present package admin.

Returns:
  The `PackageAdmin`

#### getSourceAbstractDeploymentPackage

    public AbstractDeploymentPackage getSourceAbstractDeploymentPackage()

Returns the source deployment package as an `AbstractDeploymentPackage`.

Returns:
  The source deployment packge of the session.

#### getSourceDeploymentPackage

    public org.osgi.service.deploymentadmin.DeploymentPackage getSourceDeploymentPackage()

Specified by:
  `getSourceDeploymentPackage` in interface `org.osgi.service.deploymentadmin.spi.DeploymentSession`

#### getTargetAbstractDeploymentPackage

    public AbstractDeploymentPackage getTargetAbstractDeploymentPackage()

Returns the target deployment package as an `AbstractDeploymentPackage`.

Returns:
  The target deployment package of the session.

#### getTargetDeploymentPackage

    public org.osgi.service.deploymentadmin.DeploymentPackage getTargetDeploymentPackage()

Specified by:
  `getTargetDeploymentPackage` in interface `org.osgi.service.deploymentadmin.spi.DeploymentSession`