com.springsource.util.osgi.internal
Class StandardPackageAdminUtil

java.lang.Object
  extended by com.springsource.util.osgi.internal.StandardPackageAdminUtil
All Implemented Interfaces:
PackageAdminUtil

public final class StandardPackageAdminUtil
extends java.lang.Object
implements PackageAdminUtil

StandardPackageAdminUtil is the implementation of PackageAdminUtil.

Concurrent Semantics
This class is thread safe.

Since:
Jersey
Author:
Glyn Normington

Field Summary
private  org.osgi.framework.BundleContext bundleContext
           
private  org.osgi.framework.FrameworkListener frameworkListener
           
private static org.slf4j.Logger LOGGER
           
private  java.lang.Object monitor
           
private static java.lang.String PACKAGE_ADMIN_CLASS
           
private  org.osgi.service.packageadmin.PackageAdmin packageAdmin
           
private  org.osgi.framework.ServiceReference packageAdminServiceReference
           
private  boolean refreshComplete
           
private static long SLEEP_INTERVAL_MS
           
private  boolean started
           
 
Constructor Summary
StandardPackageAdminUtil(org.osgi.framework.BundleContext bundleContext)
           
 
Method Summary
private  void ensurePreviousRefreshComplete()
           
 void refreshPackages(org.osgi.framework.Bundle[] bundles, long timeoutMillis)
          Issue refreshPackages and wait for at most the given timeout for the asynchronous refresh operation to complete.
private  void sleep(long interval)
           
 void stop()
           
private  void waitForRefreshToComplete(long timeoutMillis)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGE_ADMIN_CLASS

private static final java.lang.String PACKAGE_ADMIN_CLASS
See Also:
Constant Field Values

SLEEP_INTERVAL_MS

private static final long SLEEP_INTERVAL_MS
See Also:
Constant Field Values

LOGGER

private static final org.slf4j.Logger LOGGER

monitor

private java.lang.Object monitor

started

private boolean started

packageAdmin

private final org.osgi.service.packageadmin.PackageAdmin packageAdmin

frameworkListener

private final org.osgi.framework.FrameworkListener frameworkListener

packageAdminServiceReference

private org.osgi.framework.ServiceReference packageAdminServiceReference

bundleContext

private final org.osgi.framework.BundleContext bundleContext

refreshComplete

private volatile boolean refreshComplete
Constructor Detail

StandardPackageAdminUtil

public StandardPackageAdminUtil(org.osgi.framework.BundleContext bundleContext)
Method Detail

stop

public void stop()

refreshPackages

public void refreshPackages(org.osgi.framework.Bundle[] bundles,
                            long timeoutMillis)
Issue refreshPackages and wait for at most the given timeout for the asynchronous refresh operation to complete.

Specified by:
refreshPackages in interface PackageAdminUtil
Parameters:
bundles - the Bundles whose exported packages are to be refreshed or null for all Bundles updated or uninstalled since refreshPackages was last called
timeoutMillis - a number of milliseconds to wait for the asynchronous refresh operation to complete

ensurePreviousRefreshComplete

private void ensurePreviousRefreshComplete()

waitForRefreshToComplete

private void waitForRefreshToComplete(long timeoutMillis)

sleep

private void sleep(long interval)