Bus

org.topcased.bus.core
Class CorePlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.topcased.bus.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. Manage Log in a "error log" console


Field Summary
static java.lang.String PREFERENCEPATHTEMPLATE
           
 
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 CorePlugin getDefault()
          Getter for the shared instance.
static java.lang.String getId()
          Getter for the plugin identifier
 java.util.ResourceBundle getResourceBundle()
          Returns the plugin's resource bundle
static java.lang.String getResourceString(java.lang.String key)
           
static void log(java.lang.Class<?> serviceClass, java.lang.String message, int level)
          Log 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)
          Log 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)
          Log an IStatus
static void log(java.lang.String message, int level)
          Log a message with a 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
 

Field Detail

PREFERENCEPATHTEMPLATE

public static java.lang.String PREFERENCEPATHTEMPLATE
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 - : the BundleContext
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 - : the BundleContext
Throws:
java.lang.Exception

getDefault

public static CorePlugin getDefault()
Getter for the shared instance.

Returns:
CorePlugin

getResourceString

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

getResourceBundle

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

Returns:
ResourceBundle : the plugin resource bundle

getId

public static java.lang.String getId()
Getter for the plugin identifier

Returns:
the Plugin Id

log

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

Parameters:
status -

log

public static void log(java.lang.String message,
                       int level)
Log a message with a 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)
Log 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)
Log 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.