BedrockActivator.java
1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* 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);
}
}