Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the
   * "License"); you may not use this file except in compliance
   * with the License.  You may obtain a copy of the License at
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
 import static org.osgi.framework.Constants.SERVICE_ID;
 import static org.osgi.framework.Constants.SERVICE_PID;
 import static org.osgi.service.component.ComponentConstants.COMPONENT_NAME;
 import java.util.List;
 public class SlingFilterConfig implements FilterConfig {

The list of property names checked by getName(ServiceReference)
     private static final String[] NAME_PROPERTIES = { "sling.core.servletName",
         COMPONENT_NAME,  };

The ServletContext of this configuration object
     private ServletContext servletContext;

The ServiceReference providing the properties
     private ServiceReference reference;

The name of this configuration object
     private String name;

Sets up this base configuration object.

servletContext The ServletContext attached to this configuration.
reference The service reference providing the initialization parameter values.
filterName The name of this configuration.
     public SlingFilterConfig(final ServletContext servletContext,
                              final ServiceReference reference,
                              final String filterName) {
         this. = servletContext;
         this. = reference;
         this. = filterName;


See also:
     public String getInitParameter(String name) {
         Object prop = .getProperty(name);
         return (prop == null) ? null : String.valueOf(prop);


See also:
     public Enumeration<StringgetInitParameterNames() {
         List<Stringkeys = Arrays.asList(.getPropertyKeys());
         return Collections.enumeration(keys);


See also:
     public ServletContext getServletContext() {
         return ;

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.
     public static String getName(ServiceReference reference) {
         String servletName = null;
         for (int i = 0; i < .
             && (servletName == null || servletName.length() == 0); i++) {
            Object prop = reference.getProperty([i]);
            if (prop != null) {
                servletName = String.valueOf(prop);
        return servletName;


See also:
    public String getFilterName() {
        return ;
New to GrepCode? Check out our FAQ X