blob: 5e69da498ce2978af122b86b624fedf69311bf21 [file] [log] [blame]
Pierre De Ropddce5862009-12-04 22:16:48 +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 */
19package org.apache.felix.dm.dependencies;
20
21import org.apache.felix.dm.resources.Resource;
22import org.apache.felix.dm.resources.ResourceHandler;
23
24public interface ResourceDependency extends Dependency, ResourceHandler {
25 /**
26 * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
27 * dependency is added or removed. When you specify callbacks, the auto configuration
28 * feature is automatically turned off, because we're assuming you don't need it in this
29 * case.
30 *
31 * @param added the method to call when a service was added
32 * @param removed the method to call when a service was removed
33 * @return this service dependency
34 */
35 ResourceDependency setCallbacks(String added, String removed) ;
36
37 /**
38 * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
39 * dependency is added, changed or removed. When you specify callbacks, the auto
40 * configuration feature is automatically turned off, because we're assuming you don't
41 * need it in this case.
42 *
43 * @param added the method to call when a service was added
44 * @param changed the method to call when a service was changed
45 * @param removed the method to call when a service was removed
46 * @return this service dependency
47 */
48 ResourceDependency setCallbacks(String added, String changed, String removed);
49
50 /**
51 * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
52 * dependency is added or removed. They are called on the instance you provide. When you
53 * specify callbacks, the auto configuration feature is automatically turned off, because
54 * we're assuming you don't need it in this case.
55 *
56 * @param instance the instance to call the callbacks on
57 * @param added the method to call when a service was added
58 * @param removed the method to call when a service was removed
59 * @return this service dependency
60 */
61 ResourceDependency setCallbacks(Object instance, String added, String removed);
62
63 /**
64 * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
65 * dependency is added, changed or removed. They are called on the instance you provide. When you
66 * specify callbacks, the auto configuration feature is automatically turned off, because
67 * we're assuming you don't need it in this case.
68 *
69 * @param instance the instance to call the callbacks on
70 * @param added the method to call when a service was added
71 * @param changed the method to call when a service was changed
72 * @param removed the method to call when a service was removed
73 * @return this service dependency
74 */
75 ResourceDependency setCallbacks(Object instance, String added, String changed, String removed);
76
77 /**
78 * Sets auto configuration for this service. Auto configuration allows the
79 * dependency to fill in any attributes in the service implementation that
80 * are of the same type as this dependency. Default is on.
81 *
82 * @param autoConfig the value of auto config
83 * @return this service dependency
84 */
85 ResourceDependency setAutoConfig(boolean autoConfig);
86
87 /**
88 * Sets auto configuration for this service. Auto configuration allows the
89 * dependency to fill in the attribute in the service implementation that
90 * has the same type and instance name.
91 *
92 * @param instanceName the name of attribute to auto config
93 * @return this service dependency
94 */
95 ResourceDependency setAutoConfig(String instanceName);
96
97 ResourceDependency setResource(Resource resource);
98
99 ResourceDependency setRequired(boolean required);
100
101 ResourceDependency setFilter(String resourceFilter);
Marcel Offermansd403a1d2009-12-10 09:57:06 +0000102
103 ResourceDependency setPropagate(boolean propagate);
Pierre De Ropddce5862009-12-04 22:16:48 +0000104}