All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.felix.scr.Reference Maven / Gradle / Ivy

Go to download

Extensions of the DS Implementation to provide compatibility with API from older Apache Felix DS implementations.

The newest version!
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.apache.felix.scr;


import org.osgi.framework.ServiceReference;


/**
 * The Reference interface represents a single reference (or
 * dependency) to a service used by a Component.
 *
 * @deprecated Use the ServiceComponentRuntime service.
 */
@Deprecated
public interface Reference
{

    /**
     * Returns the name of this Reference. This method provides access to the
     * name attribute of the referenec element.
     */
    String getName();


    /**
     * Returns the name of the service used by this Reference. This method
     * provides access to the interface attribute of the
     * reference element.
     */
    String getServiceName();


    /**
     * Returns an array of references to the services bound to this Reference
     * or null if no services are currently bound.
     */
    ServiceReference[] getServiceReferences();

    /**
     * added by mistake.  Use getServiceReferences();
     * @return
     */
    @Deprecated
    ServiceReference[] getBoundServiceReferences();

    /**
     * Returns whether this reference is satisified. A {@link #isOptional() optional}
     * component is always satsified. Otherwise true is only
     * returned if at least one service is bound.
     */
    boolean isSatisfied();


    /**
     * Returns whether this reference is optional. This method provides access
     * to the lower bound of the cardinality attribute of the
     * reference element. In other words, this method returns
     * true if the cardinality is 0..1 or 0..n.
     */
    boolean isOptional();


    /**
     * Returns whether this reference is multiple. This method provides access
     * to the upper bound of the cardinality attribute of the
     * reference element. In other words, this method returns
     * true if the cardinality is 0..n or 1..n.
     */
    boolean isMultiple();


    /**
     * Returns true if the reference is defined with static policy.
     * This method provides access to the policy element of the
     * reference element. true is returned if the
     * policy is defined as static.
     */
    boolean isStatic();

    /**
     * Returns true if the reference is defined with reluctant
     * policy option.  This method provides access to the policy-option
     * element of the reference element.  true is
     * returned if the policy option is defined as reluctant
     *
     * @since 1.7
     */
    boolean isReluctant();

    /**
     * Returns the value of the target property of this reference. Initially
     * (without overwriting configuration) this method provides access to the
     * target attribute of the reference element. If
     * configuration overwrites the target property, this method returns the
     * value of the Component property whose name is derived from the
     * {@link #getName() reference name} plus the suffix .target. If
     * no target property exists this method returns null.
     */
    String getTarget();


    /**
     * Returns the name of the method called if a service is being bound to
     * the Component or null if no such method is configued. This
     * method provides access to the bind attribute of the
     * reference element.
     */
    String getBindMethodName();


    /**
     * Returns the name of the method called if a service is being unbound from
     * the Component or null if no such method is configued. This
     * method provides access to the unbind attribute of the
     * reference element.
     */
    String getUnbindMethodName();


    /**
     * Returns the name of the method called if a bound service updates its
     * service registration properties or null if no such method
     * is configued. This method provides access to the updated
     * attribute of the reference element.
     * 

* For a component declared in a Declarative Services 1.0 and 1.1 * descriptor, this method always returns null. * * @since 1.4 */ String getUpdatedMethodName(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy