com.atlassian.greenhopper.optionalfeatures
Class OptionalService<T>
java.lang.Object
com.atlassian.greenhopper.optionalfeatures.OptionalService<T>
- All Implemented Interfaces:
- org.springframework.beans.factory.DisposableBean
- Direct Known Subclasses:
- SampleDataImporterServiceFactory
public abstract class OptionalService<T>
- extends java.lang.Object
- implements 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(org.osgi.framework.BundleContext bundleContext)
|
Method Summary |
void |
destroy()
|
T |
getService()
Returns the service (of type T ) if it exists, or null if not |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OptionalService
public OptionalService(org.osgi.framework.BundleContext bundleContext)
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
Copyright © 2007-2014 Atlassian. All Rights Reserved.