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()
           
 AbstractDeploymentPackage getTargetAbstractDeploymentPackage()
          Returns the target deployment package as an AbstractDeploymentPackage.
 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)
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

getSourceDeploymentPackage

public DeploymentPackage getSourceDeploymentPackage()
Specified by:
getSourceDeploymentPackage in interface DeploymentSession

getTargetDeploymentPackage

public DeploymentPackage getTargetDeploymentPackage()
Specified by:
getTargetDeploymentPackage in interface DeploymentSession

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 © 2006-2011 Apache Software Foundation. All Rights Reserved.