Class AbstractInfo<T>
java.lang.Object
org.apache.felix.http.base.internal.runtime.AbstractInfo<T>
- All Implemented Interfaces:
Comparable<AbstractInfo<T>>
- Direct Known Subclasses:
ServletContextHelperInfo
,WhiteboardServiceInfo
Base class for all info objects.
Provides support for ranking and ordering of services.
-
Constructor Summary
ConstructorDescriptionAbstractInfo
(int ranking, long serviceId) AbstractInfo
(org.osgi.framework.ServiceReference<T> ref) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(AbstractInfo<T> other) Compare two info objects based on their ranking (aka reverse ServiceReference ordering)boolean
protected boolean
getBooleanProperty
(org.osgi.framework.ServiceReference<T> ref, String key) getInitParams
(org.osgi.framework.ServiceReference<T> ref, String prefix) Get the init parameters.int
getService
(org.osgi.framework.BundleContext bundleContext) Get a service objectlong
org.osgi.framework.ServiceReference<T>
protected String[]
getStringArrayProperty
(org.osgi.framework.ServiceReference<T> ref, String key) protected String
getStringProperty
(org.osgi.framework.ServiceReference<T> ref, String key) abstract String
getType()
Get the type represented by this infoint
hashCode()
protected boolean
protected boolean
boolean
isSame
(AbstractInfo<T> other) Compare two info objectsboolean
isValid()
void
ungetService
(org.osgi.framework.BundleContext bundleContext, T service) Unget the service object
-
Constructor Details
-
AbstractInfo
-
AbstractInfo
public AbstractInfo(int ranking, long serviceId)
-
-
Method Details
-
isValid
public boolean isValid() -
compareTo
Compare two info objects based on their ranking (aka reverse ServiceReference ordering)- Specified by:
compareTo
in interfaceComparable<T>
-
isSame
Compare two info objects -
isEmpty
-
isEmpty
-
getStringProperty
-
getStringArrayProperty
-
getBooleanProperty
-
getInitParams
protected Map<String,String> getInitParams(org.osgi.framework.ServiceReference<T> ref, String prefix) Get the init parameters. -
getRanking
public int getRanking() -
getServiceId
public long getServiceId() -
getTarget
-
getServiceReference
-
hashCode
public int hashCode() -
equals
-
getService
Get a service object- Parameters:
bundleContext
- context- Returns:
- The object or
null
-
ungetService
Unget the service object- Parameters:
bundleContext
- The bundle contextservice
- The service object
-
getType
Get the type represented by this info- Returns:
- The type
-