org.apache.felix.deploymentadmin.spi
Class DeploymentSessionImpl

java.lang.Object
  extended by org.apache.felix.deploymentadmin.spi.DeploymentSessionImpl
All Implemented Interfaces:
DeploymentSession

public class DeploymentSessionImpl
extends Object
implements DeploymentSession

Represents a running deployment session.


Constructor Summary
DeploymentSessionImpl(AbstractDeploymentPackage source, AbstractDeploymentPackage target, List commands, DeploymentAdminImpl admin)
           
 
Method Summary
 void call()
          Calling this method will cause the commands specified for this session to be executed.
 boolean cancel()
          Cancels the session if it is in progress.
 BundleContext getBundleContext()
          Returns the bundle context of the bundle this class is part of.
 File getDataFile(Bundle bundle)
          Retrieve the base directory of the persistent storage area according to OSGi Core R4 6.1.6.10 for the given BundleContext.
 LogService getLog()
          Returns the currently present log service.
 PackageAdmin getPackageAdmin()
          Returns the currently present package admin.
 AbstractDeploymentPackage getSourceAbstractDeploymentPackage()
          Returns the source deployment package as an AbstractDeploymentPackage.
 DeploymentPackage getSourceDeploymentPackage()
          If the deployment action is an install or an update, this call returns the DeploymentPackage instance that corresponds to the deployment package being streamed in for this session.
 AbstractDeploymentPackage getTargetAbstractDeploymentPackage()
          Returns the target deployment package as an AbstractDeploymentPackage.
 DeploymentPackage getTargetDeploymentPackage()
          If the deployment action is an update or an uninstall, this call returns the DeploymentPackage instance for the installed deployment package.
 
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)
Method Detail

call

public void call()
          throws 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:
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.

getDataFile

public File getDataFile(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 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
See Also:
DeploymentPackage, DeploymentCustomizerPermission

getSourceDeploymentPackage

public DeploymentPackage getSourceDeploymentPackage()
Description copied from interface: DeploymentSession
If the deployment action is an install or an update, this call returns the DeploymentPackage instance that corresponds to the deployment package being streamed in for this session. If the deployment action is an uninstall, this call returns the empty deployment package (see DeploymentPackage).

Specified by:
getSourceDeploymentPackage in interface DeploymentSession
Returns:
the source deployment package
See Also:
DeploymentPackage

getTargetDeploymentPackage

public DeploymentPackage getTargetDeploymentPackage()
Description copied from interface: DeploymentSession
If the deployment action is an update or an uninstall, this call returns the DeploymentPackage instance for the installed deployment package. If the deployment action is an install, this call returns the empty deployment package (see DeploymentPackage).

Specified by:
getTargetDeploymentPackage in interface DeploymentSession
Returns:
the target deployment package
See Also:
DeploymentPackage

getBundleContext

public BundleContext getBundleContext()
Returns the bundle context of the bundle this class is part of.

Returns:
The BundleContext.

getLog

public LogService getLog()
Returns the currently present log service.

Returns:
The LogService.

getPackageAdmin

public PackageAdmin getPackageAdmin()
Returns the currently present package admin.

Returns:
The PackageAdmin

getTargetAbstractDeploymentPackage

public AbstractDeploymentPackage getTargetAbstractDeploymentPackage()
Returns the target deployment package as an AbstractDeploymentPackage.

Returns:
The target deployment package of the session.

getSourceAbstractDeploymentPackage

public AbstractDeploymentPackage getSourceAbstractDeploymentPackage()
Returns the source deployment package as an AbstractDeploymentPackage.

Returns:
The source deployment packge of the session.


Copyright © 2011 Apache Software Foundation. All Rights Reserved.