blob: 431003c6c6010a67a668848da2aff3bfa41c5d56 [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
Pierre De Ropddce5862009-12-04 22:16:48 +000023
Marcel Offermans3d921212010-08-09 13:37:02 +000024public interface ResourceDependency extends Dependency, ServiceComponentDependency, ResourceHandler {
Pierre De Ropddce5862009-12-04 22:16:48 +000025 /**
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 */
Marcel Offermansa564b3a2010-03-20 20:19:15 +000035 public ResourceDependency setCallbacks(String added, String removed) ;
Pierre De Ropddce5862009-12-04 22:16:48 +000036
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 */
Marcel Offermansa564b3a2010-03-20 20:19:15 +000048 public ResourceDependency setCallbacks(String added, String changed, String removed);
Pierre De Ropddce5862009-12-04 22:16:48 +000049
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 */
Marcel Offermansa564b3a2010-03-20 20:19:15 +000061 public ResourceDependency setCallbacks(Object instance, String added, String removed);
Pierre De Ropddce5862009-12-04 22:16:48 +000062
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 */
Marcel Offermansa564b3a2010-03-20 20:19:15 +000075 public ResourceDependency setCallbacks(Object instance, String added, String changed, String removed);
Pierre De Ropddce5862009-12-04 22:16:48 +000076
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 */
Marcel Offermansa564b3a2010-03-20 20:19:15 +000085 public ResourceDependency setAutoConfig(boolean autoConfig);
Pierre De Ropddce5862009-12-04 22:16:48 +000086
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 */
Marcel Offermansa564b3a2010-03-20 20:19:15 +000095 public ResourceDependency setAutoConfig(String instanceName);
Pierre De Ropddce5862009-12-04 22:16:48 +000096
Marcel Offermansa8c213f2010-07-02 17:27:20 +000097 public ResourceDependency setResource(URL resource);
Pierre De Ropddce5862009-12-04 22:16:48 +000098
Marcel Offermansa564b3a2010-03-20 20:19:15 +000099 public ResourceDependency setRequired(boolean required);
Pierre De Ropddce5862009-12-04 22:16:48 +0000100
Marcel Offermansa564b3a2010-03-20 20:19:15 +0000101 public ResourceDependency setFilter(String resourceFilter);
Marcel Offermansd403a1d2009-12-10 09:57:06 +0000102
Marcel Offermansa564b3a2010-03-20 20:19:15 +0000103 public ResourceDependency setPropagate(boolean propagate);
104
Marcel Offermans26081d32010-07-12 12:43:42 +0000105 public ResourceDependency setPropagate(Object instance, String method);
106
Marcel Offermansa564b3a2010-03-20 20:19:15 +0000107 public ResourceDependency setInstanceBound(boolean isInstanceBound);
Pierre De Ropddce5862009-12-04 22:16:48 +0000108}