org.apache.sling.installer.core.impl.tasks
Class SynchronousRefreshPackagesTask

java.lang.Object
  extended by org.apache.sling.installer.api.tasks.InstallTask
      extended by org.apache.sling.installer.core.impl.AbstractInstallTask
          extended by org.apache.sling.installer.core.impl.tasks.SynchronousRefreshPackagesTask
All Implemented Interfaces:
Comparable<InstallTask>, EventListener, org.osgi.framework.FrameworkListener

public class SynchronousRefreshPackagesTask
extends AbstractInstallTask
implements org.osgi.framework.FrameworkListener

Execute an OSGi "refresh packages" operation, synchronously


Field Summary
static int MAX_REFRESH_PACKAGES_WAIT_SECONDS
          Max time allowed to refresh packages (TODO configurable??)
 
Constructor Summary
SynchronousRefreshPackagesTask(BundleTaskCreator btc)
           
 
Method Summary
 void execute(InstallationContext ctx)
          This is the heart of the task - it performs the actual task.
 void frameworkEvent(org.osgi.framework.FrameworkEvent event)
          Handles the PACKAGES_REFRESHED framework event which is sent after the PackageAdmin.refreshPackages has finished its work of refreshing the packages.
 String getSortKey()
          Tasks are sorted according to this key.
 String toString()
           
 
Methods inherited from class org.apache.sling.installer.core.impl.AbstractInstallTask
getLogger
 
Methods inherited from class org.apache.sling.installer.api.tasks.InstallTask
compareTo, equals, getResource, getResourceGroup, hashCode, setFinishedState
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_REFRESH_PACKAGES_WAIT_SECONDS

public static final int MAX_REFRESH_PACKAGES_WAIT_SECONDS
Max time allowed to refresh packages (TODO configurable??)

See Also:
Constant Field Values
Constructor Detail

SynchronousRefreshPackagesTask

public SynchronousRefreshPackagesTask(BundleTaskCreator btc)
Method Detail

frameworkEvent

public void frameworkEvent(org.osgi.framework.FrameworkEvent event)
Handles the PACKAGES_REFRESHED framework event which is sent after the PackageAdmin.refreshPackages has finished its work of refreshing the packages. When packages have been refreshed all bundles which are expected to be active (those active before refreshing the packages and newly installed or updated bundles) are started.

Specified by:
frameworkEvent in interface org.osgi.framework.FrameworkListener

getSortKey

public String getSortKey()
Description copied from class: InstallTask
Tasks are sorted according to this key. Therefore this key must uniquely identify this task. A typical sort key contains the entity id of the resource in execution.

Specified by:
getSortKey in class InstallTask

toString

public String toString()
Overrides:
toString in class InstallTask

execute

public void execute(InstallationContext ctx)
Description copied from class: InstallTask
This is the heart of the task - it performs the actual task.

Specified by:
execute in class InstallTask
Parameters:
ctx - The installation context.
See Also:
InstallTask.execute(org.apache.sling.installer.api.tasks.InstallationContext)


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.