org.eclipse.corona.container.config
Class Activator

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.corona.container.config.Activator
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public class Activator
extends org.eclipse.core.runtime.Plugin

The class manages the configuration file associated with each Container. The configuration is implemented using properties file to hold information about the Container such as Container definition file content-type. The configuration points to location of the Container definition file. The configuration also contains the name of the Container and the Container URI. Since it is expensive to open Containers we keep the Container Name and URI in the configuration file so we can quickly scan the configuration files and know what Containers exist. Below is a sample of properties in the configuration file: context-container-name=Corona context-container-uri=org.eclipse.corona.container.project/Corona context-container-content-type=project context-container-content-type-access-type=XML context-container-file-location=${CORONA_CONFIG_HOME}/containers/Corona.xml


Field Summary
static java.lang.String CORONA_CONFIG_HOME
           
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
Activator()
          The constructor
 
Method Summary
static org.osgi.framework.BundleContext getContext()
          Getter method for plugins BundleContext.
static Activator getDefault()
          Returns the shared instance
static CoronaLogService getLogService()
          Get the Corona log service for this plug-in
 void start(org.osgi.framework.BundleContext context)
          When plugin starts, "CORONA_CONFIG_HOME" value is read.
 void stop(org.osgi.framework.BundleContext context)
          
(package private) static void storeConfigLoaction(java.lang.String location)
          Method stores given parameter in PluginPreferences, under the CORONA_CONFIG_HOME name.
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, initializeDefaultPluginPreferences, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, shutdown, startup, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CORONA_CONFIG_HOME

public static final java.lang.String CORONA_CONFIG_HOME
See Also:
Constant Field Values
Constructor Detail

Activator

public Activator()
The constructor

Method Detail

getContext

public static org.osgi.framework.BundleContext getContext()
Getter method for plugins BundleContext.

Returns:
plugin's BundleContext.

getLogService

public static CoronaLogService getLogService()
Get the Corona log service for this plug-in

Returns:

getDefault

public static Activator getDefault()
Returns the shared instance

Returns:
the shared instance

start

public void start(org.osgi.framework.BundleContext context)
           throws java.lang.Exception
When plugin starts, "CORONA_CONFIG_HOME" value is read. To read the value we search in following locations:
  • System.getProperty(CORONA_CONFIG_HOME)
  • System.getenv(CORONA_CONFIG_HOME)
  • plugin.getPluginPreferences().getString(CORONA_CONFIG_HOME)

    Specified by:
    start in interface org.osgi.framework.BundleActivator
    Overrides:
    start in class org.eclipse.core.runtime.Plugin
    Throws:
    java.lang.Exception

  • stop

    public void stop(org.osgi.framework.BundleContext context)
              throws java.lang.Exception

    Specified by:
    stop in interface org.osgi.framework.BundleActivator
    Overrides:
    stop in class org.eclipse.core.runtime.Plugin
    Throws:
    java.lang.Exception

    storeConfigLoaction

    static void storeConfigLoaction(java.lang.String location)
    Method stores given parameter in PluginPreferences, under the CORONA_CONFIG_HOME name.

    Parameters:
    location - to be stored in PluginPreferences.

    Copyright 2006 IBM Corporation and others.
    All Rights Reserved.