org.apache.sling.commons.classloader.impl
Class DynamicClassLoaderManagerFactory

java.lang.Object
  extended by org.apache.sling.commons.classloader.impl.DynamicClassLoaderManagerFactory
All Implemented Interfaces:
org.osgi.framework.ServiceFactory

public class DynamicClassLoaderManagerFactory
extends Object
implements org.osgi.framework.ServiceFactory

This is the service factory for the dynamic class loader manager.


Constructor Summary
DynamicClassLoaderManagerFactory(org.osgi.framework.BundleContext ctx, org.osgi.service.packageadmin.PackageAdmin pckAdmin)
          Create a new service instance
 
Method Summary
 void addUnresolvedPackage(String pckName)
          Notify that a package is not found during class loading.
 void addUsedBundle(org.osgi.framework.Bundle bundle)
          Notify that a bundle is used as a source for class loading.
 Object getService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration)
           
 boolean hasUnresolvedPackages(org.osgi.framework.Bundle bundle)
          Check if an exported package from the bundle has not been found during previous class loading attempts.
 boolean isBundleUsed(long bundleId)
          Check if a bundle has been used for class loading.
 void ungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration, Object service)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicClassLoaderManagerFactory

public DynamicClassLoaderManagerFactory(org.osgi.framework.BundleContext ctx,
                                        org.osgi.service.packageadmin.PackageAdmin pckAdmin)
Create a new service instance

Parameters:
ctx - The bundle context.
pckAdmin - The package admin.
Method Detail

getService

public Object getService(org.osgi.framework.Bundle bundle,
                         org.osgi.framework.ServiceRegistration registration)
Specified by:
getService in interface org.osgi.framework.ServiceFactory
See Also:
ServiceFactory.getService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration)

ungetService

public void ungetService(org.osgi.framework.Bundle bundle,
                         org.osgi.framework.ServiceRegistration registration,
                         Object service)
Specified by:
ungetService in interface org.osgi.framework.ServiceFactory
See Also:
ServiceFactory.ungetService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration, java.lang.Object)

isBundleUsed

public boolean isBundleUsed(long bundleId)
Check if a bundle has been used for class loading.

Parameters:
bundleId - The bundle id.
Returns:
true if the bundle has been used.

addUsedBundle

public void addUsedBundle(org.osgi.framework.Bundle bundle)
Notify that a bundle is used as a source for class loading.

Parameters:
bundle - The bundle.

addUnresolvedPackage

public void addUnresolvedPackage(String pckName)
Notify that a package is not found during class loading.

Parameters:
pckName - The package name.

hasUnresolvedPackages

public boolean hasUnresolvedPackages(org.osgi.framework.Bundle bundle)
Check if an exported package from the bundle has not been found during previous class loading attempts.

Parameters:
bundle - The bundle to check
Returns:
true if a package has not be found before


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