org.apache.felix.deploymentadmin
Class DeploymentAdminImpl

java.lang.Object
  extended by org.apache.felix.deploymentadmin.DeploymentAdminImpl
All Implemented Interfaces:
DeploymentAdmin

public class DeploymentAdminImpl
extends Object
implements DeploymentAdmin


Field Summary
static String PACKAGE_DIR
           
static String PACKAGECONTENTS_DIR
           
static String PACKAGEINDEX_FILE
           
static String TEMP_DIR
           
static String TEMP_POSTFIX
           
static String TEMP_PREFIX
           
 
Constructor Summary
DeploymentAdminImpl()
          Create new instance of this DeploymentAdmin.
 
Method Summary
 boolean cancel()
          This method cancels the currently active deployment session.
 BundleContext getBundleContext()
          Returns reference to this bundle's BundleContext
 DeploymentPackage getDeploymentPackage(Bundle bundle)
          Gives back the installed DeploymentPackage that owns the bundle.
 DeploymentPackage getDeploymentPackage(String symbName)
          Gets the currently installed DeploymentPackage instance which has the given symbolic name.
 LogService getLog()
          Returns reference to the current logging service defined in the framework.
 PackageAdmin getPackageAdmin()
          Returns reference to the current package admin defined in the framework.
 DeploymentPackage installDeploymentPackage(InputStream input)
          Installs a Deployment Package from an input stream.
 DeploymentPackage[] listDeploymentPackages()
          Lists the Deployment Packages currently installed on the platform.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGE_DIR

public static final String PACKAGE_DIR
See Also:
Constant Field Values

TEMP_DIR

public static final String TEMP_DIR
See Also:
Constant Field Values

PACKAGECONTENTS_DIR

public static final String PACKAGECONTENTS_DIR
See Also:
Constant Field Values

PACKAGEINDEX_FILE

public static final String PACKAGEINDEX_FILE
See Also:
Constant Field Values

TEMP_PREFIX

public static final String TEMP_PREFIX
See Also:
Constant Field Values

TEMP_POSTFIX

public static final String TEMP_POSTFIX
See Also:
Constant Field Values
Constructor Detail

DeploymentAdminImpl

public DeploymentAdminImpl()
Create new instance of this DeploymentAdmin.

Method Detail

start

public void start()
           throws DeploymentException
Throws:
DeploymentException

stop

public void stop()

cancel

public boolean cancel()
Description copied from interface: DeploymentAdmin
This method cancels the currently active deployment session. This method addresses the need to cancel the processing of excessively long running, or resource consuming install, update or uninstall operations.

Specified by:
cancel in interface DeploymentAdmin
Returns:
true if there was an active session and it was successfully canceled.
See Also:
DeploymentAdminPermission

getDeploymentPackage

public DeploymentPackage getDeploymentPackage(String symbName)
Description copied from interface: DeploymentAdmin
Gets the currently installed DeploymentPackage instance which has the given symbolic name.

During an installation of an existing package (update) or during an uninstallation, the target Deployment Package must remain the return value until the installation (uninstallation) process is completed, after which the source (or null in case of uninstall) is the return value.

Specified by:
getDeploymentPackage in interface DeploymentAdmin
Parameters:
symbName - the symbolic name of the Deployment Package to be retrieved. It mustn't be null.
Returns:
The DeploymentPackage for the given symbolic name. If there is no Deployment Package with that symbolic name currently installed, null is returned.
See Also:
DeploymentPackage, DeploymentAdminPermission

getDeploymentPackage

public DeploymentPackage getDeploymentPackage(Bundle bundle)
Description copied from interface: DeploymentAdmin
Gives back the installed DeploymentPackage that owns the bundle. Deployment Packages own their bundles by their Bundle Symbolic Name. It means that if a bundle belongs to an installed Deployment Packages (and at most to one) the Deployment Admin assigns the bundle to its owner Deployment Package by the Symbolic Name of the bundle.

Specified by:
getDeploymentPackage in interface DeploymentAdmin
Parameters:
bundle - the bundle whose owner is queried
Returns:
the Deployment Package Object that owns the bundle or null if the bundle doesn't belong to any Deployment Packages (standalone bundles)
See Also:
DeploymentPackage, DeploymentAdminPermission

installDeploymentPackage

public DeploymentPackage installDeploymentPackage(InputStream input)
                                           throws DeploymentException
Description copied from interface: DeploymentAdmin
Installs a Deployment Package from an input stream. If a version of that Deployment Package is already installed and the versions are different, the installed version is updated with this new version even if it is older (downgrade). If the two versions are the same, then this method simply returns with the old (target) Deployment Package without any action.

Specified by:
installDeploymentPackage in interface DeploymentAdmin
Parameters:
input - the input stream the Deployment Package can be read from. It mustn't be null.
Returns:
A DeploymentPackage object representing the newly installed/updated Deployment Package. It is never null.
Throws:
DeploymentException - if the installation was not successful. For detailed error code description see DeploymentException.
See Also:
DeploymentAdminPermission, DeploymentPackage, DeploymentPackage

listDeploymentPackages

public DeploymentPackage[] listDeploymentPackages()
Description copied from interface: DeploymentAdmin
Lists the Deployment Packages currently installed on the platform.

DeploymentAdminPermission("<filter>", "list") is needed for this operation to the effect that only those packages are listed in the array to which the caller has appropriate DeploymentAdminPermission. It has the consequence that the method never throws SecurityException only doesn't put certain Deployment Packages into the array.

During an installation of an existing package (update) or during an uninstallation, the target must remain in this list until the installation (uninstallation) process is completed, after which the source (or null in case of uninstall) replaces the target.

Specified by:
listDeploymentPackages in interface DeploymentAdmin
Returns:
the array of DeploymentPackage objects representing all the installed Deployment Packages. The return value cannot be null. In case of missing permissions it may give back an empty array.
See Also:
DeploymentPackage, DeploymentAdminPermission

getBundleContext

public BundleContext getBundleContext()
Returns reference to this bundle's BundleContext

Returns:
This bundle's BundleContext

getLog

public LogService getLog()
Returns reference to the current logging service defined in the framework.

Returns:
Currently active LogService.

getPackageAdmin

public PackageAdmin getPackageAdmin()
Returns reference to the current package admin defined in the framework.

Returns:
Currently active PackageAdmin.


Copyright © 2011 Apache Software Foundation. All Rights Reserved.