public final class BundleHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.osgi.framework.Bundle |
getCallerBundle(org.osgi.framework.Bundle defaultBundle)
Gets a
Bundle invoking logging method which is the first bundle different than
pax-logging-api. |
static org.osgi.framework.Bundle |
getCallerBundle(org.osgi.framework.Bundle defaultBundle,
int skip)
Gets a
Bundle with configurable number of top-most classes from context. |
static org.osgi.framework.Bundle |
getCallerBundle(org.osgi.framework.Bundle defaultBundle,
String fqcn)
Gets a
Bundle invoking logging method which is the first bundle before the class matching
fqcn argument. |
public static org.osgi.framework.Bundle getCallerBundle(org.osgi.framework.Bundle defaultBundle)
Gets a Bundle invoking logging method which is the first bundle different than
pax-logging-api. If no bundle can't be found, defaultBundle is returned.
This method analyzes class context top down (skipping two topmost classes, as they're known to
come from pax-logging-api bundle). Also, java.util.logging packages are skipped.
defaultBundle - public static org.osgi.framework.Bundle getCallerBundle(org.osgi.framework.Bundle defaultBundle,
int skip)
Gets a Bundle with configurable number of top-most classes from context.
To be called from places where the class context stack is known. Be careful!
defaultBundle - skip - public static org.osgi.framework.Bundle getCallerBundle(org.osgi.framework.Bundle defaultBundle,
String fqcn)
Gets a Bundle invoking logging method which is the first bundle before the class matching
fqcn argument. Checking is done bottom-up the stack trace. If no bundle can't be found,
defaultBundle is returned.
defaultBundle - Copyright © 2006–2022 OPS4J - Open Participation Software for Java. All rights reserved.