private void initServices() { BundleContext context = Activator.getContext(); if (context == null) { RuntimeLog.log( new Status( IStatus.ERROR, RegistryMessages.OWNER_NAME, 0, RegistryMessages.bundle_not_activated, null)); return; } debugTracker = new ServiceTracker(context, DebugOptions.class.getName(), null); debugTracker.open(); bundleTracker = new ServiceTracker(context, PackageAdmin.class.getName(), null); bundleTracker.open(); // locations final String FILTER_PREFIX = "(&(objectClass=org.eclipse.osgi.service.datalocation.Location)(type="; //$NON-NLS-1$ Filter filter = null; try { filter = context.createFilter(FILTER_PREFIX + PROP_CONFIG_AREA + "))"); // $NON-NLS-1$ } catch (InvalidSyntaxException e) { // ignore this. It should never happen as we have tested the above format. } configurationLocationTracker = new ServiceTracker(context, filter, null); configurationLocationTracker.open(); }
public PackageAdmin getPackageAdmin() { if (bundleTracker == null) { RuntimeLog.log( new Status( IStatus.ERROR, RegistryMessages.OWNER_NAME, 0, RegistryMessages.bundle_not_activated, null)); return null; } return (PackageAdmin) bundleTracker.getService(); }
public boolean getBooleanDebugOption(String option, boolean defaultValue) { if (debugTracker == null) { RuntimeLog.log( new Status( IStatus.ERROR, RegistryMessages.OWNER_NAME, 0, RegistryMessages.bundle_not_activated, null)); return defaultValue; } DebugOptions options = (DebugOptions) debugTracker.getService(); if (options != null) { String value = options.getOption(option); if (value != null) return value.equalsIgnoreCase("true"); // $NON-NLS-1$ } return defaultValue; }
protected void logError(String message) { // we log as an error to ensure it's shown RuntimeLog.log(new Status(IStatus.ERROR, "org.eclipse.e4.ui.css.core", message)); }
public void logError(String msg, Throwable e) { RuntimeLog.log(new Status(IStatus.ERROR, PI_AUTH, msg, e)); }
public void logMessage(String msg) { RuntimeLog.log(new Status(IStatus.INFO, PI_AUTH, msg, null)); }