Class OsgiService

java.lang.Object
com.atlassian.jira.component.spring.osgi.OsgiService

@ParametersAreNonnullByDefault public class OsgiService extends Object
A Jira component to be registered as an OSGi service or service factory.
  • Constructor Details

    • OsgiService

      public OsgiService(Object instance, Set<Class> interfaces)
      Constructor for an OSGi service that implements one or more interfaces.
      Parameters:
      instance - the service instance
      interfaces - the interfaces under which it is to be registered with OSGi
    • OsgiService

      public OsgiService(Object instance, Set<Class> interfaces, boolean trackBundle)
  • Method Details

    • getInstance

      public Object getInstance()
      The actual component instance.
      Returns:
      the instance
    • getInterfaces

      @Nonnull public Set<Class> getInterfaces()
      The interfaces exported by this component.
      Returns:
      an immutable set
    • isTrackBundle

      public boolean isTrackBundle()
      Enables Bundle Tracking for the OSGi service. i.e. for the service to determine which bundle called it.
      Returns:
      true if the bundle should be tracked
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object