Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2010-10-08 08:31:28 -0400
committerGlyn Normington2010-10-08 11:28:38 -0400
commit3ebcf2acc54cf1d3b76c911b42b738a8a427ad6a (patch)
treefdfd4aeaa52cb683c98fa9d6f74dda66919b280d
parent23bcc4f36d0a7d906ec2b3d761a8c070c988d7cd (diff)
downloadorg.eclipse.virgo.medic-3ebcf2acc54cf1d3b76c911b42b738a8a427ad6a.tar.gz
org.eclipse.virgo.medic-3ebcf2acc54cf1d3b76c911b42b738a8a427ad6a.tar.xz
org.eclipse.virgo.medic-3ebcf2acc54cf1d3b76c911b42b738a8a427ad6a.zip
bug 326423: fix how the calling bundle is determined to avoid nested framework issues and remove the web class loading hook from the scope of the entry/exit trace aspect
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java6
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/StandardCallingBundleResolver.java9
-rw-r--r--org.eclipse.virgo.medic/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj5
3 files changed, 9 insertions, 11 deletions
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
index f12f5b8..f1a9159 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
@@ -214,7 +214,7 @@ public final class MedicActivator implements BundleActivator {
private static StandardContextSelectorDelegate createContextSelectorDelegate(BundleContext bundleContext, PackageAdmin packageAdmin) {
ConfigurationLocator configurationLocator = createConfigurationLocator(bundleContext);
- CallingBundleResolver loggingCallerLocator = createLoggingCallerLocator(packageAdmin);
+ CallingBundleResolver loggingCallerLocator = createLoggingCallerLocator();
LoggerContextConfigurer loggerContextConfigurer = new JoranLoggerContextConfigurer();
return new StandardContextSelectorDelegate(loggingCallerLocator, configurationLocator, bundleContext.getBundle(), loggerContextConfigurer);
}
@@ -230,11 +230,11 @@ public final class MedicActivator implements BundleActivator {
return new CompositeConfigurationLocator(new ServiceRegistryConfigurationLocator(bundleContext), new BundleResourceConfigurationLocator());
}
- private static CallingBundleResolver createLoggingCallerLocator(PackageAdmin packageAdmin) {
+ private static CallingBundleResolver createLoggingCallerLocator() {
ClassSelector classSelector = createClassSelector();
ExecutionStackAccessor executionStackAccessor = createExecutionStackAccessor();
- return new StandardCallingBundleResolver(executionStackAccessor, classSelector, packageAdmin);
+ return new StandardCallingBundleResolver(executionStackAccessor, classSelector);
}
private static ClassSelector createClassSelector() {
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/StandardCallingBundleResolver.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/StandardCallingBundleResolver.java
index 370221e..34e6d1b 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/StandardCallingBundleResolver.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/StandardCallingBundleResolver.java
@@ -12,7 +12,7 @@
package org.eclipse.virgo.medic.log.impl;
import org.osgi.framework.Bundle;
-import org.osgi.service.packageadmin.PackageAdmin;
+import org.osgi.framework.FrameworkUtil;
public final class StandardCallingBundleResolver implements CallingBundleResolver {
@@ -20,17 +20,14 @@ public final class StandardCallingBundleResolver implements CallingBundleResolve
private final ClassSelector classSelector;
- private final PackageAdmin packageAdmin;
-
- public StandardCallingBundleResolver(ExecutionStackAccessor stackAccessor, ClassSelector classSelector, PackageAdmin packageAdmin) {
+ public StandardCallingBundleResolver(ExecutionStackAccessor stackAccessor, ClassSelector classSelector) {
this.stackAccessor = stackAccessor;
this.classSelector = classSelector;
- this.packageAdmin = packageAdmin;
}
public Bundle getCallingBundle() {
Class<?>[] executionStack = this.stackAccessor.getExecutionStack();
Class<?> loggingCallersClass = classSelector.select(executionStack);
- return this.packageAdmin.getBundle(loggingCallersClass);
+ return FrameworkUtil.getBundle(loggingCallersClass);
}
}
diff --git a/org.eclipse.virgo.medic/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj b/org.eclipse.virgo.medic/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj
index a7ae778..a48462c 100644
--- a/org.eclipse.virgo.medic/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj
+++ b/org.eclipse.virgo.medic/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj
@@ -35,6 +35,7 @@ public aspect EntryExitTrace pertypewithin(*) {
// avoid class loading recursion
pointcut kernelUserRegion() : within(org.eclipse.virgo.kernel.userregion..*);
+ pointcut webClassLoading() : within(org.eclipse.virgo.web.core.internal..*);
pointcut logback() : within(ch.qos.logback..*) || within(org.slf4j.impl..*);
@@ -42,9 +43,9 @@ public aspect EntryExitTrace pertypewithin(*) {
pointcut getter() : execution(* get*(..));
- pointcut debugCandidate() : execution(public * *(..)) && !setter() && !getter() && !medic() && !util() && !repository() && !kernelUserRegion() && !logback();
+ pointcut debugCandidate() : execution(public * *(..)) && !setter() && !getter() && !medic() && !util() && !repository() && !kernelUserRegion() && !webClassLoading() && !logback();
- pointcut traceCandidate() : execution(!public * *(..)) && !setter() && !getter() && !medic() && !util() && !repository() && !kernelUserRegion() && !logback();
+ pointcut traceCandidate() : execution(!public * *(..)) && !setter() && !getter() && !medic() && !util() && !repository() && !kernelUserRegion() && !webClassLoading() && !logback();
before() : debugCandidate() {
getLogger(thisJoinPointStaticPart).debug("{} {}", ">",

Back to the top