/org.gatherdata.data.dynamic/src/main/java/org/gatherdata/data/dynamic/osgi/OSGiActivator.java
Java | 54 lines | 29 code | 9 blank | 16 comment | 0 complexity | 80e8d2447e4e03b28bd87331cf15dcb0 MD5 | raw file
- /**
- * The contents of this file are subject to the AED Public Use License Agreement, Version 1.0 (the "License");
- * use in any manner is strictly prohibited except in compliance with the terms of the License.
- * The License is available at http://gatherdata.org/license.
- *
- * Copyright (c) AED. All Rights Reserved
- */
- package org.gatherdata.data.dynamic.osgi;
- import java.util.Dictionary;
- import java.util.Properties;
- import org.gatherdata.data.dynamic.DynamicTableService;
- import org.gatherdata.data.dynamic.internal.ExampleServiceImpl;
- import org.ops4j.peaberry.Export;
- import org.osgi.framework.BundleActivator;
- import org.osgi.framework.BundleContext;
- import com.google.inject.Inject;
- import static com.google.inject.Guice.createInjector;
- import static org.ops4j.peaberry.Peaberry.osgiModule;
- /**
- * Extension of the default OSGi bundle activator
- */
- public final class OSGiActivator
- implements BundleActivator
- {
- @Inject
- Export<DynamicTableService> tableService;
-
- /**
- * Called whenever the OSGi framework starts our bundle
- */
- public void start( BundleContext bc )
- throws Exception
- {
- createInjector(osgiModule(bc), new GuiceBindingModule()).injectMembers(this);
- ExampleServiceImpl testService = new ExampleServiceImpl();
- testService.tryItOut(this.getClass().getClassLoader(), tableService.get());
- }
- /**
- * Called whenever the OSGi framework stops our bundle
- */
- public void stop( BundleContext bc )
- throws Exception
- {
- ;
- }
- }