com.atlassian.greenhopper.optionalfeatures
Class OptionalService<T>

java.lang.Object
  extended by com.atlassian.greenhopper.optionalfeatures.OptionalService<T>
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.osgi.context.BundleContextAware
Direct Known Subclasses:
SampleDataGeneratorServiceFactory

public abstract class OptionalService<T>
extends java.lang.Object
implements org.springframework.osgi.context.BundleContextAware, 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. Subclasses can not be generic nor anonymous - you must explicitly create a class which extends OptionService


Constructor Summary
OptionalService()
           
 
Method Summary
 void destroy()
           
 T getService()
          Returns the service (of type T) if it exists, or null if not
 void setBundleContext(org.osgi.framework.BundleContext bundleContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionalService

public OptionalService()
Method Detail

getService

public T getService()
Returns the service (of type T) if it exists, or null if not

Returns:
the service (of type T) if it exists, or null if not

destroy

public void destroy()
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean

setBundleContext

public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
Specified by:
setBundleContext in interface org.springframework.osgi.context.BundleContextAware


Copyright © 2007-2012 Atlassian. All Rights Reserved.