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
ConstructorsConstructorDescriptionAbstractInfo(int ranking, long serviceId) AbstractInfo(org.osgi.framework.ServiceReference<T> ref) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(AbstractInfo<T> other) Compare two info objects based on their ranking (aka reverse ServiceReference ordering)booleanprotected booleangetBooleanProperty(org.osgi.framework.ServiceReference<T> ref, String key) getInitParams(org.osgi.framework.ServiceReference<T> ref, String prefix) Get the init parameters.intgetService(org.osgi.framework.BundleContext bundleContext) Get a service objectlongorg.osgi.framework.ServiceReference<T>protected String[]getStringArrayProperty(org.osgi.framework.ServiceReference<T> ref, String key) protected StringgetStringProperty(org.osgi.framework.ServiceReference<T> ref, String key) abstract @NotNull StringgetType()Get the type represented by this infointhashCode()protected booleanprotected booleanbooleanisSame(AbstractInfo<T> other) Compare two info objectsbooleanisValid()voidungetService(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:
compareToin interfaceComparable<T>
-
isSame
Compare two info objects- Parameters:
other- The other info object- Returns:
trueif the objects are the same
-
isEmpty
-
isEmpty
-
getStringProperty
-
getStringArrayProperty
-
getBooleanProperty
-
getInitParams
protected Map<String,String> getInitParams(org.osgi.framework.ServiceReference<T> ref, String prefix) Get the init parameters.- Parameters:
ref- The service referenceprefix- The prefix- Returns:
- The map of 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
-