2 * Copyright (c) 2016 Brocade Communications Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.blueprint.ext;
10 import com.google.common.base.Preconditions;
11 import java.util.Collection;
12 import java.util.Collections;
13 import java.util.List;
14 import org.osgi.service.blueprint.reflect.ReferenceListener;
15 import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
18 * A ServiceReferenceMetadata implementation for a mandatory OSGi service.
20 * @author Thomas Pantelis
22 class MandatoryServiceReferenceMetadata implements ServiceReferenceMetadata {
23 private final String interfaceClass;
24 private final String id;
26 MandatoryServiceReferenceMetadata(final String id, final String interfaceClass) {
27 this.id = Preconditions.checkNotNull(id);
28 this.interfaceClass = interfaceClass;
32 public String getId() {
37 public int getActivation() {
38 return ACTIVATION_EAGER;
42 public List<String> getDependsOn() {
43 return Collections.emptyList();
47 public int getAvailability() {
48 return AVAILABILITY_MANDATORY;
52 public String getInterface() {
53 return interfaceClass;
57 public String getComponentName() {
62 public String getFilter() {
63 return ComponentProcessor.DEFAULT_TYPE_FILTER;
67 public Collection<ReferenceListener> getReferenceListeners() {
68 return Collections.emptyList();