Bus

org.topcased.externalbus.core
Class CorePlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.topcased.externalbus.core.CorePlugin
All Implemented Interfaces:
org.osgi.framework.BundleActivator

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

The main plugin class to be used in the desktop.
"org.topcased.externalbus.core" allows to access Topcased services from external server.
Define extension point ExternalServices and the interface IExternalService.


Field Summary
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
CorePlugin()
          The constructor.
 
Method Summary
static java.lang.Object createExtension(org.eclipse.core.runtime.IConfigurationElement element, java.lang.String classAttribute)
          Creates an extension.
static CorePlugin getDefault()
           
static java.lang.String getId()
           
 java.util.ResourceBundle getResourceBundle()
           
static java.lang.String getResourceString(java.lang.String key)
          Returns the string from the plugin's resource bundle, or 'key' if not found.
static void log(java.lang.Class<?> serviceClass, java.lang.String message, int level)
          Logs a message with given level into the Eclipse log file and with given name class which call it
static void log(java.lang.Class<?> serviceClass, java.lang.String message, int level, java.lang.Exception e)
          Logs a message with given level into the Eclipse log file and with given name class which call it
static void log(org.eclipse.core.runtime.IStatus status)
          Logs an IStatus
static void log(java.lang.String message, int level)
          Logs a message with given level into the Eclipse log file
static void log(java.lang.Throwable e)
          Log an exception into the Eclipse log file
 void start(org.osgi.framework.BundleContext context)
          This method is called upon plug-in activation
 void stop(org.osgi.framework.BundleContext context)
          This method is called when the plug-in is stopped
 
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
 

Constructor Detail

CorePlugin

public CorePlugin()
The constructor.

Method Detail

start

public void start(org.osgi.framework.BundleContext context)
           throws java.lang.Exception
This method is called upon plug-in activation

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

stop

public void stop(org.osgi.framework.BundleContext context)
          throws java.lang.Exception
This method is called when the plug-in is stopped

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

getDefault

public static CorePlugin getDefault()
Returns:
the shared instance

getResourceString

public static java.lang.String getResourceString(java.lang.String key)
Returns the string from the plugin's resource bundle, or 'key' if not found.

Parameters:
key -
Returns:
plugin's resource bundle or key

getResourceBundle

public java.util.ResourceBundle getResourceBundle()
Returns:
the plugin's resource bundle

createExtension

public static java.lang.Object createExtension(org.eclipse.core.runtime.IConfigurationElement element,
                                               java.lang.String classAttribute)
                                        throws org.eclipse.core.runtime.CoreException
Creates an extension. If the extension plugin has not been loaded a busy cursor will be activated during the duration of the load.

Parameters:
element - the config element defining the extension
classAttribute - the name of the attribute carrying the class
Returns:
the extension object
Throws:
org.eclipse.core.runtime.CoreException

getId

public static java.lang.String getId()
Returns:
the Plugin Id

log

public static void log(org.eclipse.core.runtime.IStatus status)
Logs an IStatus

Parameters:
status -

log

public static void log(java.lang.String message,
                       int level)
Logs a message with given level into the Eclipse log file

Parameters:
message - : the message to log
level - : the message priority

log

public static void log(java.lang.Class<?> serviceClass,
                       java.lang.String message,
                       int level)
Logs a message with given level into the Eclipse log file and with given name class which call it

Parameters:
serviceClass - calling => you must write : this.getClass()
message - : the message to log
level - : the message priority (IStatus.INFO or .ERROR or .WARNING ...)

log

public static void log(java.lang.Class<?> serviceClass,
                       java.lang.String message,
                       int level,
                       java.lang.Exception e)
Logs a message with given level into the Eclipse log file and with given name class which call it

Parameters:
serviceClass - calling => you must write : this.getClass()
message - : the message to log
level - : the message priority (IStatus.INFO or IStatus.ERROR or IStatus.WARNING ...)
e - : exception stack

log

public static void log(java.lang.Throwable e)
Log an exception into the Eclipse log file

Parameters:
e - : the exception to log

Bus

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.