Package org.eclipse.osgi.internal.serviceregistry

Examples of org.eclipse.osgi.internal.serviceregistry.ServiceRegistry


  private ServiceRegistry getRegistry() {
    return ((Framework) adaptor.getEventPublisher()).getServiceRegistry();
  }

  public byte[] processClass(String name, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry, ClasspathManager manager) {
    ServiceRegistry registry = getRegistry();
    if (registry == null)
      return null; // no registry somehow we are loading classes before the registry has been created
    ClassLoaderDelegate delegate = manager.getBaseClassLoader().getDelegate();
    BundleLoader loader;
    if (delegate instanceof BundleLoader) {
View Full Code Here


   *
   */
  protected void close() {
    valid = false; /* invalidate context */

    final ServiceRegistry registry = framework.getServiceRegistry();

    registry.removeAllServiceListeners(this);
    synchronized (framework.frameworkEvent) {
      if (frameworkEvent != null) {
        framework.frameworkEvent.remove(this);
        frameworkEvent = null;
      }
    }
    synchronized (framework.bundleEvent) {
      if (bundleEvent != null) {
        framework.bundleEvent.remove(this);
        bundleEvent = null;
      }
    }
    synchronized (framework.bundleEventSync) {
      if (bundleEventSync != null) {
        framework.bundleEventSync.remove(this);
        bundleEventSync = null;
      }
    }

    /* service's registered by the bundle, if any, are unregistered. */
    registry.unregisterServices(this);

    /* service's used by the bundle, if any, are released. */
    registry.releaseServicesInUse(this);

    synchronized (contextLock) {
      servicesInUse = null;
    }
  }
View Full Code Here

    bundleEventSync = new CopyOnWriteIdentityMap();
    frameworkEvent = new CopyOnWriteIdentityMap();
    if (Profile.PROFILE && Profile.STARTUP)
      Profile.logTime("Framework.initialze()", "done new EventManager"); //$NON-NLS-1$ //$NON-NLS-2$
    /* create the service registry */
    serviceRegistry = new ServiceRegistry(this);
    // Initialize the installLock; there is no way of knowing
    // what the initial size should be, at most it will be the number
    // of threads trying to install a bundle (probably a very low number).
    installLock = new Hashtable(10);
    /* create the system bundle */
 
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.internal.serviceregistry.ServiceRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.