org.electrocodeogram.cpc.core
Class CPCCorePlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.ui.plugin.AbstractUIPlugin
          extended by org.electrocodeogram.cpc.core.CPCCorePlugin
All Implemented Interfaces:
java.util.EventListener, org.eclipse.core.runtime.Preferences.IPropertyChangeListener, org.osgi.framework.BundleActivator

public class CPCCorePlugin
extends org.eclipse.ui.plugin.AbstractUIPlugin
implements org.eclipse.core.runtime.Preferences.IPropertyChangeListener

This singleton class represents the central integration point of the CPC Framework. Static methods on this class can be used to obtain references to the three key elements of the CPC Framework:

This class is also the activator class for the CPC Core module.

Author:
vw
See Also:
getProviderRegistry(), IProviderRegistry, getEventHubRegistry(), IEventHubRegistry, getConfigurationRegistry(), IConfigurationRegistry, org.electrocodeogram.cpc.core.api, org.electrocodeogram.cpc.core.utils

Field Summary
static java.lang.String PLUGIN_ID
          The plug-in ID of the CPC Core plug-in.
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
CPCCorePlugin()
          The default constructor.
 
Method Summary
static IConfigurationRegistry getConfigurationRegistry()
          Yields and instance of the currently active IConfigurationRegistry.
static CPCCorePlugin getDefault()
          Returns the shared singleton instance of the CPCCorePlugin.
static IEventHubRegistry getEventHubRegistry()
          Yields and instance of the currently active IEventHubRegistry.
static org.electrocodeogram.eclipse.core.logging.ILogManager getLogManager()
          Retrieves the underlying shared ILogManager used by the CPC Core module.
static IProviderRegistry getProviderRegistry()
          Yields an instance of the currently active IProviderRegistry.
static boolean isDebugChecking()
          Checks whether additional internal consistency checkings should be performed.
 void propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent event)
           
static void setDebugChecking(boolean debugChecking)
          Toggles some internal consistency checking on/off.
 void start(org.osgi.framework.BundleContext context)
           
 void stop(org.osgi.framework.BundleContext context)
           
 
Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLUGIN_ID

public static final java.lang.String PLUGIN_ID
The plug-in ID of the CPC Core plug-in.

See Also:
Constant Field Values
Constructor Detail

CPCCorePlugin

public CPCCorePlugin()
The default constructor.
Called by the Eclipse Platform, a client should never create instances of this class.

Method Detail

start

public void start(org.osgi.framework.BundleContext context)
           throws java.lang.Exception
Specified by:
start in interface org.osgi.framework.BundleActivator
Overrides:
start in class org.eclipse.ui.plugin.AbstractUIPlugin
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.ui.plugin.AbstractUIPlugin
Throws:
java.lang.Exception

getDefault

public static CPCCorePlugin getDefault()
Returns the shared singleton instance of the CPCCorePlugin.

Returns:
the shared instance, usually not null. However, if called before the CPC Core startup sequence has completed or during shutdown, NULL may be returned.

getLogManager

public static org.electrocodeogram.eclipse.core.logging.ILogManager getLogManager()
Retrieves the underlying shared ILogManager used by the CPC Core module.
Refer to the ECG EclipseCore module for more details.

Returns:
shared log manager for the CPC Core plugin, may be NULL.

getProviderRegistry

public static IProviderRegistry getProviderRegistry()
Yields an instance of the currently active IProviderRegistry.
CPC modules use this class to register and obtain implementations for specific API interfaces.
The service provider concept is an essential part of the CPC Framework.

Returns:
current IProviderRegistry, usually not null. However, if called before the CPC Core startup sequence has completed or during shutdown, NULL may be returned.
See Also:
IProviderRegistry, IProvider

getEventHubRegistry

public static IEventHubRegistry getEventHubRegistry()
Yields and instance of the currently active IEventHubRegistry.
CPC modules use the event hub to exchange CPCEvents in a flexible and decoupled manner.
The event hub concept is an essential part of the CPC Framework.

Returns:
current IEventHubRegistry, usually not null. However, if called before the CPC Core startup sequence has completed or during shutdown, NULL may be returned.
See Also:
IEventHubRegistry, IEventHubListener, CPCEvent

getConfigurationRegistry

public static IConfigurationRegistry getConfigurationRegistry()
Yields and instance of the currently active IConfigurationRegistry.
CPC modules use the configuration registry to obtain global configuration data.

Returns:
current IEventHubRegistry, usually not null. However, if called before the CPC Core startup sequence has completed or during shutdown, NULL may be returned.
See Also:
IConfigurationRegistry

isDebugChecking

public static boolean isDebugChecking()
Checks whether additional internal consistency checkings should be performed.
Does not directly affect debug logging.


setDebugChecking

public static void setDebugChecking(boolean debugChecking)
Toggles some internal consistency checking on/off. Setting this value to true has serious performance implications.
Does not directly affect debug logging.

Parameters:
debugChecking - true if additional consistency checks should be performed, false otherwise.

propertyChange

public void propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent event)
Specified by:
propertyChange in interface org.eclipse.core.runtime.Preferences.IPropertyChangeListener