PageRenderTime 2854ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/org.gatherdata.archiver.dao.jpa/src/main/java/org/gatherdata/archiver/dao/jpa/osgi/OSGiActivator.java

https://github.com/gatherdata/gather-archiver
Java | 56 lines | 29 code | 11 blank | 16 comment | 0 complexity | 487540ac8647f0d22d2d12b061918a6e MD5 | raw file
  1. /**
  2. * The contents of this file are subject to the AED Public Use License Agreement, Version 1.0 (the "License");
  3. * use in any manner is strictly prohibited except in compliance with the terms of the License.
  4. * The License is available at http://gatherdata.org/license.
  5. *
  6. * Copyright (c) AED. All Rights Reserved
  7. */
  8. package org.gatherdata.archiver.dao.jpa.osgi;
  9. import static com.google.inject.Guice.createInjector;
  10. import static org.ops4j.peaberry.Peaberry.osgiModule;
  11. import java.util.Dictionary;
  12. import java.util.Properties;
  13. import java.util.logging.Logger;
  14. import org.gatherdata.archiver.core.spi.ArchiverDao;
  15. import org.ops4j.peaberry.Export;
  16. import org.osgi.framework.BundleActivator;
  17. import org.osgi.framework.BundleContext;
  18. import com.google.inject.Inject;
  19. /**
  20. * Extension of the default OSGi bundle activator
  21. */
  22. public final class OSGiActivator
  23. implements BundleActivator
  24. {
  25. private static final Logger log = Logger.getLogger(OSGiActivator.class.getName());
  26. @Inject
  27. Export<ArchiverDao> dao;
  28. /**
  29. * Called whenever the OSGi framework starts our bundle
  30. */
  31. public void start( BundleContext bc )
  32. throws Exception
  33. {
  34. log.info( "STARTING org.gatherdata.forms.dao.jpa" );
  35. createInjector(osgiModule(bc), new GuiceBindingModule()).injectMembers(this);
  36. }
  37. /**
  38. * Called whenever the OSGi framework stops our bundle
  39. */
  40. public void stop( BundleContext bc )
  41. throws Exception
  42. {
  43. log.info( "STOPPING org.gatherdata.forms.dao.jpa" );
  44. }
  45. }