Class OptionalService<T>

java.lang.Object
com.deniz.jira.worklog.services.OptionalService<T>
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class OptionalService<T>
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
An optional service that may or may not exist. This class is completely generic and can be overridden to be used for any optional service.
  • Constructor Summary

    Constructors 
    Constructor Description
    OptionalService​(org.osgi.framework.BundleContext bundleContext, java.lang.Class<T> type)  
  • Method Summary

    Modifier and Type Method Description
    void afterPropertiesSet()  
    void destroy()  
    protected T getService()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OptionalService

      public OptionalService​(org.osgi.framework.BundleContext bundleContext, java.lang.Class<T> type)
  • Method Details

    • getService

      protected final T getService()
    • destroy

      public void destroy() throws java.lang.Exception
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Throws:
      java.lang.Exception
    • afterPropertiesSet

      public void afterPropertiesSet() throws java.lang.Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      java.lang.Exception