| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.dozer.osgi; |
| 17 | |
|
| 18 | |
import org.dozer.DozerInitializer; |
| 19 | |
import org.dozer.config.BeanContainer; |
| 20 | |
import org.osgi.framework.BundleActivator; |
| 21 | |
import org.osgi.framework.BundleContext; |
| 22 | |
import org.slf4j.Logger; |
| 23 | |
import org.slf4j.LoggerFactory; |
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | 0 | public final class Activator implements BundleActivator { |
| 29 | |
|
| 30 | 0 | private final Logger log = LoggerFactory.getLogger(Activator.class); |
| 31 | |
|
| 32 | |
public void start(BundleContext bundleContext) throws Exception { |
| 33 | 0 | log.info("Starting Dozer OSGi bundle"); |
| 34 | 0 | OSGiClassLoader classLoader = new OSGiClassLoader(bundleContext); |
| 35 | 0 | BeanContainer.getInstance().setClassLoader(classLoader); |
| 36 | 0 | DozerInitializer.getInstance().init(Activator.class.getClassLoader()); |
| 37 | 0 | } |
| 38 | |
|
| 39 | |
public void stop(BundleContext bundleContext) throws Exception { |
| 40 | 0 | log.info("Dozer OSGi bundle stopped"); |
| 41 | 0 | } |
| 42 | |
|
| 43 | |
} |