Class BundleHelper
- java.lang.Object
-
- org.ops4j.pax.logging.spi.support.BundleHelper
-
public final class BundleHelper extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.osgi.framework.BundlegetCallerBundle(org.osgi.framework.Bundle defaultBundle)Gets aBundleinvoking logging method which is the first bundle different than pax-logging-api.static org.osgi.framework.BundlegetCallerBundle(org.osgi.framework.Bundle defaultBundle, int skip)Gets aBundlewith configurable number of top-most classes from context.static org.osgi.framework.BundlegetCallerBundle(org.osgi.framework.Bundle defaultBundle, String fqcn)Gets aBundleinvoking logging method which is the first bundle before the class matchingfqcnargument.
-
-
-
Method Detail
-
getCallerBundle
public static org.osgi.framework.Bundle getCallerBundle(org.osgi.framework.Bundle defaultBundle)
Gets aBundleinvoking logging method which is the first bundle different than pax-logging-api. If no bundle can't be found,defaultBundleis 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.loggingpackages are skipped.- Parameters:
defaultBundle-- Returns:
-
getCallerBundle
public static org.osgi.framework.Bundle getCallerBundle(org.osgi.framework.Bundle defaultBundle, int skip)Gets aBundlewith configurable number of top-most classes from context. To be called from places where the class context stack is known. Be careful!- Parameters:
defaultBundle-skip-- Returns:
-
getCallerBundle
public static org.osgi.framework.Bundle getCallerBundle(org.osgi.framework.Bundle defaultBundle, String fqcn)Gets aBundleinvoking logging method which is the first bundle before the class matchingfqcnargument. Checking is done bottom-up the stack trace. If no bundle can't be found,defaultBundleis returned.- Parameters:
defaultBundle-- Returns:
-
-