public class FrameworkLauncher
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
FrameworkLauncher.ChildFirstURLClassLoader
The ChildFirstURLClassLoader alters regular ClassLoader delegation and will check the URLs
used in its initialization for matching classes before delegating to it's parent.
|
Modifier and Type | Field and Description |
---|---|
protected javax.servlet.ServletConfig |
config |
protected javax.servlet.ServletContext |
context |
protected static java.lang.String |
FILE_SCHEME |
protected static java.lang.String |
FRAMEWORK_BUNDLE_NAME |
protected static java.lang.String |
LAUNCH_INI |
protected static java.lang.String |
NULL_IDENTIFIER |
protected static java.lang.String |
OSGI_CONFIGURATION_AREA |
protected static java.lang.String |
OSGI_FRAMEWORK |
protected static java.lang.String |
OSGI_INSTALL_AREA |
protected static java.lang.String |
OSGI_INSTANCE_AREA |
protected static java.lang.String |
RESOURCE_BASE |
protected static java.lang.String |
STARTER |
Constructor and Description |
---|
FrameworkLauncher() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String[] |
buildCommandLineArguments()
buildCommandLineArguments parses the commandline config parameter into a set of arguments
|
protected java.util.Map |
buildInitialPropertyMap()
buildInitialPropertyMap create the inital set of properties from the contents of launch.ini
and for a few other properties necessary to launch defaults are supplied if not provided.
|
protected void |
copyResource(java.lang.String resourcePath,
java.io.File target)
copyResource is a convenience method to recursively copy resources from the ServletContext to
an installation target.
|
protected static boolean |
deleteDirectory(java.io.File directory)
deleteDirectory is a cocnvenience method to recursively delete a directory
|
void |
deploy()
Deploy the OSGi framework libraries into a location suitable for execution.
|
void |
destroy() |
protected int |
findMax(java.lang.String[] candidates) |
java.lang.ClassLoader |
getFrameworkContextClassLoader()
Used when to set the ContextClassLoader when the BridgeServlet delegates to a Servlet
inside the framework
|
java.util.Properties |
getFrameworkInternalProperties(java.lang.ClassLoader cl) |
protected java.io.File |
getPlatformDirectory()
Platfom Directory is where the OSGi software is installed
|
void |
init() |
void |
init(javax.servlet.ServletConfig servletConfig) |
protected java.util.Properties |
loadProperties(java.lang.String resource)
loadProperties is a convenience method to load properties from a servlet context resource
|
protected java.lang.String |
searchFor(java.lang.String target,
java.lang.String start)
Searches for the given target directory starting in the "plugins" subdirectory
of the given location.
|
void |
start()
Start OSGi framework
Read launcher.ini to create a set of initial properties and
use the "commandline" configuration parameter to create the
equivalent command line arguments available when starting Eclipse.
|
void |
stop()
stop is used to "shutdown" the framework and make it avialable for garbage collection.
|
void |
undeploy()
Undeploy the OSGi framework libraries from the execution location.
|
protected static final java.lang.String FILE_SCHEME
protected static final java.lang.String FRAMEWORK_BUNDLE_NAME
protected static final java.lang.String STARTER
protected static final java.lang.String NULL_IDENTIFIER
protected static final java.lang.String OSGI_FRAMEWORK
protected static final java.lang.String OSGI_INSTANCE_AREA
protected static final java.lang.String OSGI_CONFIGURATION_AREA
protected static final java.lang.String OSGI_INSTALL_AREA
protected static final java.lang.String RESOURCE_BASE
protected static final java.lang.String LAUNCH_INI
protected javax.servlet.ServletConfig config
protected javax.servlet.ServletContext context
public void init(javax.servlet.ServletConfig servletConfig)
public void init()
public void destroy()
public void deploy()
public void undeploy()
public void start()
public java.util.Properties getFrameworkInternalProperties(java.lang.ClassLoader cl)
protected java.util.Map buildInitialPropertyMap()
protected java.lang.String[] buildCommandLineArguments()
public void stop()
protected void copyResource(java.lang.String resourcePath, java.io.File target)
resourcePath
- - The resource root pathtarget
- - The root location where resources are to be copiedprotected static boolean deleteDirectory(java.io.File directory)
directory
- - the directory to delete.public java.lang.ClassLoader getFrameworkContextClassLoader()
protected java.io.File getPlatformDirectory()
protected java.util.Properties loadProperties(java.lang.String resource)
resource
- - The target to read properties fromprotected java.lang.String searchFor(java.lang.String target, java.lang.String start)
target
- start
- the location to begin searchingprotected int findMax(java.lang.String[] candidates)