public final class org.apache.logging.log4j.core.osgi.Activator extends org.apache.logging.log4j.util.ProviderActivator implements org.osgi.framework.SynchronousBundleListener
{
private static final org.apache.logging.log4j.Logger LOGGER;
private final java.util.concurrent.atomic.AtomicReference contextRef;
private org.osgi.framework.ServiceRegistration contextDataRegistration;
public void <init>()
{
org.apache.logging.log4j.core.osgi.Activator v;
org.apache.logging.log4j.core.impl.Log4jProvider v;
java.util.concurrent.atomic.AtomicReference v;
v := @this: org.apache.logging.log4j.core.osgi.Activator;
v = new org.apache.logging.log4j.core.impl.Log4jProvider;
specialinvoke v.<org.apache.logging.log4j.core.impl.Log4jProvider: void <init>()>();
specialinvoke v.<org.apache.logging.log4j.util.ProviderActivator: void <init>(org.apache.logging.log4j.spi.Provider)>(v);
v = new java.util.concurrent.atomic.AtomicReference;
specialinvoke v.<java.util.concurrent.atomic.AtomicReference: void <init>()>();
v.<org.apache.logging.log4j.core.osgi.Activator: java.util.concurrent.atomic.AtomicReference contextRef> = v;
v.<org.apache.logging.log4j.core.osgi.Activator: org.osgi.framework.ServiceRegistration contextDataRegistration> = null;
return;
}
public void start(org.osgi.framework.BundleContext) throws java.lang.Exception
{
org.apache.logging.log4j.core.impl.ThreadContextDataProvider v;
java.util.concurrent.atomic.AtomicReference v;
org.apache.logging.log4j.util.PropertiesUtil v;
org.osgi.framework.BundleContext v;
org.apache.logging.log4j.core.osgi.Activator v;
java.lang.Class v;
java.lang.String v, v;
boolean v;
org.osgi.framework.ServiceRegistration v;
v := @this: org.apache.logging.log4j.core.osgi.Activator;
v := @parameter: org.osgi.framework.BundleContext;
specialinvoke v.<org.apache.logging.log4j.util.ProviderActivator: void start(org.osgi.framework.BundleContext)>(v);
v = new org.apache.logging.log4j.core.impl.ThreadContextDataProvider;
specialinvoke v.<org.apache.logging.log4j.core.impl.ThreadContextDataProvider: void <init>()>();
v = interfaceinvoke v.<org.osgi.framework.BundleContext: org.osgi.framework.ServiceRegistration registerService(java.lang.Class,java.lang.Object,java.util.Dictionary)>(class "Lorg/apache/logging/log4j/core/util/ContextDataProvider;", v, null);
v.<org.apache.logging.log4j.core.osgi.Activator: org.osgi.framework.ServiceRegistration contextDataRegistration> = v;
staticinvoke <org.apache.logging.log4j.core.osgi.Activator: void loadContextProviders(org.osgi.framework.BundleContext)>(v);
v = staticinvoke <org.apache.logging.log4j.util.PropertiesUtil: org.apache.logging.log4j.util.PropertiesUtil getProperties()>();
v = virtualinvoke v.<org.apache.logging.log4j.util.PropertiesUtil: java.lang.String getStringProperty(java.lang.String)>("Log4jContextSelector");
if v != null goto label;
v = class "Lorg/apache/logging/log4j/core/osgi/BundleContextSelector;";
v = virtualinvoke v.<java.lang.Class: java.lang.String getName()>();
staticinvoke <java.lang.System: java.lang.String setProperty(java.lang.String,java.lang.String)>("Log4jContextSelector", v);
label:
v = v.<org.apache.logging.log4j.core.osgi.Activator: java.util.concurrent.atomic.AtomicReference contextRef>;
v = virtualinvoke v.<java.util.concurrent.atomic.AtomicReference: boolean compareAndSet(java.lang.Object,java.lang.Object)>(null, v);
if v == 0 goto label;
interfaceinvoke v.<org.osgi.framework.BundleContext: void addBundleListener(org.osgi.framework.BundleListener)>(v);
staticinvoke <org.apache.logging.log4j.core.osgi.Activator: void scanInstalledBundlesForPlugins(org.osgi.framework.BundleContext)>(v);
label:
return;
}
private static void scanInstalledBundlesForPlugins(org.osgi.framework.BundleContext)
{
int v, v;
org.osgi.framework.Bundle[] v;
org.osgi.framework.Bundle v;
org.osgi.framework.BundleContext v;
v := @parameter: org.osgi.framework.BundleContext;
v = interfaceinvoke v.<org.osgi.framework.BundleContext: org.osgi.framework.Bundle[] getBundles()>();
v = lengthof v;
v = 0;
label:
if v >= v goto label;
v = v[v];
staticinvoke <org.apache.logging.log4j.core.osgi.Activator: void scanBundleForPlugins(org.osgi.framework.Bundle)>(v);
v = v + 1;
goto label;
label:
return;
}
private static void scanBundleForPlugins(org.osgi.framework.Bundle)
{
long v;
org.apache.logging.log4j.Logger v;
byte v;
java.lang.Long v;
int v;
java.lang.Object v;
java.lang.ClassLoader v;
java.lang.String v;
org.apache.logging.log4j.core.config.plugins.util.PluginRegistry v;
org.osgi.framework.Bundle v;
v := @parameter: org.osgi.framework.Bundle;
v = interfaceinvoke v.<org.osgi.framework.Bundle: long getBundleId()>();
v = interfaceinvoke v.<org.osgi.framework.Bundle: int getState()>();
if v != 32 goto label;
v = v cmp 0L;
if v == 0 goto label;
v = <org.apache.logging.log4j.core.osgi.Activator: org.apache.logging.log4j.Logger LOGGER>;
v = interfaceinvoke v.<org.osgi.framework.Bundle: java.lang.String getSymbolicName()>();
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
interfaceinvoke v.<org.apache.logging.log4j.Logger: void trace(java.lang.String,java.lang.Object,java.lang.Object)>("Scanning bundle [{}, id=%d] for plugins.", v, v);
v = staticinvoke <org.apache.logging.log4j.core.config.plugins.util.PluginRegistry: org.apache.logging.log4j.core.config.plugins.util.PluginRegistry getInstance()>();
v = interfaceinvoke v.<org.osgi.framework.Bundle: java.lang.Object adapt(java.lang.Class)>(class "Lorg/osgi/framework/wiring/BundleWiring;");
v = interfaceinvoke v.<org.osgi.framework.wiring.BundleWiring: java.lang.ClassLoader getClassLoader()>();
virtualinvoke v.<org.apache.logging.log4j.core.config.plugins.util.PluginRegistry: java.util.Map loadFromBundle(long,java.lang.ClassLoader)>(v, v);
label:
return;
}
private static void loadContextProviders(org.osgi.framework.BundleContext)
{
java.lang.Throwable v;
java.util.Iterator v;
java.util.Collection v, v;
org.osgi.framework.BundleContext v;
org.apache.logging.log4j.Logger v;
java.lang.Object v, v;
boolean v;
v := @parameter: org.osgi.framework.BundleContext;
label:
v = interfaceinvoke v.<org.osgi.framework.BundleContext: java.util.Collection getServiceReferences(java.lang.Class,java.lang.String)>(class "Lorg/apache/logging/log4j/core/util/ContextDataProvider;", null);
v = interfaceinvoke v.<java.util.Collection: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = interfaceinvoke v.<org.osgi.framework.BundleContext: java.lang.Object getService(org.osgi.framework.ServiceReference)>(v);
v = <org.apache.logging.log4j.core.impl.ThreadContextDataInjector: java.util.Collection contextDataProviders>;
interfaceinvoke v.<java.util.Collection: boolean add(java.lang.Object)>(v);
goto label;
label:
v := @caughtexception;
v = <org.apache.logging.log4j.core.osgi.Activator: org.apache.logging.log4j.Logger LOGGER>;
interfaceinvoke v.<org.apache.logging.log4j.Logger: void error(java.lang.String,java.lang.Throwable)>("Error accessing context data provider", v);
label:
return;
catch org.osgi.framework.InvalidSyntaxException from label to label with label;
}
private static void stopBundlePlugins(org.osgi.framework.Bundle)
{
org.apache.logging.log4j.Logger v;
long v;
java.lang.String v;
org.apache.logging.log4j.core.config.plugins.util.PluginRegistry v;
org.osgi.framework.Bundle v;
v := @parameter: org.osgi.framework.Bundle;
v = <org.apache.logging.log4j.core.osgi.Activator: org.apache.logging.log4j.Logger LOGGER>;
v = interfaceinvoke v.<org.osgi.framework.Bundle: java.lang.String getSymbolicName()>();
interfaceinvoke v.<org.apache.logging.log4j.Logger: void trace(java.lang.String,java.lang.Object)>("Stopping bundle [{}] plugins.", v);
v = staticinvoke <org.apache.logging.log4j.core.config.plugins.util.PluginRegistry: org.apache.logging.log4j.core.config.plugins.util.PluginRegistry getInstance()>();
v = interfaceinvoke v.<org.osgi.framework.Bundle: long getBundleId()>();
virtualinvoke v.<org.apache.logging.log4j.core.config.plugins.util.PluginRegistry: void clearBundlePlugins(long)>(v);
return;
}
public void stop(org.osgi.framework.BundleContext) throws java.lang.Exception
{
org.apache.logging.log4j.core.osgi.Activator v;
java.util.concurrent.atomic.AtomicReference v;
org.osgi.framework.BundleContext v;
org.osgi.framework.ServiceRegistration v;
v := @this: org.apache.logging.log4j.core.osgi.Activator;
v := @parameter: org.osgi.framework.BundleContext;
v = v.<org.apache.logging.log4j.core.osgi.Activator: org.osgi.framework.ServiceRegistration contextDataRegistration>;
interfaceinvoke v.<org.osgi.framework.ServiceRegistration: void unregister()>();
v = v.<org.apache.logging.log4j.core.osgi.Activator: java.util.concurrent.atomic.AtomicReference contextRef>;
virtualinvoke v.<java.util.concurrent.atomic.AtomicReference: boolean compareAndSet(java.lang.Object,java.lang.Object)>(v, null);
staticinvoke <org.apache.logging.log4j.LogManager: void shutdown()>();
specialinvoke v.<org.apache.logging.log4j.util.ProviderActivator: void stop(org.osgi.framework.BundleContext)>(v);
return;
}
public void bundleChanged(org.osgi.framework.BundleEvent)
{
org.apache.logging.log4j.core.osgi.Activator v;
int v;
org.osgi.framework.Bundle v, v;
org.osgi.framework.BundleEvent v;
v := @this: org.apache.logging.log4j.core.osgi.Activator;
v := @parameter: org.osgi.framework.BundleEvent;
v = virtualinvoke v.<org.osgi.framework.BundleEvent: int getType()>();
lookupswitch(v)
{
case 2: goto label;
case 256: goto label;
default: goto label;
};
label:
v = virtualinvoke v.<org.osgi.framework.BundleEvent: org.osgi.framework.Bundle getBundle()>();
staticinvoke <org.apache.logging.log4j.core.osgi.Activator: void scanBundleForPlugins(org.osgi.framework.Bundle)>(v);
goto label;
label:
v = virtualinvoke v.<org.osgi.framework.BundleEvent: org.osgi.framework.Bundle getBundle()>();
staticinvoke <org.apache.logging.log4j.core.osgi.Activator: void stopBundlePlugins(org.osgi.framework.Bundle)>(v);
label:
return;
}
static void <clinit>()
{
org.apache.logging.log4j.status.StatusLogger v;
v = staticinvoke <org.apache.logging.log4j.status.StatusLogger: org.apache.logging.log4j.status.StatusLogger getLogger()>();
<org.apache.logging.log4j.core.osgi.Activator: org.apache.logging.log4j.Logger LOGGER> = v;
return;
}
}