Pierre De Rop | ddce586 | 2009-12-04 22:16:48 +0000 | [diff] [blame] | 1 | /* |
| 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 Offermans | 8b93efa | 2010-07-02 18:27:21 +0000 | [diff] [blame] | 19 | package org.apache.felix.dm; |
Pierre De Rop | ddce586 | 2009-12-04 22:16:48 +0000 | [diff] [blame] | 20 | |
Marcel Offermans | a8c213f | 2010-07-02 17:27:20 +0000 | [diff] [blame] | 21 | import java.net.URL; |
| 22 | |
Marcel Offermans | 5be5f14 | 2011-04-26 10:47:12 +0000 | [diff] [blame] | 23 | /** |
| 24 | * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a> |
| 25 | */ |
Marcel Offermans | faaed47 | 2010-09-08 10:07:32 +0000 | [diff] [blame] | 26 | public interface ResourceDependency extends Dependency, ComponentDependencyDeclaration, ResourceHandler { |
Pierre De Rop | ddce586 | 2009-12-04 22:16:48 +0000 | [diff] [blame] | 27 | /** |
| 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 Offermans | a564b3a | 2010-03-20 20:19:15 +0000 | [diff] [blame] | 37 | public ResourceDependency setCallbacks(String added, String removed) ; |
Pierre De Rop | ddce586 | 2009-12-04 22:16:48 +0000 | [diff] [blame] | 38 | |
| 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 Offermans | a564b3a | 2010-03-20 20:19:15 +0000 | [diff] [blame] | 50 | public ResourceDependency setCallbacks(String added, String changed, String removed); |
Pierre De Rop | ddce586 | 2009-12-04 22:16:48 +0000 | [diff] [blame] | 51 | |
| 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 Offermans | a564b3a | 2010-03-20 20:19:15 +0000 | [diff] [blame] | 63 | public ResourceDependency setCallbacks(Object instance, String added, String removed); |
Pierre De Rop | ddce586 | 2009-12-04 22:16:48 +0000 | [diff] [blame] | 64 | |
| 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 Offermans | a564b3a | 2010-03-20 20:19:15 +0000 | [diff] [blame] | 77 | public ResourceDependency setCallbacks(Object instance, String added, String changed, String removed); |
Pierre De Rop | ddce586 | 2009-12-04 22:16:48 +0000 | [diff] [blame] | 78 | |
| 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 Offermans | a564b3a | 2010-03-20 20:19:15 +0000 | [diff] [blame] | 87 | public ResourceDependency setAutoConfig(boolean autoConfig); |
Pierre De Rop | ddce586 | 2009-12-04 22:16:48 +0000 | [diff] [blame] | 88 | |
| 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 Offermans | a564b3a | 2010-03-20 20:19:15 +0000 | [diff] [blame] | 97 | public ResourceDependency setAutoConfig(String instanceName); |
Pierre De Rop | ddce586 | 2009-12-04 22:16:48 +0000 | [diff] [blame] | 98 | |
Marcel Offermans | a8c213f | 2010-07-02 17:27:20 +0000 | [diff] [blame] | 99 | public ResourceDependency setResource(URL resource); |
Pierre De Rop | ddce586 | 2009-12-04 22:16:48 +0000 | [diff] [blame] | 100 | |
Marcel Offermans | a564b3a | 2010-03-20 20:19:15 +0000 | [diff] [blame] | 101 | public ResourceDependency setRequired(boolean required); |
Pierre De Rop | ddce586 | 2009-12-04 22:16:48 +0000 | [diff] [blame] | 102 | |
Marcel Offermans | a564b3a | 2010-03-20 20:19:15 +0000 | [diff] [blame] | 103 | public ResourceDependency setFilter(String resourceFilter); |
Marcel Offermans | d403a1d | 2009-12-10 09:57:06 +0000 | [diff] [blame] | 104 | |
Marcel Offermans | a564b3a | 2010-03-20 20:19:15 +0000 | [diff] [blame] | 105 | public ResourceDependency setPropagate(boolean propagate); |
| 106 | |
Marcel Offermans | 26081d3 | 2010-07-12 12:43:42 +0000 | [diff] [blame] | 107 | public ResourceDependency setPropagate(Object instance, String method); |
| 108 | |
Marcel Offermans | a564b3a | 2010-03-20 20:19:15 +0000 | [diff] [blame] | 109 | public ResourceDependency setInstanceBound(boolean isInstanceBound); |
Pierre De Rop | ddce586 | 2009-12-04 22:16:48 +0000 | [diff] [blame] | 110 | } |