You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FormatActivator.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (C) 2013 Google Inc. and others
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.archive;
  11. import org.osgi.framework.BundleActivator;
  12. import org.osgi.framework.BundleContext;
  13. /**
  14. * This activator registers all format types from the
  15. * org.eclipse.jgit.archive package for use via the ArchiveCommand
  16. * API.
  17. *
  18. * This registration happens automatically behind the scenes
  19. * when the package is loaded as an OSGi bundle (and the corresponding
  20. * deregistration happens when the bundle is unloaded, to avoid
  21. * leaks).
  22. */
  23. public class FormatActivator implements BundleActivator {
  24. /**
  25. * {@inheritDoc}
  26. *
  27. * Registers all included archive formats by calling
  28. * {@link ArchiveFormats#registerAll()}. This method is called by the OSGi
  29. * framework when the bundle is started.
  30. */
  31. @Override
  32. public void start(BundleContext context) {
  33. ArchiveFormats.registerAll();
  34. }
  35. /**
  36. * {@inheritDoc}
  37. *
  38. * Cleans up after {@link #start(BundleContext)} by calling
  39. * {@link ArchiveFormats#unregisterAll}.
  40. */
  41. @Override
  42. public void stop(BundleContext context) {
  43. ArchiveFormats.unregisterAll();
  44. }
  45. }