Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2012-08-01 13:43:40 +0000
committerThomas Watson2012-08-01 20:56:59 +0000
commit3f5244566860943ad1edda436cce235f628706a6 (patch)
tree01de85f4f0d5e83d01e7a2b52e398bf94a771bff /bundles
parent10c452a1403362ab2e4d5d08938c8347ba53c8ef (diff)
downloadrt.equinox.framework-3f5244566860943ad1edda436cce235f628706a6.tar.gz
rt.equinox.framework-3f5244566860943ad1edda436cce235f628706a6.tar.xz
rt.equinox.framework-3f5244566860943ad1edda436cce235f628706a6.zip
Clean up compile errors and remove Profile classes.
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.osgi/META-INF/MANIFEST.MF9
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java33
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java15
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ObjectPool.java19
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/baseadaptor/AdaptorUtil.java31
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/AliasMapper.java11
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java12
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java162
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/profile/DefaultProfileLogger.java392
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/profile/Profile.java269
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/profile/ProfileLogger.java42
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/FilteredServiceListener.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java5
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/storagemanager/StorageManager.java9
17 files changed, 108 insertions, 909 deletions
diff --git a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
index cb0be2e9b..b2751ee3a 100644
--- a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
@@ -2,21 +2,15 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Export-Package: org.eclipse.core.runtime.adaptor;x-friends:="org.eclipse.core.runtime",
org.eclipse.core.runtime.internal.adaptor;x-internal:=true,
- org.eclipse.core.runtime.internal.stats;x-friends:="org.eclipse.core.runtime",
org.eclipse.equinox.log;version="1.0",
org.eclipse.equinox.log.internal;x-internal:=true,
- org.eclipse.osgi.baseadaptor;x-internal:=true,
- org.eclipse.osgi.baseadaptor.hooks;x-internal:=true,
org.eclipse.osgi.container;version="1.0",
org.eclipse.osgi.container.builders;version="1.0",
org.eclipse.osgi.container.namespaces;version="1.0",
- org.eclipse.osgi.event;version="1.0",
org.eclipse.osgi.framework.adaptor;x-internal:=true,
org.eclipse.osgi.framework.console;version="1.1",
org.eclipse.osgi.framework.eventmgr;version="1.2",
org.eclipse.osgi.framework.internal.core;x-internal:=true,
- org.eclipse.osgi.framework.internal.protocol.bundleentry;x-internal:=true,
- org.eclipse.osgi.framework.internal.protocol.bundleresource;x-internal:=true,
org.eclipse.osgi.framework.internal.reliablefile;x-internal:=true,
org.eclipse.osgi.framework.log;version="1.1",
org.eclipse.osgi.framework.util;x-internal:=true,
@@ -31,8 +25,6 @@ Export-Package: org.eclipse.core.runtime.adaptor;x-friends:="org.eclipse.core.ru
org.eclipse.osgi.internal.module;x-internal:=true,
org.eclipse.osgi.internal.permadmin;x-internal:=true,
org.eclipse.osgi.internal.profile;x-internal:=true,
- org.eclipse.osgi.internal.provisional.service.security;version="1.0.0";x-friends:="org.eclipse.equinox.security.ui",
- org.eclipse.osgi.internal.provisional.verifier;x-friends:="org.eclipse.update.core,org.eclipse.ui.workbench,org.eclipse.equinox.p2.artifact.repository",
org.eclipse.osgi.internal.resolver;x-internal:=true,
org.eclipse.osgi.internal.service.security;x-friends:="org.eclipse.equinox.security.ui",
org.eclipse.osgi.internal.serviceregistry;x-internal:=true,
@@ -43,7 +35,6 @@ Export-Package: org.eclipse.core.runtime.adaptor;x-friends:="org.eclipse.core.ru
org.eclipse.osgi.service.debug;version="1.2",
org.eclipse.osgi.service.environment;version="1.3",
org.eclipse.osgi.service.localization;version="1.1",
- org.eclipse.osgi.service.pluginconversion;version="1.0",
org.eclipse.osgi.service.resolver;version="1.6",
org.eclipse.osgi.service.runnable;version="1.1",
org.eclipse.osgi.service.security;version="1.0",
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
index fd6b66296..bf47b0c10 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
@@ -26,7 +26,6 @@ import org.eclipse.osgi.framework.util.FilePath;
import org.eclipse.osgi.internal.framework.EquinoxConfiguration;
import org.eclipse.osgi.internal.framework.EquinoxContainer;
import org.eclipse.osgi.internal.location.*;
-import org.eclipse.osgi.internal.profile.Profile;
import org.eclipse.osgi.launch.Equinox;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.service.environment.EnvironmentInfo;
@@ -212,8 +211,6 @@ public class EclipseStarter {
* @throws Exception if anything goes wrong
*/
public static Object run(String[] args, Runnable endSplashHandler) throws Exception {
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logEnter("EclipseStarter.run()", null); //$NON-NLS-1$
if (running)
throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ALREADY_RUNNING);
boolean startupFailed = true;
@@ -250,14 +247,6 @@ public class EclipseStarter {
// TODO desperate measure - ideally, we should write this to disk (a la Main.log)
e.printStackTrace();
}
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logExit("EclipseStarter.run()"); //$NON-NLS-1$
- if (Profile.PROFILE) {
- String report = Profile.getProfileLog();
- // avoiding writing to the console if there is nothing to print
- if (report != null && report.length() > 0)
- System.out.println(report);
- }
}
// we only get here if an error happened
if (getProperty(PROP_EXITCODE) == null) {
@@ -287,16 +276,10 @@ public class EclipseStarter {
* @throws Exception if anything goes wrong
*/
public static BundleContext startup(String[] args, Runnable endSplashHandler) throws Exception {
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logEnter("EclipseStarter.startup()", null); //$NON-NLS-1$
if (running)
throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ALREADY_RUNNING);
processCommandLine(args);
finalizeProperties();
- if (Profile.PROFILE)
- Profile.initProps(); // catch any Profile properties set in eclipse.properties...
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logTime("EclipseStarter.startup()", "props inited"); //$NON-NLS-1$ //$NON-NLS-2$
framework = new Equinox(configuration);
framework.init();
context = framework.getBundleContext();
@@ -304,17 +287,10 @@ public class EclipseStarter {
log = context.getService(logRef);
ServiceReference<EnvironmentInfo> configRef = context.getServiceReference(EnvironmentInfo.class);
equinoxConfig = (EquinoxConfiguration) context.getService(configRef);
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logTime("EclipseStarter.startup()", "OSGi created"); //$NON-NLS-1$ //$NON-NLS-2$
registerFrameworkShutdownHandlers();
publishSplashScreen(endSplashHandler);
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logTime("EclipseStarter.startup()", "osgi launched"); //$NON-NLS-1$ //$NON-NLS-2$
consoleMgr = ConsoleManager.startConsole(context);
- if (Profile.PROFILE && Profile.STARTUP) {
- Profile.logTime("EclipseStarter.startup()", "console started"); //$NON-NLS-1$ //$NON-NLS-2$
- }
Bundle[] startBundles = loadBasicBundles();
@@ -323,14 +299,9 @@ public class EclipseStarter {
return context; // cannot continue; loadBasicBundles caused refreshPackages to shutdown the framework
}
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logTime("EclipseStarter.startup()", "loading basic bundles"); //$NON-NLS-1$ //$NON-NLS-2$
-
// set the framework start level to the ultimate value. This will actually start things
// running if they are persistently active.
setStartLevel(getStartLevel());
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logTime("EclipseStarter.startup()", "StartLevel set"); //$NON-NLS-1$ //$NON-NLS-2$
// they should all be active by this time
ensureBundlesActive(startBundles);
@@ -343,8 +314,6 @@ public class EclipseStarter {
}
// TODO should log unresolved bundles if in debug or dev mode
running = true;
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logExit("EclipseStarter.startup()"); //$NON-NLS-1$
return context;
}
@@ -373,8 +342,6 @@ public class EclipseStarter {
* @throws Exception if anything goes wrong
*/
public static Object run(Object argument) throws Exception {
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logEnter("EclipseStarter.run(Object)()", null); //$NON-NLS-1$
if (!running)
throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_NOT_RUNNING);
// if we are just initializing, do not run the application just return.
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java
index 9ac29d38d..63abe9fe3 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java
@@ -12,7 +12,6 @@ package org.eclipse.core.runtime.internal.adaptor;
import java.lang.reflect.Method;
import org.eclipse.core.runtime.adaptor.EclipseStarter;
-import org.eclipse.core.runtime.internal.stats.StatsManager;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
import org.eclipse.osgi.service.runnable.StartupMonitor;
@@ -62,7 +61,6 @@ public class DefaultStartupMonitor implements StartupMonitor {
long time = timeString == null ? 0L : Long.parseLong(timeString);
System.out.println("Application Started: " + (System.currentTimeMillis() - time)); //$NON-NLS-1$
}
- StatsManager.doneBooting();
splashHandler.run();
}
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java
index faefac797..7bd75b156 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java
@@ -11,17 +11,14 @@
package org.eclipse.core.runtime.internal.adaptor;
-import org.eclipse.osgi.internal.location.EclipseAdaptorMsg;
-
import java.lang.reflect.Method;
import java.util.Map;
import org.eclipse.core.runtime.adaptor.EclipseStarter;
-import org.eclipse.osgi.framework.adaptor.FrameworkAdaptor;
-import org.eclipse.osgi.framework.internal.core.Constants;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
import org.eclipse.osgi.framework.log.FrameworkLog;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;
-import org.eclipse.osgi.internal.profile.Profile;
+import org.eclipse.osgi.internal.framework.EquinoxContainer;
+import org.eclipse.osgi.internal.location.EclipseAdaptorMsg;
import org.eclipse.osgi.service.runnable.*;
import org.osgi.framework.*;
@@ -83,9 +80,9 @@ public class EclipseAppLauncher implements ApplicationLauncher {
if (!relaunch || (context.getBundle().getState() & Bundle.ACTIVE) == 0)
throw e;
if (log != null)
- log.log(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, EclipseAdaptorMsg.ECLIPSE_STARTUP_APP_ERROR, 1, e, null));
+ log.log(new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, EclipseAdaptorMsg.ECLIPSE_STARTUP_APP_ERROR, 1, e, null));
}
- doRelaunch = (relaunch && (context.getBundle().getState() & Bundle.ACTIVE) != 0) || FrameworkProperties.getProperty(Constants.PROP_OSGI_RELAUNCH) != null;
+ doRelaunch = (relaunch && (context.getBundle().getState() & Bundle.ACTIVE) != 0);
} while (doRelaunch);
return result;
}
@@ -105,14 +102,10 @@ public class EclipseAppLauncher implements ApplicationLauncher {
long time = timeString == null ? 0L : Long.parseLong(timeString);
System.out.println("Starting application: " + (System.currentTimeMillis() - time)); //$NON-NLS-1$
}
- if (Profile.PROFILE && (Profile.STARTUP || Profile.BENCHMARK))
- Profile.logTime("EclipseStarter.run(Object)()", "framework initialized! starting application..."); //$NON-NLS-1$ //$NON-NLS-2$
try {
// run the actual application on the current thread (main).
return runnable.run(appContext != null ? appContext : defaultContext);
} finally {
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logExit("EclipseStarter.run(Object)()"); //$NON-NLS-1$
// free the runnable application and release the lock to allow another app to be launched.
runnable = null;
appContext = null;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ObjectPool.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ObjectPool.java
index bcb548044..93cb64511 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ObjectPool.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ObjectPool.java
@@ -10,29 +10,18 @@
*******************************************************************************/
package org.eclipse.osgi.framework.util;
-import org.eclipse.osgi.internal.debug.Debug;
-import org.eclipse.osgi.internal.debug.FrameworkDebugOptions;
-
import java.lang.ref.WeakReference;
import java.util.Map;
import java.util.WeakHashMap;
+import org.eclipse.osgi.internal.debug.Debug;
public class ObjectPool {
private static String OPTION_DEBUG_OBJECTPOOL_ADDS = Debug.ECLIPSE_OSGI + "/debug/objectPool/adds"; //$NON-NLS-1$
private static String OPTION_DEBUG_OBJECTPOOL_DUPS = Debug.ECLIPSE_OSGI + "/debug/objectPool/dups"; //$NON-NLS-1$
- private static final boolean DEBUG_OBJECTPOOL_ADDS;
- private static final boolean DEBUG_OBJECTPOOL_DUPS;
+ // TODO need to set these
+ private static final boolean DEBUG_OBJECTPOOL_ADDS = false;
+ private static final boolean DEBUG_OBJECTPOOL_DUPS = false;
private static Map<Object, WeakReference<Object>> objectCache = new WeakHashMap<Object, WeakReference<Object>>();
- static {
- FrameworkDebugOptions dbgOptions = FrameworkDebugOptions.getDefault();
- if (dbgOptions != null) {
- DEBUG_OBJECTPOOL_ADDS = dbgOptions.getBooleanOption(OPTION_DEBUG_OBJECTPOOL_ADDS, false);
- DEBUG_OBJECTPOOL_DUPS = dbgOptions.getBooleanOption(OPTION_DEBUG_OBJECTPOOL_DUPS, false);
- } else {
- DEBUG_OBJECTPOOL_ADDS = false;
- DEBUG_OBJECTPOOL_DUPS = false;
- }
- }
public static Object intern(Object obj) {
synchronized (objectCache) {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/baseadaptor/AdaptorUtil.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/baseadaptor/AdaptorUtil.java
index c0581acca..5f61ccaf8 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/baseadaptor/AdaptorUtil.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/baseadaptor/AdaptorUtil.java
@@ -11,10 +11,6 @@
package org.eclipse.osgi.internal.baseadaptor;
-import org.eclipse.osgi.internal.debug.Debug;
-
-import org.eclipse.osgi.internal.location.EclipseAdaptorMsg;
-
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -22,11 +18,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.Dictionary;
import java.util.Hashtable;
-import org.eclipse.osgi.baseadaptor.BaseData;
-import org.eclipse.osgi.framework.internal.core.Constants;
-import org.eclipse.osgi.framework.util.Headers;
-import org.eclipse.osgi.framework.util.ObjectPool;
-import org.eclipse.osgi.util.NLS;
+import org.eclipse.osgi.internal.debug.Debug;
import org.osgi.framework.*;
/**
@@ -159,16 +151,6 @@ public class AdaptorUtil {
}
}
- public static Version loadVersion(DataInputStream in) throws IOException {
- String versionString = readString(in, false);
- try {
- //return Version.parseVersion(versionString);
- return (Version) ObjectPool.intern(Version.parseVersion(versionString));
- } catch (IllegalArgumentException e) {
- return new InvalidVersion(versionString);
- }
- }
-
/**
* Register a service object.
* @param name the service class name
@@ -185,17 +167,6 @@ public class AdaptorUtil {
return context.registerService(name, service, properties);
}
- public static Dictionary<String, String> loadManifestFrom(BaseData bundledata) throws BundleException {
- URL url = bundledata.getEntry(Constants.OSGI_BUNDLE_MANIFEST);
- if (url == null)
- return null;
- try {
- return Headers.parseManifest(url.openStream());
- } catch (IOException e) {
- throw new BundleException(NLS.bind(EclipseAdaptorMsg.ECLIPSE_DATA_ERROR_READING_MANIFEST, bundledata.getLocation()), BundleException.MANIFEST_ERROR, e);
- }
- }
-
public static boolean canWrite(File installDir) {
if (installDir.canWrite() == false)
return false;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/AliasMapper.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/AliasMapper.java
index eb0bb7a6e..bd858f00c 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/AliasMapper.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/AliasMapper.java
@@ -10,13 +10,10 @@
*******************************************************************************/
package org.eclipse.osgi.internal.framework;
-import org.eclipse.osgi.framework.internal.core.Constants;
-import org.eclipse.osgi.framework.internal.core.Tokenizer;
-
-import org.eclipse.osgi.internal.debug.Debug;
-
import java.io.*;
import java.util.*;
+import org.eclipse.osgi.framework.internal.core.Tokenizer;
+import org.eclipse.osgi.internal.debug.Debug;
/**
* This class maps aliases.
@@ -28,7 +25,7 @@ public class AliasMapper {
// Safe lazy initialization
private static synchronized Map<String, Object> getProcessorAliasTable() {
if (processorAliasTable == null) {
- InputStream in = AliasMapper.class.getResourceAsStream(Constants.OSGI_PROCESSOR_ALIASES);
+ InputStream in = AliasMapper.class.getResourceAsStream("processor.aliases"); //$NON-NLS-1$
if (in != null) {
try {
processorAliasTable = initAliases(in);
@@ -47,7 +44,7 @@ public class AliasMapper {
// Safe lazy initialization
private static synchronized Map<String, Object> getOSNameAliasTable() {
if (osnameAliasTable == null) {
- InputStream in = AliasMapper.class.getResourceAsStream(Constants.OSGI_OSNAME_ALIASES);
+ InputStream in = AliasMapper.class.getResourceAsStream("osname.aliases"); //$NON-NLS-1$
if (in != null) {
try {
osnameAliasTable = initAliases(in);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java
index 9d738430d..ea940cead 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java
@@ -21,7 +21,6 @@ import org.eclipse.osgi.container.namespaces.EquinoxModuleDataNamespace;
import org.eclipse.osgi.framework.eventmgr.EventDispatcher;
import org.eclipse.osgi.framework.internal.core.Msg;
import org.eclipse.osgi.internal.loader.BundleLoader;
-import org.eclipse.osgi.internal.profile.Profile;
import org.eclipse.osgi.internal.serviceregistry.*;
import org.eclipse.osgi.next.internal.debug.Debug;
import org.eclipse.osgi.storage.BundleInfo.Generation;
@@ -753,14 +752,10 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object,
* @param bundleActivator that activator to start
*/
private void startActivator(final BundleActivator bundleActivator) throws BundleException {
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logEnter("BundleContextImpl.startActivator()", null); //$NON-NLS-1$
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
public Object run() throws Exception {
if (bundleActivator != null) {
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logTime("BundleContextImpl.startActivator()", "calling " + bundle.getLocation() + " bundle activator"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
// make sure the context class loader is set correctly
Object previousTCCL = setContextFinder();
/* Start the bundle synchronously */
@@ -770,8 +765,6 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object,
if (previousTCCL != Boolean.FALSE)
Thread.currentThread().setContextClassLoader((ClassLoader) previousTCCL);
}
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logTime("BundleContextImpl.startActivator()", "returned from " + bundle.getLocation() + " bundle activator"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
}
return null;
}
@@ -789,9 +782,6 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object,
clazz = bundleActivator.getClass().getName();
throw new BundleException(NLS.bind(Msg.BUNDLE_ACTIVATOR_EXCEPTION, new Object[] {clazz, "start", bundle.getSymbolicName() == null ? "" + bundle.getBundleId() : bundle.getSymbolicName()}), BundleException.ACTIVATOR_ERROR, t); //$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- if (Profile.PROFILE && Profile.STARTUP)
- Profile.logExit("BundleContextImpl.startActivator()"); //$NON-NLS-1$
}
}
@@ -957,7 +947,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object,
public Filter createFilter(String filter) throws InvalidSyntaxException {
checkValid();
- return FilterImpl.newInstance(filter);
+ return FilterImpl.newInstance(filter, container.getConfiguration().getDebug().DEBUG_FILTER);
}
/**
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java
index 1d021ebc1..dbe673003 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java
@@ -15,11 +15,11 @@ import java.lang.reflect.Method;
import java.net.*;
import java.security.CodeSource;
import java.util.*;
+import org.eclipse.osgi.internal.debug.FrameworkDebugOptions;
import org.eclipse.osgi.internal.hookregistry.HookRegistry;
import org.eclipse.osgi.internal.location.EclipseAdaptorMsg;
import org.eclipse.osgi.internal.location.EquinoxLocations;
import org.eclipse.osgi.next.internal.debug.Debug;
-import org.eclipse.osgi.next.internal.debug.FrameworkDebugOptions;
import org.eclipse.osgi.service.debug.DebugOptions;
import org.eclipse.osgi.service.environment.Constants;
import org.eclipse.osgi.service.environment.EnvironmentInfo;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
index bce85ceb7..032391dc8 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
@@ -11,16 +11,13 @@
package org.eclipse.osgi.internal.framework;
-import org.eclipse.osgi.framework.internal.core.Constants;
-import org.eclipse.osgi.framework.internal.core.Msg;
-
-import org.eclipse.osgi.internal.debug.Debug;
-
import java.lang.reflect.*;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.*;
+import org.eclipse.osgi.framework.internal.core.Msg;
import org.eclipse.osgi.framework.util.Headers;
+import org.eclipse.osgi.internal.debug.Debug;
import org.eclipse.osgi.internal.serviceregistry.ServiceReferenceImpl;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.*;
@@ -143,7 +140,11 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
* an invalid filter string that cannot be parsed.
*/
public static FilterImpl newInstance(String filterString) throws InvalidSyntaxException {
- return new Parser(filterString).parse();
+ return newInstance(filterString, false);
+ }
+
+ public static FilterImpl newInstance(String filterString, boolean debug) throws InvalidSyntaxException {
+ return new Parser(filterString, debug).parse();
}
/**
@@ -237,7 +238,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
}
case PRESENT : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("PRESENT(" + attr + ")"); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -303,7 +304,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
}
case PRESENT : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("PRESENT(" + attr + ")"); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -483,14 +484,17 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private final String attr;
/** filter operands */
private final Object value;
+ /** debug mode */
+ private final boolean debug;
/* normalized filter string for topLevel Filter object */
private transient volatile String filterString;
- FilterImpl(int operation, String attr, Object value) {
+ FilterImpl(int operation, String attr, Object value, boolean debug) {
this.op = operation;
this.attr = attr;
this.value = value;
+ this.debug = debug;
}
/**
@@ -534,7 +538,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private boolean compare(int operation, Object value1, Object value2) {
if (value1 == null) {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("compare(" + value1 + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -712,7 +716,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private boolean compare_String(int operation, String string, Object value2) {
switch (operation) {
case SUBSTRING : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("SUBSTRING(" + string + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -728,7 +732,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
if (substr2 == null) /* ** */
continue; /* ignore first star */
/* *xxx */
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("indexOf(\"" + substr2 + "\"," + pos + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
int index = string.indexOf(substr2, pos);
@@ -742,7 +746,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
} else /* xxx */{
int len = substr.length();
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("regionMatches(" + pos + ",\"" + substr + "\")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
if (string.regionMatches(pos, substr, 0, len)) {
@@ -756,7 +760,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
return true;
}
/* xxx */
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("regionMatches(" + pos + "," + substr + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return string.endsWith(substr);
@@ -766,13 +770,13 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
return true;
}
case EQUAL : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("EQUAL(" + string + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return string.equals(value2);
}
case APPROX : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("APPROX(" + string + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -782,13 +786,13 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
return string.equalsIgnoreCase(string2);
}
case GREATER : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("GREATER(" + string + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return string.compareTo((String) value2) >= 0;
}
case LESS : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("LESS(" + string + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return string.compareTo((String) value2) <= 0;
@@ -800,7 +804,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private boolean compare_Integer(int operation, int intval, Object value2) {
if (operation == SUBSTRING) {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("SUBSTRING(" + intval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return false;
@@ -814,25 +818,25 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
}
switch (operation) {
case EQUAL : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("EQUAL(" + intval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return intval == intval2;
}
case APPROX : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("APPROX(" + intval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return intval == intval2;
}
case GREATER : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("GREATER(" + intval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return intval >= intval2;
}
case LESS : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("LESS(" + intval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return intval <= intval2;
@@ -844,7 +848,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private boolean compare_Long(int operation, long longval, Object value2) {
if (operation == SUBSTRING) {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("SUBSTRING(" + longval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return false;
@@ -858,25 +862,25 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
}
switch (operation) {
case EQUAL : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("EQUAL(" + longval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return longval == longval2;
}
case APPROX : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("APPROX(" + longval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return longval == longval2;
}
case GREATER : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("GREATER(" + longval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return longval >= longval2;
}
case LESS : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("LESS(" + longval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return longval <= longval2;
@@ -888,7 +892,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private boolean compare_Byte(int operation, byte byteval, Object value2) {
if (operation == SUBSTRING) {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("SUBSTRING(" + byteval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return false;
@@ -902,25 +906,25 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
}
switch (operation) {
case EQUAL : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("EQUAL(" + byteval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return byteval == byteval2;
}
case APPROX : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("APPROX(" + byteval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return byteval == byteval2;
}
case GREATER : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("GREATER(" + byteval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return byteval >= byteval2;
}
case LESS : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("LESS(" + byteval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return byteval <= byteval2;
@@ -932,7 +936,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private boolean compare_Short(int operation, short shortval, Object value2) {
if (operation == SUBSTRING) {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("SUBSTRING(" + shortval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return false;
@@ -946,25 +950,25 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
}
switch (operation) {
case EQUAL : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("EQUAL(" + shortval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return shortval == shortval2;
}
case APPROX : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("APPROX(" + shortval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return shortval == shortval2;
}
case GREATER : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("GREATER(" + shortval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return shortval >= shortval2;
}
case LESS : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("LESS(" + shortval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return shortval <= shortval2;
@@ -976,7 +980,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private boolean compare_Character(int operation, char charval, Object value2) {
if (operation == SUBSTRING) {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("SUBSTRING(" + charval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return false;
@@ -990,25 +994,25 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
}
switch (operation) {
case EQUAL : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("EQUAL(" + charval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return charval == charval2;
}
case APPROX : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("APPROX(" + charval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return (charval == charval2) || (Character.toUpperCase(charval) == Character.toUpperCase(charval2)) || (Character.toLowerCase(charval) == Character.toLowerCase(charval2));
}
case GREATER : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("GREATER(" + charval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return charval >= charval2;
}
case LESS : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("LESS(" + charval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return charval <= charval2;
@@ -1020,7 +1024,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private boolean compare_Boolean(int operation, boolean boolval, Object value2) {
if (operation == SUBSTRING) {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("SUBSTRING(" + boolval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return false;
@@ -1029,25 +1033,25 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
boolean boolval2 = Boolean.valueOf(((String) value2).trim()).booleanValue();
switch (operation) {
case EQUAL : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("EQUAL(" + boolval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return boolval == boolval2;
}
case APPROX : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("APPROX(" + boolval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return boolval == boolval2;
}
case GREATER : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("GREATER(" + boolval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return boolval == boolval2;
}
case LESS : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("LESS(" + boolval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return boolval == boolval2;
@@ -1059,7 +1063,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private boolean compare_Float(int operation, float floatval, Object value2) {
if (operation == SUBSTRING) {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("SUBSTRING(" + floatval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return false;
@@ -1073,25 +1077,25 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
}
switch (operation) {
case EQUAL : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("EQUAL(" + floatval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return Float.compare(floatval, floatval2) == 0;
}
case APPROX : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("APPROX(" + floatval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return Float.compare(floatval, floatval2) == 0;
}
case GREATER : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("GREATER(" + floatval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return Float.compare(floatval, floatval2) >= 0;
}
case LESS : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("LESS(" + floatval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return Float.compare(floatval, floatval2) <= 0;
@@ -1103,7 +1107,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private boolean compare_Double(int operation, double doubleval, Object value2) {
if (operation == SUBSTRING) {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("SUBSTRING(" + doubleval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return false;
@@ -1117,25 +1121,25 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
}
switch (operation) {
case EQUAL : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("EQUAL(" + doubleval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return Double.compare(doubleval, doubleval2) == 0;
}
case APPROX : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("APPROX(" + doubleval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return Double.compare(doubleval, doubleval2) == 0;
}
case GREATER : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("GREATER(" + doubleval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return Double.compare(doubleval, doubleval2) >= 0;
}
case LESS : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("LESS(" + doubleval + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return Double.compare(doubleval, doubleval2) <= 0;
@@ -1195,7 +1199,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private boolean compare_Comparable(int operation, Comparable<Object> value1, Object value2) {
if (operation == SUBSTRING) {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("SUBSTRING(" + value1 + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return false;
@@ -1208,25 +1212,25 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
try {
switch (operation) {
case EQUAL : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("EQUAL(" + value1 + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return value1.compareTo(value2) == 0;
}
case APPROX : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("APPROX(" + value1 + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return value1.compareTo(value2) == 0;
}
case GREATER : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("GREATER(" + value1 + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return value1.compareTo(value2) >= 0;
}
case LESS : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("LESS(" + value1 + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return value1.compareTo(value2) <= 0;
@@ -1241,7 +1245,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
private boolean compare_Unknown(int operation, Object value1, Object value2) { //RFC 59
if (operation == SUBSTRING) {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("SUBSTRING(" + value1 + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return false;
@@ -1254,25 +1258,25 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
try {
switch (operation) {
case EQUAL : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("EQUAL(" + value1 + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return value1.equals(value2);
}
case APPROX : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("APPROX(" + value1 + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return value1.equals(value2);
}
case GREATER : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("GREATER(" + value1 + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return value1.equals(value2);
}
case LESS : {
- if (Debug.DEBUG_FILTER) {
+ if (debug) {
Debug.println("LESS(" + value1 + "," + value2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return value1.equals(value2);
@@ -1385,11 +1389,13 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
* objects rooted at the parent.
*/
private static class Parser {
+ private final boolean debug;
private final String filterstring;
private final char[] filterChars;
private int pos;
- Parser(String filterstring) {
+ Parser(String filterstring, boolean debug) {
+ this.debug = debug;
this.filterstring = filterstring;
filterChars = filterstring.toCharArray();
pos = 0;
@@ -1472,7 +1478,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
operands.add(child);
}
- return new FilterImpl(FilterImpl.AND, null, operands.toArray(new FilterImpl[operands.size()]));
+ return new FilterImpl(FilterImpl.AND, null, operands.toArray(new FilterImpl[operands.size()]), debug);
}
private FilterImpl parse_or() throws InvalidSyntaxException {
@@ -1491,7 +1497,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
operands.add(child);
}
- return new FilterImpl(FilterImpl.OR, null, operands.toArray(new FilterImpl[operands.size()]));
+ return new FilterImpl(FilterImpl.OR, null, operands.toArray(new FilterImpl[operands.size()]), debug);
}
private FilterImpl parse_not() throws InvalidSyntaxException {
@@ -1505,7 +1511,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
FilterImpl child = parse_filter();
- return new FilterImpl(FilterImpl.NOT, null, child);
+ return new FilterImpl(FilterImpl.NOT, null, child, debug);
}
private FilterImpl parse_item() throws InvalidSyntaxException {
@@ -1517,21 +1523,21 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
case '~' : {
if (filterChars[pos + 1] == '=') {
pos += 2;
- return new FilterImpl(FilterImpl.APPROX, attr, parse_value());
+ return new FilterImpl(FilterImpl.APPROX, attr, parse_value(), debug);
}
break;
}
case '>' : {
if (filterChars[pos + 1] == '=') {
pos += 2;
- return new FilterImpl(FilterImpl.GREATER, attr, parse_value());
+ return new FilterImpl(FilterImpl.GREATER, attr, parse_value(), debug);
}
break;
}
case '<' : {
if (filterChars[pos + 1] == '=') {
pos += 2;
- return new FilterImpl(FilterImpl.LESS, attr, parse_value());
+ return new FilterImpl(FilterImpl.LESS, attr, parse_value(), debug);
}
break;
}
@@ -1541,7 +1547,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
pos += 2;
skipWhiteSpace();
if (filterChars[pos] == ')') {
- return new FilterImpl(FilterImpl.PRESENT, attr, null);
+ return new FilterImpl(FilterImpl.PRESENT, attr, null, debug);
}
pos = oldpos;
}
@@ -1550,9 +1556,9 @@ public class FilterImpl implements Filter /* since Framework 1.1 */{
Object string = parse_substring();
if (string instanceof String) {
- return new FilterImpl(FilterImpl.EQUAL, attr, string);
+ return new FilterImpl(FilterImpl.EQUAL, attr, string, debug);
}
- return new FilterImpl(FilterImpl.SUBSTRING, attr, string);
+ return new FilterImpl(FilterImpl.SUBSTRING, attr, string, debug);
}
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java
index 88873b419..5792d0657 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java
@@ -14,12 +14,12 @@ package org.eclipse.osgi.internal.framework;
import java.util.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.SAXParserFactory;
+import org.eclipse.osgi.internal.debug.FrameworkDebugOptions;
import org.eclipse.osgi.internal.hookregistry.ActivatorHookFactory;
import org.eclipse.osgi.internal.hookregistry.HookRegistry;
import org.eclipse.osgi.internal.location.EquinoxLocations;
import org.eclipse.osgi.internal.permadmin.SecurityAdmin;
import org.eclipse.osgi.internal.url.EquinoxFactoryManager;
-import org.eclipse.osgi.next.internal.debug.FrameworkDebugOptions;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.service.debug.DebugOptions;
import org.eclipse.osgi.service.environment.EnvironmentInfo;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/profile/DefaultProfileLogger.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/profile/DefaultProfileLogger.java
deleted file mode 100644
index a868194e9..000000000
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/profile/DefaultProfileLogger.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.osgi.internal.profile;
-
-import org.eclipse.osgi.internal.debug.FrameworkDebugOptions;
-
-import java.io.*;
-import java.util.*;
-import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
-
-public class DefaultProfileLogger implements ProfileLogger {
- protected static final String DEFAULTPROFILE_PROP = "osgi.defaultprofile."; //$NON-NLS-1$
- protected static final String PROP_FILENAME = DEFAULTPROFILE_PROP + "logfilename"; //$NON-NLS-1$
- protected static final String PROP_LOGSYNCHRONOUSLY = DEFAULTPROFILE_PROP + "logsynchronously"; //$NON-NLS-1$
- protected static final String PROP_BUFFERSIZE = DEFAULTPROFILE_PROP + "buffersize"; //$NON-NLS-1$
-
- protected static final String DEFAULTPROFILE_OPTION = "org.eclipse.osgi/defaultprofile/"; //$NON-NLS-1$
- protected static final String OPTION_FILENAME = DEFAULTPROFILE_OPTION + "logfilename"; //$NON-NLS-1$
- protected static final String OPTION_LOGSYNCHRONOUSLY = DEFAULTPROFILE_OPTION + "logsynchronously"; //$NON-NLS-1$
- protected static final String OPTION_BUFFERSIZE = DEFAULTPROFILE_OPTION + "buffersize"; //$NON-NLS-1$
-
- protected boolean logSynchronously = false;
- protected long startTime = 0;
- protected static final int DEFAULT_BUFFER_SIZE = 256;
-
- protected TimeEntry[] timeLogEntries = null;
- protected int timeEntriesIndex = 0;
- protected StringBuffer timelog = null;
-
- protected long launchTime = -1;
- protected int bufferSize = DEFAULT_BUFFER_SIZE;
- protected String logFileName = null;
- protected File logFile = null;
- private StringBuffer entryReport = new StringBuffer(120);
- private StringBuffer padsb = new StringBuffer(16); // to prevent creating this over and over
- protected int indent;
- protected int timePaddingLength;
- protected Stack<AccumPerfScope> scopeStack;
- protected Map<String, AccumPerfData> scopeToAccumPerfDataMap;
-
- public DefaultProfileLogger() {
- initProps();
-
- int size = getBufferSize();
- timeLogEntries = new TimeEntry[size];
- timelog = new StringBuffer(4096);
- for (int i = 0; i < size; i++) {
- timeLogEntries[i] = timeEntryFactory();
- }
- timeEntriesIndex = 0;
-
- launchTime = getLaunchTime();
- if (launchTime == -1) {
- startTime = getMainStartTime();
- } else {
- startTime = launchTime;
- }
-
- long freq = getTimerFrequency();
- for (timePaddingLength = 3; freq > 9; timePaddingLength++) {
- freq /= 10;
- }
-
- logInitMessages();
- }
-
- protected void logInitMessages() {
- int index = 0;
- if (launchTime != -1L) {
- logTime(Profile.FLAG_NONE, "DefaultProfileLogger.init()", "launch time initialized", null); //$NON-NLS-1$//$NON-NLS-2$
- timeLogEntries[index++].time = launchTime;
- }
-
- logTime(Profile.FLAG_NONE, "DefaultProfileLogger.init()", "start time initialized", null); //$NON-NLS-1$//$NON-NLS-2$
- timeLogEntries[index++].time = getMainStartTime();
- }
-
- protected long getLaunchTime() {
- String launchTimeString = FrameworkProperties.getProperty("launch.startMillis"); //$NON-NLS-1$
- if (launchTimeString != null) {
- return Long.parseLong(launchTimeString);
- }
- return -1L;
- }
-
- protected long getMainStartTime() {
- String timeString = FrameworkProperties.getProperty("eclipse.startTime"); //$NON-NLS-1$
- if (timeString != null)
- return Long.parseLong(timeString);
-
- return System.currentTimeMillis();
- }
-
- public void initProps() {
- String prop;
- FrameworkDebugOptions dbgOptions = null;
- // if osgi.debug is not available, don't force DebugOptions
- // to init as this variable may be set later on where
- // DebugOptions will succeed.
- if (FrameworkProperties.getProperty("osgi.debug") != null) { //$NON-NLS-1$
- dbgOptions = FrameworkDebugOptions.getDefault();
- if (dbgOptions != null) {
- logFileName = dbgOptions.getOption(OPTION_FILENAME);
- logSynchronously = dbgOptions.getBooleanOption(OPTION_LOGSYNCHRONOUSLY, false);
- int size = dbgOptions.getIntegerOption(OPTION_BUFFERSIZE, 0);
- if (size > 0)
- bufferSize = size;
- }
- }
-
- if ((prop = FrameworkProperties.getProperty(PROP_FILENAME)) != null) {
- logFileName = prop;
- if (dbgOptions != null)
- dbgOptions.setOption(OPTION_FILENAME, logFileName);
- }
- if ((prop = FrameworkProperties.getProperty(PROP_LOGSYNCHRONOUSLY)) != null) {
- logSynchronously = Boolean.valueOf(prop).booleanValue();
- if (dbgOptions != null)
- dbgOptions.setOption(OPTION_LOGSYNCHRONOUSLY, new Boolean(logSynchronously).toString());
- }
- if ((prop = FrameworkProperties.getProperty(PROP_BUFFERSIZE)) != null) {
- try {
- int value = Integer.parseInt(prop);
- if (value > 0) {
- bufferSize = value;
- if (dbgOptions != null)
- dbgOptions.setOption(OPTION_BUFFERSIZE, Integer.toString(bufferSize));
- }
- } catch (NumberFormatException e) {
- // do nothing
- }
- }
- }
-
- public synchronized void logTime(int flag, String id, String msg, String description) {
- if (timeEntriesIndex == timeLogEntries.length) {
- makeLog();
- logTime(Profile.FLAG_NONE, "Profile.logTime()", "log entries rolled", null); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- TimeEntry entry = timeLogEntries[timeEntriesIndex++];
- entry.time = getTime();
- entry.id = id;
- entry.msg = msg;
- entry.flag = flag;
- entry.description = description;
-
- if (logSynchronously) {
- System.out.print(getProfileLog().substring(2));
- }
- }
-
- public synchronized String getProfileLog() {
- String log;
- log = getProfileLogReport();
- writeToProfileLogFile(log);
- return log;
- }
-
- public synchronized void accumLogEnter(String scope) {
- // Initialize our data structures
- if (scopeStack == null)
- scopeStack = new Stack<AccumPerfScope>();
- if (scopeToAccumPerfDataMap == null)
- scopeToAccumPerfDataMap = new TreeMap<String, AccumPerfData>();
-
- // We want getTime() to evaluate as late as possible
- scopeStack.push(new AccumPerfScope(scope, getTime()));
- }
-
- public synchronized void accumLogExit(String scope) {
- // What time is it?
- long exit = getTime();
-
- // Initialize our data structures
- if (scopeStack == null)
- scopeStack = new Stack<AccumPerfScope>();
- if (scopeToAccumPerfDataMap == null)
- scopeToAccumPerfDataMap = new TreeMap<String, AccumPerfData>();
-
- // Do our calculations
- AccumPerfScope then = scopeStack.pop();
- if (then == null)
- System.err.println("ACCUM PERF ERROR: Scope stack empty: " + scope); //$NON-NLS-1$
- else {
- if (!then.scope.equals(scope))
- System.err.println("ACCUM PERF ERROR: Scope mismatch: then='" + then.scope + "', now='" + scope + "'"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
-
- AccumPerfData now = scopeToAccumPerfDataMap.get(scope);
- if (now == null) {
- now = new AccumPerfData(scope);
- scopeToAccumPerfDataMap.put(scope, now);
- }
-
- now.time += exit - then.enter;
- now.enters++;
- }
- }
-
- protected long getTime() {
- return System.currentTimeMillis();
- }
-
- protected long getTimerFrequency() {
- return 1000L; // millisecond
- }
-
- protected TimeEntry findCompareEntry(int index, String id, int flag) {
- if (index > 0)
- index--;
- int prev = index;
- if (flag != Profile.FLAG_ENTER) {
- while (index >= 0) {
- TimeEntry entry = timeLogEntries[index];
- if (entry.id.equals(id)) {
- switch (flag) {
- case Profile.FLAG_NONE :
- return entry;
- case Profile.FLAG_EXIT :
- if (entry.flag == Profile.FLAG_ENTER)
- return entry;
- break;
- }
- }
- index--;
- }
- }
- return timeLogEntries[prev];
- }
-
- protected String entryReport(TimeEntry entry, TimeEntry compareWith) {
- // indent level:
- entryReport.setLength(0);
- if (entry.flag == Profile.FLAG_ENTER)
- indent++;
- long zeroTime = getRelativeTime(getStartTime());
-
- entryReport.append('-');
- long entryTime = getRelativeTime(entry.time);
- long diff = entryTime - zeroTime;
- entryReport.append(pad(Long.toString(diff), timePaddingLength));
- entryReport.append(" :"); //$NON-NLS-1$
- diff = entry.time - compareWith.time;
- entryReport.append(pad(Long.toString(diff), timePaddingLength));
- entryReport.append(pad("", indent * 2)); // indent before displaying the entry.id //$NON-NLS-1$
-
- if (entry.flag == Profile.FLAG_ENTER)
- entryReport.append(" >> "); //$NON-NLS-1$
- else if (entry.flag == Profile.FLAG_EXIT)
- entryReport.append(" << "); //$NON-NLS-1$
- else if (entry.flag == Profile.FLAG_NONE)
- entryReport.append(" -- "); //$NON-NLS-1$
-
- entryReport.append(entry.id);
- entryReport.append(" > "); //$NON-NLS-1$
- entryReport.append(entry.msg);
- if (entry.description != null) {
- entryReport.append(" :: "); //$NON-NLS-1$
- entryReport.append(entry.description);
- }
- entryReport.append("\r\n"); //$NON-NLS-1$
-
- if (entry.flag == Profile.FLAG_EXIT)
- indent -= 1;
- return entryReport.toString();
- }
-
- protected String accumEntryReport(AccumPerfData d) {
- return (" " + d.scope + ":enters=" + d.enters + ";time=" + d.time + ";\r\n"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
- }
-
- protected void makeLog() {
- indent = 0;
- timelog.append("\r\n"); //$NON-NLS-1$
- for (int i = 0; i < timeEntriesIndex; i++) {
- TimeEntry entry = timeLogEntries[i];
- TimeEntry cmpEntry = findCompareEntry(i, entry.id, entry.flag);
- timelog.append(entryReport(entry, cmpEntry));
- }
- timeEntriesIndex = 0;
-
- if (scopeToAccumPerfDataMap == null || scopeToAccumPerfDataMap.isEmpty())
- return; // No data; nothing to do
- timelog.append("\r\n"); //$NON-NLS-1$
- timelog.append("Cumulative Log:\r\n"); //$NON-NLS-1$
- for (AccumPerfData d : scopeToAccumPerfDataMap.values()) {
- timelog.append(accumEntryReport(d));
- }
- scopeToAccumPerfDataMap.clear();
- }
-
- protected String pad(String str, int size) {
- padsb.setLength(0);
- int len = str.length();
- int count = size - len;
- for (int i = 0; i < count; i++)
- padsb.append(' ');
- padsb.append(str);
- return padsb.toString();
- }
-
- protected String getProfileLogReport() {
- if (timelog == null)
- return ""; //$NON-NLS-1$
- makeLog();
- String log = timelog.toString();
- timelog.setLength(0);
- return log;
- }
-
- protected void writeToProfileLogFile(String log) {
- File profileLog = getProfileLogFile();
- if (profileLog == null)
- return;
- FileWriter fw = null;
- try {
- fw = new FileWriter(profileLog.getAbsolutePath(), true);
- fw.write(log);
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- if (fw != null)
- try {
- fw.close();
- } catch (IOException e) {
- // do nothing
- }
- }
- }
-
- protected File getProfileLogFile() {
- if (logFile == null)
- if ((logFileName != null) && (logFileName.length() > 0))
- logFile = new File(logFileName);
- return logFile;
- }
-
- protected long getStartTime() {
- return startTime;
- }
-
- protected long getRelativeTime(long absoluteTime) {
- return absoluteTime;
- }
-
- protected int getBufferSize() {
- if (bufferSize < 2)
- return DEFAULT_BUFFER_SIZE;
- return bufferSize;
- }
-
- protected TimeEntry timeEntryFactory() {
- return new TimeEntry();
- }
-
- protected class TimeEntry {
- public long time;
- public String id;
- public String msg;
- public String description;
- public int flag;
- }
-
- protected static class AccumPerfData {
- public AccumPerfData(String scope) {
- this.scope = scope;
- }
-
- public String scope;
- public long time;
- public long enters;
- }
-
- protected static class AccumPerfScope {
- public AccumPerfScope(String scope, long enter) {
- this.scope = scope;
- this.enter = enter;
- }
-
- public String scope;
- public long enter;
- }
-}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/profile/Profile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/profile/Profile.java
deleted file mode 100644
index 294858bf8..000000000
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/profile/Profile.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.osgi.internal.profile;
-
-import org.eclipse.osgi.internal.debug.FrameworkDebugOptions;
-
-import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
-
-/**
- * This class is a development tool that provides a simple way to log
- * programmer defined timmings for performance evaluations. This profiling
- * allows logging of a timestamp with a corresponding message to a trace
- * buffer.
- */
-
-public class Profile {
- /**
- * Profiling is enabled and available.
- */
- public static final boolean PROFILE = true; // enable profile compiling
- /**
- * The logging state of <tt>STARTUP</tt> messages
- */
- public static boolean STARTUP = false; // enable startup profiling
- /**
- * The logging state of <tt>BENCHMARK</tt> messages
- */
- public static boolean BENCHMARK = false; // enable all benchmarking
- /**
- * The logging state of <tt>DEBUG</tt> messages
- */
- public static boolean DEBUG = false; // enable general debug profiling
-
- private static final String OSGI_PROP = "osgi.profile."; //$NON-NLS-1$
- private static final String PROP_STARTUP = OSGI_PROP + "startup"; //$NON-NLS-1$
- private static final String PROP_BENCHMARK = OSGI_PROP + "benchmark"; //$NON-NLS-1$
- private static final String PROP_DEBUG = OSGI_PROP + "debug"; //$NON-NLS-1$
- private static final String PROP_IMPL = OSGI_PROP + "impl"; //$NON-NLS-1$
-
- private static final String OSGI_OPTION = "org.eclipse.osgi/profile/"; //$NON-NLS-1$
- private static final String OPTION_STARTUP = OSGI_OPTION + "startup"; //$NON-NLS-1$
- private static final String OPTION_BENCHMARK = OSGI_OPTION + "benchmark"; //$NON-NLS-1$
- private static final String OPTION_DEBUG = OSGI_OPTION + "debug"; //$NON-NLS-1$
- private static final String OPTION_IMPL = OSGI_OPTION + "impl"; //$NON-NLS-1$
-
- /**
- * The default logging flag.
- */
- public static final int FLAG_NONE = 0;
- /**
- * The logging flag for <strong>method enter</strong>
- */
- public static final int FLAG_ENTER = 1;
- /**
- * The logging flag for <strong>method exit</strong>
- */
- public static final int FLAG_EXIT = 2;
- /**
- * The description for <strong>method enter</strong>
- */
- public static final String ENTER_DESCRIPTION = "enter"; //$NON-NLS-1$
- /**
- * The description for <strong>method exit</strong>
- */
- public static final String EXIT_DESCRIPTION = "exit"; //$NON-NLS-1$
-
- private static ProfileLogger profileLogger = null;
- private static String profileLoggerClassName = null;
-
- static {
- initProps();
- }
-
- /**
- * Initialize/update profiling properties.
- *
- * If profiling properties are updated, this method is called to update
- * the profile states.
- */
- public static void initProps() {
- String prop;
- FrameworkDebugOptions dbgOptions = null;
-
- // if osgi.debug is not available, don't force DebugOptions
- // to init as this variable may be set later on where
- // DebugOptions will succeed.
- if (FrameworkProperties.getProperty("osgi.debug") != null) { //$NON-NLS-1$
- dbgOptions = FrameworkDebugOptions.getDefault();
- if (dbgOptions != null) {
- STARTUP = dbgOptions.getBooleanOption(OPTION_STARTUP, false);
- BENCHMARK = dbgOptions.getBooleanOption(OPTION_BENCHMARK, false);
- DEBUG = dbgOptions.getBooleanOption(OPTION_DEBUG, false);
- if (profileLogger == null)
- profileLoggerClassName = dbgOptions.getOption(OPTION_IMPL);
- }
- }
-
- // System properties will always override anything in .options file
- if ((prop = FrameworkProperties.getProperty(PROP_STARTUP)) != null) {
- STARTUP = Boolean.valueOf(prop).booleanValue();
- if (dbgOptions != null)
- dbgOptions.setOption(OPTION_STARTUP, new Boolean(STARTUP).toString());
- }
- if ((prop = FrameworkProperties.getProperty(PROP_BENCHMARK)) != null) {
- BENCHMARK = Boolean.valueOf(prop).booleanValue();
- if (dbgOptions != null)
- dbgOptions.setOption(OPTION_BENCHMARK, new Boolean(BENCHMARK).toString());
- }
- if ((prop = FrameworkProperties.getProperty(PROP_DEBUG)) != null) {
- DEBUG = Boolean.valueOf(prop).booleanValue();
- if (dbgOptions != null)
- dbgOptions.setOption(OPTION_DEBUG, new Boolean(DEBUG).toString());
- }
-
- if (profileLogger == null) {
- if ((prop = FrameworkProperties.getProperty(PROP_IMPL)) != null) {
- profileLoggerClassName = prop;
- if (dbgOptions != null)
- dbgOptions.setOption(OPTION_IMPL, profileLoggerClassName);
- }
- } else {
- profileLogger.initProps();
- }
- }
-
- /**
- * Log a method enter.
- *
- * @param id The method's unique identification (e.g. org.eclipse.class#name).
- */
- public static void logEnter(String id) {
- logTime(FLAG_ENTER, id, ENTER_DESCRIPTION, null);
- }
-
- /**
- * Log a method enter.
- *
- * @param id The method's unique identification (e.g. org.eclipse.class#name).
- * @param description A description of the method.
- */
- public static void logEnter(String id, String description) {
- logTime(FLAG_ENTER, id, ENTER_DESCRIPTION, description);
- }
-
- /**
- * Log a method exit.
- *
- * @param id The method's unique identification (e.g. org.eclipse.class#name).
- */
- public static void logExit(String id) {
- logTime(FLAG_EXIT, id, EXIT_DESCRIPTION, null);
- }
-
- /**
- * Log a method exit.
- *
- * @param id The method's unique identification (e.g. org.eclipse.class#name).
- * @param description A description of the method.
- */
- public static void logExit(String id, String description) {
- logTime(FLAG_EXIT, id, EXIT_DESCRIPTION, description);
- }
-
- /**
- * Log a message.
- *
- * @param id The method's unique identification (e.g. org.eclipse.class#name).
- * @param msg The message.
- */
- public static void logTime(String id, String msg) {
- logTime(FLAG_NONE, id, msg, null);
- }
-
- /**
- * Log a message.
- *
- * @param id The method's unique identification (e.g. org.eclipse.class#name).
- * @param msg The message.
- * @param description A description of the method.
- */
- public static void logTime(String id, String msg, String description) {
- logTime(FLAG_NONE, id, msg, description);
- }
-
- /**
- * Log a message.
- *
- * @param flag A profile logging flag.
- * @param id The method's unique identification (e.g. org.eclipse.class#name).
- * @param msg The message.
- * @param description A description of the method.
- *
- * @see #FLAG_ENTER
- * @see #FLAG_EXIT
- * @see #FLAG_NONE
- */
- public static void logTime(int flag, String id, String msg, String description) {
- if (profileLogger == null)
- profileLogger = createProfileLogger();
- profileLogger.logTime(flag, id, msg, description);
- }
-
- /**
- * Use cumulative logging to record the entrance from this scope.
- *
- * @param scope The entering scope
- */
- public static void accumLogEnter(String scope) {
- if (profileLogger == null)
- profileLogger = createProfileLogger();
- profileLogger.accumLogEnter(scope);
- }
-
- /**
- * Use cumulative logging to record the exit from this scope.
- *
- * @param scope The exiting scope
- */
- public static void accumLogExit(String scope) {
- if (profileLogger == null)
- profileLogger = createProfileLogger();
- profileLogger.accumLogExit(scope);
- }
-
- /**
- * Get the profiling log report and reset the trace buffer.
- *
- * @return The profiling log report.
- */
- public static String getProfileLog() {
- if (profileLogger != null)
- return profileLogger.getProfileLog();
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Create an instance of the appropriate profile logger
- */
- private static ProfileLogger createProfileLogger() {
- ProfileLogger result = null;
-
- // Try to create it by class name
- if (profileLoggerClassName != null) {
- Class<?> profileImplClass = null;
- try {
- profileImplClass = Class.forName(profileLoggerClassName);
- result = (ProfileLogger) profileImplClass.newInstance();
- } catch (Exception e) {
- // could not find the class
- e.printStackTrace();
- }
- }
-
- // Use the default
- if (result == null)
- result = new DefaultProfileLogger();
-
- return (result);
- }
-}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/profile/ProfileLogger.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/profile/ProfileLogger.java
deleted file mode 100644
index 31cab05ea..000000000
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/profile/ProfileLogger.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.osgi.internal.profile;
-
-public interface ProfileLogger {
-
- /**
- *
- *@see Profile#initProps()
- */
- public void initProps();
-
- /**
- *@see Profile#logTime(int, String, String, String)
- */
- public void logTime(int flag, String id, String msg, String description);
-
- /**
- * @see Profile#accumLogEnter(String)
- */
- public void accumLogEnter(String scope);
-
- /**
- * @see Profile#accumLogExit(String)
- */
- public void accumLogExit(String scope);
-
- /**
- *
- * @see Profile#getProfileLog()
- */
- public String getProfileLog();
-}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/FilteredServiceListener.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/FilteredServiceListener.java
index 64d616a97..a0429bcdc 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/FilteredServiceListener.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/FilteredServiceListener.java
@@ -52,7 +52,7 @@ class FilteredServiceListener implements ServiceListener, ListenerHook.ListenerI
this.filter = null;
this.objectClass = null;
} else {
- FilterImpl filterImpl = FilterImpl.newInstance(filterstring);
+ FilterImpl filterImpl = FilterImpl.newInstance(filterstring, context.getContainer().getConfiguration().getDebug().DEBUG_FILTER);
String clazz = filterImpl.getRequiredObjectClass();
if (unfiltered || (clazz == null)) {
this.objectClass = null;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java
index 66ade8aab..505427c38 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java
@@ -20,7 +20,8 @@ import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.util.*;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;
-import org.eclipse.osgi.internal.framework.*;
+import org.eclipse.osgi.internal.framework.EquinoxBundle;
+import org.eclipse.osgi.internal.framework.EquinoxContainer;
import org.eclipse.osgi.internal.hookregistry.*;
import org.eclipse.osgi.internal.service.security.KeyStoreTrustEngine;
import org.eclipse.osgi.internal.signedcontent.SignedStorageHook.StorageHookImpl;
@@ -266,7 +267,7 @@ public class SignedBundleHook implements ActivatorHookFactory, BundleFileWrapper
Filter filter = null;
if (trustEngineNameProp != null)
try {
- filter = FilterImpl.newInstance("(&(" + Constants.OBJECTCLASS + "=" + TrustEngine.class.getName() + ")(" + SignedContentConstants.TRUST_ENGINE + "=" + trustEngineNameProp + "))"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$
+ filter = context.createFilter("(&(" + Constants.OBJECTCLASS + "=" + TrustEngine.class.getName() + ")(" + SignedContentConstants.TRUST_ENGINE + "=" + trustEngineNameProp + "))"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$
} catch (InvalidSyntaxException e) {
log("Invalid trust engine filter", FrameworkLogEntry.WARNING, e); //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/storagemanager/StorageManager.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/storagemanager/StorageManager.java
index 3ac630ac3..f975dfe95 100644
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/storagemanager/StorageManager.java
+++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/storagemanager/StorageManager.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.osgi.storagemanager;
-import org.eclipse.osgi.internal.location.*;
-
import java.io.*;
import java.security.AccessController;
import java.util.*;
import org.eclipse.osgi.framework.internal.reliablefile.*;
import org.eclipse.osgi.framework.util.SecureAction;
+import org.eclipse.osgi.internal.location.*;
/**
* Storage managers provide a facility for tracking the state of a group of files having
@@ -188,7 +187,7 @@ public final class StorageManager {
return;
this.instanceFile = File.createTempFile(".tmp", ".instance", managerRoot); //$NON-NLS-1$//$NON-NLS-2$
this.instanceFile.deleteOnExit();
- instanceLocker = BasicLocation.createLocker(instanceFile, lockMode);
+ instanceLocker = BasicLocation.createLocker(instanceFile, lockMode, false);
instanceLocker.lock();
}
@@ -383,7 +382,7 @@ public final class StorageManager {
if (readOnly)
return false;
if (locker == null) {
- locker = BasicLocation.createLocker(lockFile, lockMode);
+ locker = BasicLocation.createLocker(lockFile, lockMode, false);
if (locker == null)
throw new IOException(EclipseAdaptorMsg.fileManager_cannotLock);
}
@@ -609,7 +608,7 @@ public final class StorageManager {
if (files != null) {
for (int i = 0; i < files.length; i++) {
if (files[i].endsWith(".instance") && (instanceFile == null || !files[i].equalsIgnoreCase(instanceFile.getName()))) { //$NON-NLS-1$
- Locker tmpLocker = BasicLocation.createLocker(new File(managerRoot, files[i]), lockMode);
+ Locker tmpLocker = BasicLocation.createLocker(new File(managerRoot, files[i]), lockMode, false);
if (tmpLocker.lock()) {
//If I can lock it is a file that has been left behind by a crash
tmpLocker.release();

Back to the top