Activator.java 1.37 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  org.apache.sling.launchpad.api.StartupListener
 *  org.osgi.framework.BundleActivator
 *  org.osgi.framework.BundleContext
 *  org.osgi.framework.ServiceRegistration
 */
package com.adobe.granite.startup.impl;

import com.adobe.granite.startup.impl.GraniteStartLevel;
import com.adobe.granite.startup.impl.InstallerListener;
import java.util.Dictionary;
import org.apache.sling.launchpad.api.StartupListener;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;

public class Activator
implements BundleActivator {
    private ServiceRegistration registration;
    private static final String DEBUG_START_LEVEL = "granite.startup.startlevel.debug";

    public void start(BundleContext context) throws Exception {
        if (context.getProperty("granite.startup.startlevel.debug") != null) {
            GraniteStartLevel.setup(context);
        }
        InstallerListener listener = new InstallerListener(context);
        this.registration = context.registerService(StartupListener.class.getName(), (Object)listener, null);
    }

    public void stop(BundleContext context) throws Exception {
        if (this.registration != null) {
            this.registration.unregister();
            this.registration = null;
        }
    }
}