blob: df648e93e30b74b3110cdf2a6b90eba8de55a380 [file] [log] [blame]
Marcel Offermans2f6e82b2011-04-19 07:19:58 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
Marcel Offermans837cc962011-04-27 08:00:29 +000019package org.apache.felix.dm;
Marcel Offermans227dd712011-04-19 07:14:22 +000020
Marcel Offermans5c4343a2011-04-19 09:50:24 +000021import java.util.List;
22
Marcel Offermans227dd712011-04-19 07:14:22 +000023import org.osgi.framework.BundleContext;
24import org.osgi.framework.ServiceEvent;
25import org.osgi.framework.ServiceListener;
Marcel Offermans227dd712011-04-19 07:14:22 +000026
27/**
28 * A filter index is an interface you can implement to create your own, optimized index for specific filter expressions.
Marcel Offermans5be5f142011-04-26 10:47:12 +000029 *
30 * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
Marcel Offermans227dd712011-04-19 07:14:22 +000031 */
32public interface FilterIndex {
33 /** Opens this filter index. */
34 public void open(BundleContext context);
35 /** Closes this filter index. */
36 public void close();
37 /** Determines if the combination of class and filter is applicable for this filter index. */
38 public boolean isApplicable(String clazz, String filter);
39 /** Returns all service references that match the specified class and filter. */
Marcel Offermans5c4343a2011-04-19 09:50:24 +000040 public List /* <ServiceReference> */ getAllServiceReferences(String clazz, String filter);
Marcel Offermans227dd712011-04-19 07:14:22 +000041 /** Invoked whenever a service event occurs. */
42 public void serviceChanged(ServiceEvent event);
43 /** Adds a service listener to this filter index. */
44 public void addServiceListener(ServiceListener listener, String filter);
Xander Uiterlinden3c194c32012-06-19 14:51:52 +000045 /** Removes a service listener from this filter index. If the listener is not present in the filter index, this method does nothing. */
Marcel Offermans227dd712011-04-19 07:14:22 +000046 public void removeServiceListener(ServiceListener listener);
47}