BedrockActivator.java 1.96 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  javax.transaction.TransactionManager
 *  org.apache.felix.scr.annotations.Activate
 *  org.apache.felix.scr.annotations.Component
 *  org.apache.felix.scr.annotations.Deactivate
 *  org.apache.felix.scr.annotations.Reference
 *  org.apache.felix.scr.annotations.References
 *  org.osgi.framework.BundleContext
 *  org.slf4j.Logger
 *  org.slf4j.LoggerFactory
 */
package com.adobe.aemds.bedrock.internal;

import com.adobe.aemds.bedrock.internal.OSGiUtils;
import javax.transaction.TransactionManager;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.References;
import org.omg.CORBA.ORB;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Component(immediate=1)
@References(value={@Reference(name="transactionManager", referenceInterface=TransactionManager.class), @Reference(name="orb", referenceInterface=ORB.class)})
public class BedrockActivator {
    private Logger log;

    public BedrockActivator() {
        this.log = LoggerFactory.getLogger(this.getClass());
    }

    @Activate
    public void activate(BundleContext context) {
        OSGiUtils.setBundleContext(context);
    }

    @Deactivate
    public void deactivate() {
        OSGiUtils.setBundleContext(null);
    }

    public synchronized void bindOrb(ORB orb) {
        OSGiUtils.setOrb(orb);
    }

    public synchronized void unbindOrb(ORB orb) {
        OSGiUtils.setOrb(null);
    }

    public synchronized void bindTransactionManager(TransactionManager transactionManager) {
        OSGiUtils.setTransactionManager(transactionManager);
    }

    public synchronized void unbindTransactionManager(TransactionManager transactionManager) {
        OSGiUtils.setTransactionManager(null);
    }
}