Package org.apache.sling.engine.servlets
Class AbstractServiceReferenceConfig
- java.lang.Object
-
- org.apache.sling.engine.servlets.AbstractServiceReferenceConfig
-
@Deprecated @ConsumerType public abstract class AbstractServiceReferenceConfig extends Object
Deprecated.TheAbstractServiceReferenceConfig
may be used as a base class to defineServletConfig
andFilterConfig
instances from OSGiServiceReference
objects. The properties of this service reference are used as the initialization parameters of the configuration object.The name of the servlet or filter may be retrieved from the service reference by calling the static
getName(ServiceReference)
method. This method looks for the following service reference properties, assuming the first non-null
value found:- sling.core.servletName - A service registration property which may be set to define an independent servlet name.
- component.name - The name of the Declarative Services component if the OSGi service is registered using Declarative Services.
- service.pid - The Service PID of the service.
- service.id - The ID of the service as set by the OSGi framework service registry. This property is guaranteed to always be set by the OSGi specification.
-
-
Constructor Summary
Constructors Constructor Description AbstractServiceReferenceConfig(ServletContext servletContext, ServiceReference reference, String name)
Deprecated.Sets up this base configuration object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getInitParameter(String name)
Deprecated.Enumeration<?>
getInitParameterNames()
Deprecated.static String
getName(ServiceReference reference)
Deprecated.Looks for a name value in the service reference properties.ServletContext
getServletContext()
Deprecated.
-
-
-
Constructor Detail
-
AbstractServiceReferenceConfig
public AbstractServiceReferenceConfig(ServletContext servletContext, ServiceReference reference, String name)
Deprecated.Sets up this base configuration object.- Parameters:
servletContext
- TheServletContext
attached to this configuration.reference
- The service reference providing the initialization parameter values.name
- The name of this configuration.- See Also:
getName()
-
-
Method Detail
-
getInitParameterNames
public Enumeration<?> getInitParameterNames()
Deprecated.
-
getServletContext
public ServletContext getServletContext()
Deprecated.
-
getName
public static String getName(ServiceReference reference)
Deprecated.Looks for a name value in the service reference properties. See the class comment at the top for the list of properties checked by this method.- Parameters:
reference
- The service reference- Returns:
- The name
-
-