| /* |
| * Copyright (c) OSGi Alliance (2013, 2014). All Rights Reserved. |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| package org.osgi.service.component.runtime.dto; |
| |
| import org.osgi.dto.DTO; |
| |
| /** |
| * A representation of a declared reference to a service. |
| * |
| * @since 1.3 |
| * @NotThreadSafe |
| * @author $Id: a02ee5ad7b783a19bf7e1d8f9dcc6f44685ccd41 $ |
| */ |
| public class ReferenceDTO extends DTO { |
| |
| /** |
| * Constant for the lookup strategy |
| * |
| * @see #strategy |
| */ |
| String STRATEGY_LOOKUP = "LOOKUP"; |
| |
| /** |
| * Constant for the method strategy |
| * |
| * @see #strategy |
| */ |
| String STRATEGY_METHOD = "METHOD"; |
| |
| /** |
| * Constant for the field replace strategy |
| * |
| * @see #strategy |
| */ |
| String STRATEGY_FIELD_REPLACE = "FIELD_REPLACE"; |
| |
| /** |
| * Constant for the field update strategy |
| * |
| * @see #strategy |
| */ |
| String STRATEGY_FIELD_UPDATE = "FIELD_UPDATE"; |
| |
| /** |
| * The strategy of the reference. |
| * |
| * <p> |
| * This field returns the strategy used for this reference. If the value is |
| * either {@code #STRATEGY_FIELD_REPLACE} or {@code #STRATEGY_FIELD_UPDATE}, |
| * {@link #field} returns the name of the field. If the strategy is |
| * {@code #STRATEGY_METHOD} {@link #bind}, {@link #unbind}, and |
| * {@link #updated} return the name of the methods. |
| * |
| * @see #STRATEGY_FIELD_REPLACE |
| * @see #STRATEGY_FIELD_UPDATE |
| * @see #STRATEGY_LOOKUP |
| * @see #STRATEGY_METHOD |
| */ |
| public String strategy; |
| |
| /** |
| * The name of the reference. |
| * |
| * <p> |
| * This is declared in the {@code name} attribute of the {@code reference} |
| * element. This must be the default name if the component description does |
| * not declare a name for the reference. |
| */ |
| public String name; |
| |
| /** |
| * The service interface of the reference. |
| * |
| * <p> |
| * This is declared in the {@code interface} attribute of the |
| * {@code reference} element. |
| */ |
| public String interfaceName; |
| |
| /** |
| * The cardinality of the reference. |
| * |
| * <p> |
| * This is declared in the {@code cardinality} attribute of the |
| * {@code reference} element. This must be the default cardinality if the |
| * component description does not declare a cardinality for the reference. |
| */ |
| public String cardinality; |
| |
| /** |
| * The policy of the reference. |
| * |
| * <p> |
| * This is declared in the {@code policy} attribute of the {@code reference} |
| * element. This must be the default policy if the component description |
| * does not declare a policy for the reference. |
| */ |
| public String policy; |
| |
| /** |
| * The policy option of the reference. |
| * |
| * <p> |
| * This is declared in the {@code policy-option} attribute of the |
| * {@code reference} element. This must be the default policy option if the |
| * component description does not declare a policy option for the reference. |
| */ |
| public String policyOption; |
| |
| /** |
| * The target of the reference. |
| * |
| * <p> |
| * This is declared in the {@code target} attribute of the {@code reference} |
| * element. This must be {@code null} if the component description does not |
| * declare a target for the reference. |
| */ |
| public String target; |
| |
| /** |
| * The name of the bind method of the reference. |
| * |
| * <p> |
| * This is declared in the {@code bind} attribute of the {@code reference} |
| * element. This must be {@code null} if the component is not using the |
| * method strategy or the component description does not declare a bind |
| * method for the reference. |
| */ |
| public String bind; |
| |
| /** |
| * The name of the unbind method of the reference. |
| * |
| * <p> |
| * This is declared in the {@code unbind} attribute of the {@code reference} |
| * element. This must be {@code null} if the component is not using the |
| * method strategy or the component description does not declare an unbind |
| * method for the reference. |
| * |
| * @see #strategy |
| */ |
| public String unbind; |
| |
| /** |
| * The name of the updated method of the reference. |
| * |
| * <p> |
| * This is declared in the {@code updated} attribute of the |
| * {@code reference} element. This must be {@code null} if the component is |
| * not using the method strategy or the component description does not |
| * declare an updated method for the reference. |
| * |
| * @see #strategy |
| */ |
| public String updated; |
| |
| /** |
| * The name of the field of the reference. |
| * |
| * <p> |
| * This is declared in the {@code field} attribute of the {@code reference} |
| * element. This must be {@code null} if the component is using the lookup |
| * or method strategy. |
| * |
| * @see #strategy |
| */ |
| public String field; |
| |
| /** |
| * The scope of the reference. |
| * |
| * <p> |
| * This is declared in the {@code scope} attribute of the {@code reference} |
| * element. This must be the default scope if the component description does |
| * not declare a scope for the reference. |
| */ |
| public String scope; |
| } |