org.netbeans.bootstrap/1 2.52

org.netbeans
Class NetigsoFramework

java.lang.Object
  extended by org.netbeans.NetigsoFramework

public abstract class NetigsoFramework
extends Object

This class contains abstracted calls to OSGi provided by core.netigso module. No other module can implement this class, except core.netigso.


Constructor Summary
protected NetigsoFramework()
           
 
Method Summary
protected  ClassLoader createClassLoader(String cnb)
          Creates a delegating loader for given module.
protected abstract  Set<String> createLoader(ModuleInfo m, ProxyClassLoader pcl, File jar)
          Initializes a classloader for given module.
protected  int defaultStartLevel()
          Default start level for all bundles that don't specify any own.
protected  ClassLoader findFrameworkClassLoader()
          Allows the OSGi support to identify the classloader that loads all OSGi framework classes.
protected  Module findModule(String cnb)
          Finds module for given name.
protected  Enumeration<URL> findResources(Module module, String resName)
          Find given resource inside provide module representing an OSGi bundle.
protected  byte[] fromArchive(ArchiveResources resources, String name)
          Get an array of bytes from archive.
protected abstract  void prepare(Lookup loadFrameworkFrom, Collection<? extends Module> preregister)
          Starts the framework.
protected abstract  void reload(Module m)
          Reloads one module
protected abstract  void shutdown()
          Shutdowns the framework
protected abstract  void start()
          Starts the OSGi framework by activating all bundles that shall be activated.
protected abstract  Set<String> start(Collection<? extends Module> allModules)
          Get's ready for start of the OSGi framework.
protected abstract  void stopLoader(ModuleInfo m, ClassLoader loader)
          Deinitializes a classloader for given module
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetigsoFramework

protected NetigsoFramework()
Method Detail

prepare

protected abstract void prepare(Lookup loadFrameworkFrom,
                                Collection<? extends Module> preregister)
Starts the framework.


start

protected abstract Set<String> start(Collection<? extends Module> allModules)
Get's ready for start of the OSGi framework.

Parameters:
allModules - the modules that are in the system
Returns:
returns set of additional modules (usually autoloads that need to be turned on)
Since:
2.31 it returns set of module code name bases

start

protected abstract void start()
Starts the OSGi framework by activating all bundles that shall be activated.

Since:
2.35

shutdown

protected abstract void shutdown()
Shutdowns the framework


createLoader

protected abstract Set<String> createLoader(ModuleInfo m,
                                            ProxyClassLoader pcl,
                                            File jar)
                                     throws IOException
Initializes a classloader for given module.

Parameters:
pcl - proxy classloader that shall be configured
jar - the module JAR file
Returns:
set of covered packages
Throws:
IOException

findResources

protected Enumeration<URL> findResources(Module module,
                                         String resName)
Find given resource inside provide module representing an OSGi bundle. The search should happen without resolving the bundle, if possible. E.g. by using Bundle.getEntry.

Parameters:
resName - name of the resource to seek for
Returns:
empty enumeration or enumeration with one element.
Since:
2.49

reload

protected abstract void reload(Module m)
                        throws IOException
Reloads one module

Throws:
IOException
Since:
2.27

stopLoader

protected abstract void stopLoader(ModuleInfo m,
                                   ClassLoader loader)
Deinitializes a classloader for given module


findFrameworkClassLoader

protected ClassLoader findFrameworkClassLoader()
Allows the OSGi support to identify the classloader that loads all OSGi framework classes.

Since:
2.37

defaultStartLevel

protected int defaultStartLevel()
Default start level for all bundles that don't specify any own.

Returns:
Since:
2.44.2

fromArchive

protected final byte[] fromArchive(ArchiveResources resources,
                                   String name)
                            throws IOException
Get an array of bytes from archive. If not found, it remembers the request and later calls #toArchive(java.lang.String, java.lang.String) method to store it for next time.

Parameters:
name - name of the resource inside the JAR
Returns:
either cached value or the one returned by resources (or null)
Throws:
IOException - if something goes wrong
Since:
2.29

createClassLoader

protected final ClassLoader createClassLoader(String cnb)
Creates a delegating loader for given module. The loader is suitable for use as a delegating loader for a fake OSGi bundle.

Parameters:
cnb - name of the bundle/module
Returns:
classloader or null if the module does not exist
Since:
2.50

findModule

protected final Module findModule(String cnb)
Finds module for given name.

Parameters:
cnb - code name base of the module
Returns:
the module or null
Since:
2.50

org.netbeans.bootstrap/1 2.52

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.