blob: d5ab7812ae7c9906e361b03bf8be02137bc26f18 [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 */
Marcel Offermans8b93efa2010-07-02 18:27:21 +000019package org.apache.felix.dm;
Pierre De Ropddce5862009-12-04 22:16:48 +000020
Marcel Offermansa8c213f2010-07-02 17:27:20 +000021import java.net.URL;
22
Marcel Offermans5be5f142011-04-26 10:47:12 +000023/**
24 * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
25 */
Marcel Offermansfaaed472010-09-08 10:07:32 +000026public interface ResourceDependency extends Dependency, ComponentDependencyDeclaration, ResourceHandler {
Pierre De Ropddce5862009-12-04 22:16:48 +000027 /**
28 * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
29 * dependency is added or removed. When you specify callbacks, the auto configuration
30 * feature is automatically turned off, because we're assuming you don't need it in this
31 * case.
32 *
33 * @param added the method to call when a service was added
34 * @param removed the method to call when a service was removed
35 * @return this service dependency
36 */
Marcel Offermansa564b3a2010-03-20 20:19:15 +000037 public ResourceDependency setCallbacks(String added, String removed) ;
Pierre De Ropddce5862009-12-04 22:16:48 +000038
39 /**
40 * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
41 * dependency is added, changed or removed. When you specify callbacks, the auto
42 * configuration feature is automatically turned off, because we're assuming you don't
43 * need it in this case.
44 *
45 * @param added the method to call when a service was added
46 * @param changed the method to call when a service was changed
47 * @param removed the method to call when a service was removed
48 * @return this service dependency
49 */
Marcel Offermansa564b3a2010-03-20 20:19:15 +000050 public ResourceDependency setCallbacks(String added, String changed, String removed);
Pierre De Ropddce5862009-12-04 22:16:48 +000051
52 /**
53 * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
54 * dependency is added or removed. They are called on the instance you provide. When you
55 * specify callbacks, the auto configuration feature is automatically turned off, because
56 * we're assuming you don't need it in this case.
57 *
58 * @param instance the instance to call the callbacks on
59 * @param added the method to call when a service was added
60 * @param removed the method to call when a service was removed
61 * @return this service dependency
62 */
Marcel Offermansa564b3a2010-03-20 20:19:15 +000063 public ResourceDependency setCallbacks(Object instance, String added, String removed);
Pierre De Ropddce5862009-12-04 22:16:48 +000064
65 /**
66 * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
67 * dependency is added, changed or removed. They are called on the instance you provide. When you
68 * specify callbacks, the auto configuration feature is automatically turned off, because
69 * we're assuming you don't need it in this case.
70 *
71 * @param instance the instance to call the callbacks on
72 * @param added the method to call when a service was added
73 * @param changed the method to call when a service was changed
74 * @param removed the method to call when a service was removed
75 * @return this service dependency
76 */
Marcel Offermansa564b3a2010-03-20 20:19:15 +000077 public ResourceDependency setCallbacks(Object instance, String added, String changed, String removed);
Pierre De Ropddce5862009-12-04 22:16:48 +000078
79 /**
80 * Sets auto configuration for this service. Auto configuration allows the
81 * dependency to fill in any attributes in the service implementation that
82 * are of the same type as this dependency. Default is on.
83 *
84 * @param autoConfig the value of auto config
85 * @return this service dependency
86 */
Marcel Offermansa564b3a2010-03-20 20:19:15 +000087 public ResourceDependency setAutoConfig(boolean autoConfig);
Pierre De Ropddce5862009-12-04 22:16:48 +000088
89 /**
90 * Sets auto configuration for this service. Auto configuration allows the
91 * dependency to fill in the attribute in the service implementation that
92 * has the same type and instance name.
93 *
94 * @param instanceName the name of attribute to auto config
95 * @return this service dependency
96 */
Marcel Offermansa564b3a2010-03-20 20:19:15 +000097 public ResourceDependency setAutoConfig(String instanceName);
Pierre De Ropddce5862009-12-04 22:16:48 +000098
Marcel Offermansa8c213f2010-07-02 17:27:20 +000099 public ResourceDependency setResource(URL resource);
Pierre De Ropddce5862009-12-04 22:16:48 +0000100
Marcel Offermansa564b3a2010-03-20 20:19:15 +0000101 public ResourceDependency setRequired(boolean required);
Pierre De Ropddce5862009-12-04 22:16:48 +0000102
Marcel Offermansa564b3a2010-03-20 20:19:15 +0000103 public ResourceDependency setFilter(String resourceFilter);
Marcel Offermansd403a1d2009-12-10 09:57:06 +0000104
Marcel Offermansa564b3a2010-03-20 20:19:15 +0000105 public ResourceDependency setPropagate(boolean propagate);
106
Marcel Offermans26081d32010-07-12 12:43:42 +0000107 public ResourceDependency setPropagate(Object instance, String method);
108
Marcel Offermansa564b3a2010-03-20 20:19:15 +0000109 public ResourceDependency setInstanceBound(boolean isInstanceBound);
Pierre De Ropddce5862009-12-04 22:16:48 +0000110}