Remove hand-written ServiceLoader services 83/93683/1
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 8 Nov 2020 12:28:38 +0000 (13:28 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 8 Nov 2020 15:02:36 +0000 (16:02 +0100)
@MetaInfServices provides automatic generation of these files, hence
use it to make bindings to code more explicit.

JIRA: BGPCEP-937
Change-Id: I9a4a5627cddfdd7898b83414404d1cae069795ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
93 files changed:
bgp/extensions/evpn/pom.xml
bgp/extensions/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/impl/BGPActivator.java
bgp/extensions/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/impl/RIBActivator.java
bgp/extensions/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/impl/TableTypeActivator.java
bgp/extensions/evpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator [deleted file]
bgp/extensions/evpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator [deleted file]
bgp/extensions/evpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator [deleted file]
bgp/extensions/flowspec/pom.xml
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/BGPActivator.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/RIBActivator.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/TableTypeActivator.java
bgp/extensions/flowspec/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator [deleted file]
bgp/extensions/flowspec/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator [deleted file]
bgp/extensions/flowspec/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator [deleted file]
bgp/extensions/inet/pom.xml
bgp/extensions/inet/src/main/java/org/opendaylight/protocol/bgp/inet/BGPActivator.java
bgp/extensions/inet/src/main/java/org/opendaylight/protocol/bgp/inet/RIBActivator.java
bgp/extensions/inet/src/main/java/org/opendaylight/protocol/bgp/inet/TableTypeActivator.java
bgp/extensions/inet/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator [deleted file]
bgp/extensions/inet/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator [deleted file]
bgp/extensions/inet/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator [deleted file]
bgp/extensions/l3vpn/pom.xml
bgp/extensions/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/BGPActivator.java
bgp/extensions/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/RIBActivator.java
bgp/extensions/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/TableTypeActivator.java
bgp/extensions/l3vpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator [deleted file]
bgp/extensions/l3vpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator [deleted file]
bgp/extensions/l3vpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator [deleted file]
bgp/extensions/labeled-unicast/pom.xml
bgp/extensions/labeled-unicast/src/main/java/org/opendaylight/protocol/bgp/labeled/unicast/BGPActivator.java
bgp/extensions/labeled-unicast/src/main/java/org/opendaylight/protocol/bgp/labeled/unicast/RIBActivator.java
bgp/extensions/labeled-unicast/src/main/java/org/opendaylight/protocol/bgp/labeled/unicast/TableTypeActivator.java
bgp/extensions/labeled-unicast/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator [deleted file]
bgp/extensions/labeled-unicast/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator [deleted file]
bgp/extensions/labeled-unicast/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator [deleted file]
bgp/extensions/linkstate/pom.xml
bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/BGPActivator.java
bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/RIBActivator.java
bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/TableTypeActivator.java
bgp/extensions/linkstate/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator [deleted file]
bgp/extensions/linkstate/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator [deleted file]
bgp/extensions/linkstate/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator [deleted file]
bgp/extensions/mvpn/pom.xml
bgp/extensions/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/BGPActivator.java
bgp/extensions/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/RIBActivator.java
bgp/extensions/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/TableTypeActivator.java
bgp/extensions/mvpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator [deleted file]
bgp/extensions/mvpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator [deleted file]
bgp/extensions/mvpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator [deleted file]
bgp/extensions/route-target/pom.xml
bgp/extensions/route-target/src/main/java/org/opendaylight/protocol/bgp/route/targetcontrain/impl/activators/BGPActivator.java
bgp/extensions/route-target/src/main/java/org/opendaylight/protocol/bgp/route/targetcontrain/impl/activators/RIBActivator.java
bgp/extensions/route-target/src/main/java/org/opendaylight/protocol/bgp/route/targetcontrain/impl/activators/StatementActivator.java
bgp/extensions/route-target/src/main/java/org/opendaylight/protocol/bgp/route/targetcontrain/impl/activators/TableTypeActivator.java
bgp/extensions/route-target/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementProviderActivator [deleted file]
bgp/extensions/route-target/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator [deleted file]
bgp/extensions/route-target/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator [deleted file]
bgp/extensions/route-target/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator [deleted file]
bgp/openconfig-rp-statement/pom.xml
bgp/openconfig-rp-statement/src/main/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/StatementActivator.java
bgp/openconfig-rp-statement/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementProviderActivator [deleted file]
bgp/parser-impl/pom.xml
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/BGPActivator.java
bgp/parser-impl/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator [deleted file]
bmp/bmp-parser-impl/pom.xml
bmp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/BmpActivator.java
bmp/bmp-parser-impl/src/main/resources/META-INF/services/org.opendaylight.protocol.bmp.spi.registry.BmpExtensionProviderActivator [deleted file]
pcep/auto-bandwidth-extension/pom.xml
pcep/auto-bandwidth-extension/src/main/java/org/opendaylight/protocol/pcep/auto/bandwidth/extension/Activator.java
pcep/auto-bandwidth-extension/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator [deleted file]
pcep/base-parser/pom.xml
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/BaseParserExtensionActivator.java
pcep/base-parser/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator [deleted file]
pcep/ietf-p2mp-te-lsp/pom.xml
pcep/ietf-p2mp-te-lsp/src/main/java/org/opendaylight/protocol/pcep/p2mp/te/lsp/Activator.java
pcep/ietf-p2mp-te-lsp/src/main/java/org/opendaylight/protocol/pcep/p2mp/te/lsp/P2MPTeLspCapability.java
pcep/ietf-p2mp-te-lsp/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.PCEPCapability [deleted file]
pcep/ietf-p2mp-te-lsp/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator [deleted file]
pcep/ietf-stateful/pom.xml
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/initiated/InitiatedActivator.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/PCEPStatefulCapability.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulActivator.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/sync/optimizations/SyncOptimizationsActivator.java
pcep/ietf-stateful/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.PCEPCapability [deleted file]
pcep/ietf-stateful/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator [deleted file]
pcep/segment-routing/pom.xml
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/PCEPSegmentRoutingCapability.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/SegmentRoutingActivator.java
pcep/segment-routing/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.PCEPCapability [deleted file]
pcep/segment-routing/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator [deleted file]
rsvp/impl/pom.xml
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/RSVPActivator.java
rsvp/impl/src/main/resources/META-INF/services/org.opendaylight.protocol.rsvp.parser.spi.RSVPExtensionProviderActivator [deleted file]

index e4b08b27ed3b21f4567aa461cc138ab27dc6713e..f26c08db1c63b89e852822057576392370a68111 100644 (file)
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>mdsal-rfc8294-netty</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
 
         <!-- test scope dependencies -->
         <dependency>
index 6d4dfe2eb1e63c2eac58f67dec27a263758e4546..e338d7a528db100a423c96338b981b238e2e5be5 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.protocol.bgp.evpn.impl;
 import com.google.common.annotations.VisibleForTesting;
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.evpn.impl.esi.types.ESIActivator;
 import org.opendaylight.protocol.bgp.evpn.impl.extended.communities.DefaultGatewayExtCom;
 import org.opendaylight.protocol.bgp.evpn.impl.extended.communities.ESILabelExtCom;
@@ -19,6 +20,7 @@ import org.opendaylight.protocol.bgp.evpn.impl.extended.communities.MACMobExtCom
 import org.opendaylight.protocol.bgp.evpn.impl.nlri.EvpnNlriParser;
 import org.opendaylight.protocol.bgp.evpn.impl.nlri.NlriActivator;
 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
 import org.opendaylight.protocol.bgp.parser.spi.NextHopParserSerializer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.EvpnSubsequentAddressFamily;
@@ -33,6 +35,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.next.hop.c.next.hop.Ipv6NextHopCase;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = BGPExtensionProviderActivator.class)
 public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
     @VisibleForTesting
     static final int L2VPN_AFI = 25;
index f563fefa49c2ecb09b003655fdc6fa0cdfce252b..ac63247271f07ee2a6745e226edfebaa3213cb37 100644 (file)
@@ -5,26 +5,25 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.evpn.impl;
 
-import java.util.Collections;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.EvpnSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.L2vpnAddressFamily;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = RIBExtensionProviderActivator.class)
 public final class RIBActivator extends AbstractRIBExtensionProviderActivator {
-
     @Override
     protected List<Registration> startRIBExtensionProviderImpl(
             final RIBExtensionProviderContext context,
             final BindingNormalizedNodeSerializer mappingService) {
-        return Collections.singletonList(context.registerRIBSupport(L2vpnAddressFamily.class,
-                EvpnSubsequentAddressFamily.class,
+        return List.of(context.registerRIBSupport(L2vpnAddressFamily.class, EvpnSubsequentAddressFamily.class,
                 EvpnRibSupport.getInstance(mappingService)));
     }
 }
\ No newline at end of file
index 1d8881e14d853c2df2a404bae8615f5df3ab4547..61d5b3d43cf6821532921e11b2049a07b364d18e 100644 (file)
@@ -5,25 +5,24 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.evpn.impl;
 
-import com.google.common.collect.Lists;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.openconfig.spi.AbstractBGPTableTypeRegistryProviderActivator;
 import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProvider;
+import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator;
 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.L2VPNEVPN;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.EvpnSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.L2vpnAddressFamily;
 import org.opendaylight.yangtools.concepts.AbstractRegistration;
 
+@MetaInfServices(value = BGPTableTypeRegistryProviderActivator.class)
 public final class TableTypeActivator extends AbstractBGPTableTypeRegistryProviderActivator {
-
     @Override
     protected List<AbstractRegistration> startBGPTableTypeRegistryProviderImpl(
             final BGPTableTypeRegistryProvider provider) {
-        return Lists.newArrayList(provider.registerBGPTableType(L2vpnAddressFamily.class,
-                EvpnSubsequentAddressFamily.class, L2VPNEVPN.class));
+        return List.of(provider.registerBGPTableType(L2vpnAddressFamily.class, EvpnSubsequentAddressFamily.class,
+            L2VPNEVPN.class));
     }
-
 }
diff --git a/bgp/extensions/evpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator b/bgp/extensions/evpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator
deleted file mode 100644 (file)
index 6cdb524..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.evpn.impl.TableTypeActivator
\ No newline at end of file
diff --git a/bgp/extensions/evpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator b/bgp/extensions/evpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator
deleted file mode 100644 (file)
index 3f0eb87..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.evpn.impl.BGPActivator
diff --git a/bgp/extensions/evpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator b/bgp/extensions/evpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator
deleted file mode 100644 (file)
index e5c2a1e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.evpn.impl.RIBActivator
index 0d0caa83579707aeea000571cba610cfad78e1e8..44fec5361b1b729107ad80e07a98d5cef4667626 100644 (file)
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-data-impl</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
 
         <!-- test scope dependencies -->
         <dependency>
index 7f6ad74119492261f53935b9f433406f2e2547c6..e6e78e4fb409b8fb83a9528da5e30c2b4be933c4 100644 (file)
@@ -12,6 +12,7 @@ import static java.util.Objects.requireNonNull;
 import java.util.ArrayList;
 import java.util.List;
 import org.eclipse.jdt.annotation.NonNull;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.flowspec.extended.communities.RedirectAsFourOctetEcHandler;
 import org.opendaylight.protocol.bgp.flowspec.extended.communities.RedirectAsTwoOctetEcHandler;
 import org.opendaylight.protocol.bgp.flowspec.extended.communities.RedirectIpNextHopEcHandler;
@@ -25,6 +26,7 @@ import org.opendaylight.protocol.bgp.flowspec.l3vpn.ipv6.FlowspecL3vpnIpv6NlriPa
 import org.opendaylight.protocol.bgp.inet.codec.nexthop.Ipv4NextHopParserSerializer;
 import org.opendaylight.protocol.bgp.inet.codec.nexthop.Ipv6NextHopParserSerializer;
 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.FlowspecL3vpnSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.FlowspecSubsequentAddressFamily;
@@ -46,22 +48,23 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.next.hop.c.next.hop.Ipv6NextHopCase;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = BGPExtensionProviderActivator.class)
 public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
-
     private static final int FLOWSPEC_SAFI = 133;
     private static final int FLOWSPEC_L3VPN_SAFI = 134;
 
     private final FlowspecActivator activator;
 
+    // FIXME: this needs proper injection
     public BGPActivator(final @NonNull FlowspecActivator activator) {
         this.activator = requireNonNull(activator);
     }
 
     @Override
     protected List<Registration> startImpl(final BGPExtensionProviderContext context) {
-        final List<Registration> regs = new ArrayList<>();
-        final SimpleFlowspecExtensionProviderContext flowspecContext = this.activator.getContext();
+        final SimpleFlowspecExtensionProviderContext flowspecContext = activator.getContext();
 
+        final List<Registration> regs = new ArrayList<>();
         regs.add(context.registerSubsequentAddressFamily(FlowspecSubsequentAddressFamily.class, FLOWSPEC_SAFI));
         regs.add(context.registerSubsequentAddressFamily(FlowspecL3vpnSubsequentAddressFamily.class,
             FLOWSPEC_L3VPN_SAFI));
index f3be1262245e5de6d9c786437313c4653c0b63f7..3e0280492753d32e70d5dceb5e08e5305d628882 100644 (file)
@@ -7,12 +7,13 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
-import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.protocol.bgp.flowspec.l3vpn.ipv4.FlowspecL3vpnIpv4RIBSupport;
 import org.opendaylight.protocol.bgp.flowspec.l3vpn.ipv6.FlowspecL3vpnIpv6RIBSupport;
 import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.FlowspecL3vpnSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.FlowspecSubsequentAddressFamily;
@@ -20,27 +21,26 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = RIBExtensionProviderActivator.class)
 public final class RIBActivator extends AbstractRIBExtensionProviderActivator {
-
     private final SimpleFlowspecExtensionProviderContext fsContext;
 
-    public RIBActivator(SimpleFlowspecExtensionProviderContext context) {
-        super();
+    // FIXME: this requires proper injection
+    public RIBActivator(final SimpleFlowspecExtensionProviderContext context) {
         this.fsContext = context;
     }
 
     @Override
     protected List<Registration> startRIBExtensionProviderImpl(final RIBExtensionProviderContext context,
             final BindingNormalizedNodeSerializer mappingService) {
-        final List<Registration> regs = new ArrayList<>(4);
-        regs.add(context.registerRIBSupport(Ipv4AddressFamily.class, FlowspecSubsequentAddressFamily.class,
-                FlowspecIpv4RIBSupport.getInstance(this.fsContext, mappingService)));
-        regs.add(context.registerRIBSupport(Ipv6AddressFamily.class, FlowspecSubsequentAddressFamily.class,
-                FlowspecIpv6RIBSupport.getInstance(this.fsContext, mappingService)));
-        regs.add(context.registerRIBSupport(Ipv4AddressFamily.class, FlowspecL3vpnSubsequentAddressFamily.class,
-                FlowspecL3vpnIpv4RIBSupport.getInstance(this.fsContext, mappingService)));
-        regs.add(context.registerRIBSupport(Ipv6AddressFamily.class, FlowspecL3vpnSubsequentAddressFamily.class,
+        return List.of(
+            context.registerRIBSupport(Ipv4AddressFamily.class, FlowspecSubsequentAddressFamily.class,
+                FlowspecIpv4RIBSupport.getInstance(this.fsContext, mappingService)),
+            context.registerRIBSupport(Ipv6AddressFamily.class, FlowspecSubsequentAddressFamily.class,
+                FlowspecIpv6RIBSupport.getInstance(this.fsContext, mappingService)),
+            context.registerRIBSupport(Ipv4AddressFamily.class, FlowspecL3vpnSubsequentAddressFamily.class,
+                FlowspecL3vpnIpv4RIBSupport.getInstance(this.fsContext, mappingService)),
+            context.registerRIBSupport(Ipv6AddressFamily.class, FlowspecL3vpnSubsequentAddressFamily.class,
                 FlowspecL3vpnIpv6RIBSupport.getInstance(this.fsContext, mappingService)));
-        return regs;
     }
 }
index 6b2311242f1fc5085d69ff84e599fa9d0e1d9e68..fc0aaab1c7625bff731f067c9fcb8d5513ff4b12 100644 (file)
@@ -7,10 +7,11 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
-import java.util.Arrays;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.openconfig.spi.AbstractBGPTableTypeRegistryProviderActivator;
 import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProvider;
+import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.FlowspecL3vpnSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.FlowspecSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.IPV4FLOW;
@@ -21,11 +22,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily;
 import org.opendaylight.yangtools.concepts.AbstractRegistration;
 
+@MetaInfServices(value = BGPTableTypeRegistryProviderActivator.class)
 public final class TableTypeActivator extends AbstractBGPTableTypeRegistryProviderActivator {
     @Override
     protected List<AbstractRegistration> startBGPTableTypeRegistryProviderImpl(
             final BGPTableTypeRegistryProvider provider) {
-        return Arrays.asList(
+        return List.of(
             provider.registerBGPTableType(Ipv4AddressFamily.class, FlowspecSubsequentAddressFamily.class,
                 IPV4FLOW.class),
             provider.registerBGPTableType(Ipv6AddressFamily.class, FlowspecSubsequentAddressFamily.class,
diff --git a/bgp/extensions/flowspec/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator b/bgp/extensions/flowspec/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator
deleted file mode 100644 (file)
index ce0bcc1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.flowspec.TableTypeActivator
\ No newline at end of file
diff --git a/bgp/extensions/flowspec/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator b/bgp/extensions/flowspec/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator
deleted file mode 100644 (file)
index b69f6c3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.flowspec.BGPActivator
diff --git a/bgp/extensions/flowspec/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator b/bgp/extensions/flowspec/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator
deleted file mode 100644 (file)
index 2d1fda0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.flowspec.RIBActivator
index 491fbdee3d661fd6eb403026490c32271f392a04..8a6d6d6290e973d1702211f4e43ea1c1969ffa99 100644 (file)
     <name>${project.artifactId}</name>
 
     <dependencies>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
+
         <!-- test scope dependencies -->
         <dependency>
             <groupId>${project.groupId}</groupId>
index a28069186dfec8cd057e6ff30eeed7814a0a1f04..aea81d913a70ef14e2e3164776a9df82f39a4180 100644 (file)
@@ -7,14 +7,15 @@
  */
 package org.opendaylight.protocol.bgp.inet;
 
-import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.inet.codec.Ipv4NlriParser;
 import org.opendaylight.protocol.bgp.inet.codec.Ipv6BgpPrefixSidParser;
 import org.opendaylight.protocol.bgp.inet.codec.Ipv6NlriParser;
 import org.opendaylight.protocol.bgp.inet.codec.nexthop.Ipv4NextHopParserSerializer;
 import org.opendaylight.protocol.bgp.inet.codec.nexthop.Ipv6NextHopParserSerializer;
 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv4.routes.Ipv4Routes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv6.routes.Ipv6Routes;
@@ -26,27 +27,22 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.next.hop.c.next.hop.Ipv6NextHopCase;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = BGPExtensionProviderActivator.class)
 public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
-
     @Override
     protected List<Registration> startImpl(final BGPExtensionProviderContext context) {
-        final List<Registration> regs = new ArrayList<>(6);
-
-        final Ipv4NextHopParserSerializer ipv4NextHopParser = new Ipv4NextHopParserSerializer();
         final Ipv4NlriParser ipv4Codec = new Ipv4NlriParser();
-        regs.add(context.registerNlriParser(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class,
-                ipv4Codec, ipv4NextHopParser, Ipv4NextHopCase.class, Ipv6NextHopCase.class));
-        regs.add(context.registerNlriSerializer(Ipv4Routes.class, ipv4Codec));
-
-        final Ipv6NextHopParserSerializer ipv6NextHopParser = new Ipv6NextHopParserSerializer();
         final Ipv6NlriParser ipv6Codec = new Ipv6NlriParser();
-        regs.add(context.registerNlriParser(Ipv6AddressFamily.class, UnicastSubsequentAddressFamily.class, ipv6Codec,
-                ipv6NextHopParser, Ipv4NextHopCase.class, Ipv6NextHopCase.class));
-        regs.add(context.registerNlriSerializer(Ipv6Routes.class, ipv6Codec));
-
         final Ipv6BgpPrefixSidParser tlvHandler = new Ipv6BgpPrefixSidParser();
-        regs.add(context.registerBgpPrefixSidTlvParser(tlvHandler.getType(), tlvHandler));
-        regs.add(context.registerBgpPrefixSidTlvSerializer(Ipv6SidTlv.class, tlvHandler));
-        return regs;
+
+        return List.of(
+            context.registerNlriParser(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class,
+                ipv4Codec, new Ipv4NextHopParserSerializer(), Ipv4NextHopCase.class, Ipv6NextHopCase.class),
+            context.registerNlriParser(Ipv6AddressFamily.class, UnicastSubsequentAddressFamily.class, ipv6Codec,
+                new Ipv6NextHopParserSerializer(), Ipv4NextHopCase.class, Ipv6NextHopCase.class),
+            context.registerNlriSerializer(Ipv4Routes.class, ipv4Codec),
+            context.registerNlriSerializer(Ipv6Routes.class, ipv6Codec),
+            context.registerBgpPrefixSidTlvParser(tlvHandler.getType(), tlvHandler),
+            context.registerBgpPrefixSidTlvSerializer(Ipv6SidTlv.class, tlvHandler));
     }
 }
index 15c9dee0fd1cb25d1b896343345e59269a5e426f..aefbeceacab95dbbafdbc9fe8c30cf1aac4665f2 100644 (file)
@@ -7,25 +7,26 @@
  */
 package org.opendaylight.protocol.bgp.inet;
 
-import com.google.common.collect.Lists;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.UnicastSubsequentAddressFamily;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = RIBExtensionProviderActivator.class)
 public final class RIBActivator extends AbstractRIBExtensionProviderActivator {
-
     @Override
     protected List<Registration> startRIBExtensionProviderImpl(final RIBExtensionProviderContext context,
             final BindingNormalizedNodeSerializer mappingService) {
-        return Lists.newArrayList(
-            context.registerRIBSupport(Ipv4AddressFamily.class,
-                    UnicastSubsequentAddressFamily.class, IPv4RIBSupport.getInstance(mappingService)),
-            context.registerRIBSupport(Ipv6AddressFamily.class,
-                    UnicastSubsequentAddressFamily.class, IPv6RIBSupport.getInstance(mappingService)));
+        return List.of(
+            context.registerRIBSupport(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class,
+                IPv4RIBSupport.getInstance(mappingService)),
+            context.registerRIBSupport(Ipv6AddressFamily.class, UnicastSubsequentAddressFamily.class,
+                IPv6RIBSupport.getInstance(mappingService)));
     }
 }
index 81b0fb63b193d9451c0f42d6660b6c0ade22639e..ecad26c3a5e30fc581be37fd94c5f648a2803927 100644 (file)
@@ -5,13 +5,13 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.inet;
 
-import com.google.common.collect.Lists;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.openconfig.spi.AbstractBGPTableTypeRegistryProviderActivator;
 import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProvider;
+import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator;
 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.IPV4UNICAST;
 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.IPV6UNICAST;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily;
@@ -19,16 +19,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.UnicastSubsequentAddressFamily;
 import org.opendaylight.yangtools.concepts.AbstractRegistration;
 
+@MetaInfServices(value = BGPTableTypeRegistryProviderActivator.class)
 public final class TableTypeActivator extends AbstractBGPTableTypeRegistryProviderActivator {
-
     @Override
     protected List<AbstractRegistration> startBGPTableTypeRegistryProviderImpl(
             final BGPTableTypeRegistryProvider provider) {
-        return Lists.newArrayList(
-                provider.registerBGPTableType(Ipv4AddressFamily.class,
-                        UnicastSubsequentAddressFamily.class, IPV4UNICAST.class),
-                provider.registerBGPTableType(Ipv6AddressFamily.class,
-                        UnicastSubsequentAddressFamily.class, IPV6UNICAST.class));
+        return List.of(
+                provider.registerBGPTableType(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class,
+                    IPV4UNICAST.class),
+                provider.registerBGPTableType(Ipv6AddressFamily.class, UnicastSubsequentAddressFamily.class,
+                    IPV6UNICAST.class));
     }
-
 }
diff --git a/bgp/extensions/inet/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator b/bgp/extensions/inet/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator
deleted file mode 100644 (file)
index 2470d41..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.inet.TableTypeActivator
\ No newline at end of file
diff --git a/bgp/extensions/inet/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator b/bgp/extensions/inet/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator
deleted file mode 100644 (file)
index c3e5136..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.inet.BGPActivator
diff --git a/bgp/extensions/inet/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator b/bgp/extensions/inet/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator
deleted file mode 100644 (file)
index bb8d0d8..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.inet.RIBActivator
index e6df933a9d5a7e3a3c53ac8a80121aa9d723a123..82f9c969326f6ebe0e03acd772035e4281186e00 100644 (file)
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>mdsal-binding-spec-util</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
 
         <!-- test scope dependencies -->
         <dependency>
index af7ed2678f5ac61b2e44da5cca0a483778495fc6..0fe6adbd10ca3a9487ab0667bd446bc6d04eefc1 100644 (file)
@@ -5,12 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.l3vpn;
 
 import com.google.common.annotations.VisibleForTesting;
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.inet.codec.nexthop.Ipv4NextHopParserSerializer;
 import org.opendaylight.protocol.bgp.inet.codec.nexthop.Ipv6NextHopParserSerializer;
 import org.opendaylight.protocol.bgp.l3vpn.mcast.nlri.L3vpnMcastIpv4NlriHandler;
@@ -20,6 +20,7 @@ import org.opendaylight.protocol.bgp.l3vpn.unicast.ipv4.VpnIpv4NlriParser;
 import org.opendaylight.protocol.bgp.l3vpn.unicast.ipv6.VpnIpv6NextHopParserSerializer;
 import org.opendaylight.protocol.bgp.l3vpn.unicast.ipv6.VpnIpv6NlriParser;
 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.l3vpn.mcast.rev180417.McastMplsLabeledVpnSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.l3vpn.mcast.rev180417.l3vpn.mcast.routes.ipv4.L3vpnMcastRoutesIpv4;
@@ -38,6 +39,7 @@ import org.opendaylight.yangtools.concepts.Registration;
  *
  * @author Claudio D. Gasparini
  */
+@MetaInfServices(value = BGPExtensionProviderActivator.class)
 public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
     @VisibleForTesting
     static final int MCAST_L3VPN_SAFI = 129;
index aa94da44383d94808b7ae1d997d2f0a2cd501a9a..2b969d2b8d99a5e64cf6e9249d749c0cc4b6c2e7 100644 (file)
@@ -7,14 +7,15 @@
  */
 package org.opendaylight.protocol.bgp.l3vpn;
 
-import com.google.common.collect.Lists;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.protocol.bgp.l3vpn.mcast.L3VpnMcastIpv4RIBSupport;
 import org.opendaylight.protocol.bgp.l3vpn.mcast.L3VpnMcastIpv6RIBSupport;
 import org.opendaylight.protocol.bgp.l3vpn.unicast.ipv4.VpnIpv4RIBSupport;
 import org.opendaylight.protocol.bgp.l3vpn.unicast.ipv6.VpnIpv6RIBSupport;
 import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.l3vpn.mcast.rev180417.McastMplsLabeledVpnSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily;
@@ -27,11 +28,12 @@ import org.opendaylight.yangtools.concepts.Registration;
  *
  * @author Claudio D. Gasparini
  */
+@MetaInfServices(value = RIBExtensionProviderActivator.class)
 public final class RIBActivator extends AbstractRIBExtensionProviderActivator {
     @Override
     protected List<Registration> startRIBExtensionProviderImpl(final RIBExtensionProviderContext context,
             final BindingNormalizedNodeSerializer mappingService) {
-        return Lists.newArrayList(
+        return List.of(
                 context.registerRIBSupport(Ipv4AddressFamily.class,
                         MplsLabeledVpnSubsequentAddressFamily.class, VpnIpv4RIBSupport.getInstance(mappingService)),
                 context.registerRIBSupport(Ipv6AddressFamily.class,
index 381eb06cbd8b4747bf0bee72627d66bed5d08865..393a97be220952a6518ef2a3ab7ece12772e63fa 100644 (file)
@@ -5,13 +5,13 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.l3vpn;
 
-import com.google.common.collect.Lists;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.openconfig.spi.AbstractBGPTableTypeRegistryProviderActivator;
 import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProvider;
+import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator;
 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.L3VPNIPV4MULTICAST;
 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.L3VPNIPV4UNICAST;
 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.L3VPNIPV6MULTICAST;
@@ -27,11 +27,12 @@ import org.opendaylight.yangtools.concepts.AbstractRegistration;
  *
  * @author Claudio D. Gasparini
  */
+@MetaInfServices(value = BGPTableTypeRegistryProviderActivator.class)
 public final class TableTypeActivator extends AbstractBGPTableTypeRegistryProviderActivator {
     @Override
     protected List<AbstractRegistration> startBGPTableTypeRegistryProviderImpl(
             final BGPTableTypeRegistryProvider provider) {
-        return Lists.newArrayList(
+        return List.of(
                 provider.registerBGPTableType(Ipv4AddressFamily.class,
                         MplsLabeledVpnSubsequentAddressFamily.class, L3VPNIPV4UNICAST.class),
                 provider.registerBGPTableType(Ipv6AddressFamily.class,
diff --git a/bgp/extensions/l3vpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator b/bgp/extensions/l3vpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator
deleted file mode 100644 (file)
index dfe746c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.l3vpn.TableTypeActivator
\ No newline at end of file
diff --git a/bgp/extensions/l3vpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator b/bgp/extensions/l3vpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator
deleted file mode 100644 (file)
index 05ed701..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.l3vpn.BGPActivator
\ No newline at end of file
diff --git a/bgp/extensions/l3vpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator b/bgp/extensions/l3vpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator
deleted file mode 100644 (file)
index 5ff8346..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.l3vpn.RIBActivator
\ No newline at end of file
index 440f818869699fee98e0a0d8b826f3cb44259c8c..616cc225a8fda4a5949ba6ee9575d88f8e0c27e7 100644 (file)
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
 
         <!-- test scope dependencies -->
         <dependency>
index 869eb98a623dc0652cb9b56b3645bd7f6e60a519..f3ae65b80dfea03e7dd01ce16edff30e199ba732 100644 (file)
@@ -7,11 +7,12 @@
  */
 package org.opendaylight.protocol.bgp.labeled.unicast;
 
-import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.inet.codec.nexthop.Ipv4NextHopParserSerializer;
 import org.opendaylight.protocol.bgp.inet.codec.nexthop.Ipv6NextHopParserSerializer;
 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.LabeledUnicastSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.labeled.unicast.routes.LabeledUnicastRoutes;
@@ -23,34 +24,26 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.next.hop.c.next.hop.Ipv6NextHopCase;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = BGPExtensionProviderActivator.class)
 public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
-
     private static final int LABELED_UNICAST_SAFI = 4;
 
     @Override
     protected List<Registration> startImpl(final BGPExtensionProviderContext context) {
-        final List<Registration> regs = new ArrayList<>(8);
         final LUNlriParser luNlriParser = new LUNlriParser();
-
-        regs.add(context.registerSubsequentAddressFamily(LabeledUnicastSubsequentAddressFamily.class,
-            LABELED_UNICAST_SAFI));
-
-        final Ipv4NextHopParserSerializer ipv4NextHopParser = new Ipv4NextHopParserSerializer();
-        final Ipv6NextHopParserSerializer ipv6NextHopParser = new Ipv6NextHopParserSerializer();
-        regs.add(context.registerNlriParser(Ipv4AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class,
-                luNlriParser, ipv4NextHopParser, Ipv4NextHopCase.class));
-        regs.add(context.registerNlriParser(Ipv6AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class,
-                luNlriParser, ipv6NextHopParser, Ipv6NextHopCase.class));
-
-        regs.add(context.registerNlriSerializer(LabeledUnicastRoutes.class, luNlriParser));
-
         final LabelIndexTlvParser labelHandler = new LabelIndexTlvParser();
         final OriginatorSrgbTlvParser originatorHandler = new OriginatorSrgbTlvParser();
-        regs.add(context.registerBgpPrefixSidTlvParser(labelHandler.getType(), labelHandler));
-        regs.add(context.registerBgpPrefixSidTlvParser(originatorHandler.getType(), originatorHandler));
-        regs.add(context.registerBgpPrefixSidTlvSerializer(LuLabelIndexTlv.class, labelHandler));
-        regs.add(context.registerBgpPrefixSidTlvSerializer(LuOriginatorSrgbTlv.class, originatorHandler));
 
-        return regs;
+        return List.of(
+            context.registerSubsequentAddressFamily(LabeledUnicastSubsequentAddressFamily.class, LABELED_UNICAST_SAFI),
+            context.registerNlriParser(Ipv4AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class,
+                luNlriParser, new Ipv4NextHopParserSerializer(), Ipv4NextHopCase.class),
+            context.registerNlriParser(Ipv6AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class,
+                luNlriParser, new Ipv6NextHopParserSerializer(), Ipv6NextHopCase.class),
+            context.registerNlriSerializer(LabeledUnicastRoutes.class, luNlriParser),
+            context.registerBgpPrefixSidTlvParser(labelHandler.getType(), labelHandler),
+            context.registerBgpPrefixSidTlvParser(originatorHandler.getType(), originatorHandler),
+            context.registerBgpPrefixSidTlvSerializer(LuLabelIndexTlv.class, labelHandler),
+            context.registerBgpPrefixSidTlvSerializer(LuOriginatorSrgbTlv.class, originatorHandler));
     }
 }
index 661418ebebbdbe0152d6bfe53cadf228f3f774e5..96b012ea87b25fc20c1a96b82457067ea40da7d7 100644 (file)
@@ -7,26 +7,26 @@
  */
 package org.opendaylight.protocol.bgp.labeled.unicast;
 
-import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.LabeledUnicastSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = RIBExtensionProviderActivator.class)
 public class RIBActivator extends AbstractRIBExtensionProviderActivator {
-
     @Override
     protected List<Registration> startRIBExtensionProviderImpl(final RIBExtensionProviderContext context,
             final BindingNormalizedNodeSerializer mappingService) {
-        final List<Registration> regs = new ArrayList<>(2);
-        regs.add(context.registerRIBSupport(Ipv4AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class,
-                LabeledUnicastIpv4RIBSupport.getInstance(mappingService)));
-        regs.add(context.registerRIBSupport(Ipv6AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class,
+        return List.of(
+            context.registerRIBSupport(Ipv4AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class,
+                LabeledUnicastIpv4RIBSupport.getInstance(mappingService)),
+            context.registerRIBSupport(Ipv6AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class,
                 LabeledUnicastIpv6RIBSupport.getInstance(mappingService)));
-        return regs;
     }
 }
index 8af0d64f66eee7c9b65a562b36a2a06e1b543cc5..9d59f87655c724a676a2d13bdccf5051459acde5 100644 (file)
@@ -7,10 +7,11 @@
  */
 package org.opendaylight.protocol.bgp.labeled.unicast;
 
-import com.google.common.collect.ImmutableList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.openconfig.spi.AbstractBGPTableTypeRegistryProviderActivator;
 import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProvider;
+import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator;
 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.IPV4LABELLEDUNICAST;
 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.IPV6LABELLEDUNICAST;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.LabeledUnicastSubsequentAddressFamily;
@@ -18,16 +19,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily;
 import org.opendaylight.yangtools.concepts.AbstractRegistration;
 
+@MetaInfServices(value = BGPTableTypeRegistryProviderActivator.class)
 public final class TableTypeActivator extends AbstractBGPTableTypeRegistryProviderActivator {
-
     @Override
     protected List<AbstractRegistration> startBGPTableTypeRegistryProviderImpl(
             final BGPTableTypeRegistryProvider provider) {
-        return ImmutableList.of(
+        return List.of(
                 provider.registerBGPTableType(Ipv4AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class,
                     IPV4LABELLEDUNICAST.class),
                 provider.registerBGPTableType(Ipv6AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class,
                     IPV6LABELLEDUNICAST.class));
     }
-
 }
diff --git a/bgp/extensions/labeled-unicast/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator b/bgp/extensions/labeled-unicast/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator
deleted file mode 100644 (file)
index 41f62ba..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.labeled.unicast.TableTypeActivator
\ No newline at end of file
diff --git a/bgp/extensions/labeled-unicast/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator b/bgp/extensions/labeled-unicast/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator
deleted file mode 100644 (file)
index 149475d..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.labeled.unicast.BGPActivator
diff --git a/bgp/extensions/labeled-unicast/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator b/bgp/extensions/labeled-unicast/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator
deleted file mode 100644 (file)
index 7c4df06..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.labeled.unicast.RIBActivator
index 4dcc70c6837bf14b463b21f7f9e4ddf2d538ef0f..0dde1a456e7f5abfb5c416d0c8d2630a58cc3ce9 100644 (file)
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>mdsal-rfc8294-netty</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
 
         <!-- test scope dependencies -->
         <dependency>
index 848149ca3909fed196157e76498fe8ef5b04c472..9f983461353b7aa54964fe538c671adc7cbb5eea 100644 (file)
@@ -7,8 +7,10 @@
  */
 package org.opendaylight.protocol.bgp.linkstate.impl;
 
+import com.google.common.base.MoreObjects;
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.linkstate.impl.attribute.LinkstateAttributeParser;
 import org.opendaylight.protocol.bgp.linkstate.impl.attribute.sr.binding.sid.sub.tlvs.BackupUnnumberedParser;
 import org.opendaylight.protocol.bgp.linkstate.impl.attribute.sr.binding.sid.sub.tlvs.EroMetricParser;
@@ -48,6 +50,7 @@ import org.opendaylight.protocol.bgp.linkstate.impl.tlvs.RouterIdTlvParser;
 import org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleBindingSubTlvsRegistry;
 import org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry;
 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
 import org.opendaylight.protocol.bgp.parser.spi.NextHopParserSerializer;
 import org.opendaylight.protocol.rsvp.parser.spi.RSVPTeObjectRegistry;
@@ -76,24 +79,20 @@ import org.opendaylight.yangtools.concepts.Registration;
 /**
  * Activator for registering linkstate extensions to BGP parser.
  */
+@MetaInfServices(value = BGPExtensionProviderActivator.class)
 public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
-
     private static final int LINKSTATE_AFI = 16388;
-
     private static final int LINKSTATE_SAFI = 71;
 
     private final boolean ianaLinkstateAttributeType;
-
     private final RSVPTeObjectRegistry rsvpTeObjectRegistry;
 
     public BGPActivator() {
-        super();
-        this.ianaLinkstateAttributeType = true;
-        this.rsvpTeObjectRegistry = null;
+        this(true, null);
     }
 
+    // FIXME: this should be properly injected
     public BGPActivator(final boolean ianaLinkstateAttributeType, final RSVPTeObjectRegistry rsvpTeObjectRegistry) {
-        super();
         this.rsvpTeObjectRegistry = rsvpTeObjectRegistry;
         this.ianaLinkstateAttributeType = ianaLinkstateAttributeType;
     }
@@ -267,4 +266,9 @@ public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
         regs.add(nlriTypeReg.registerTlvParser(ospfRouterParser.getType(), ospfRouterParser));
         regs.add(nlriTypeReg.registerTlvSerializer(ospfRouterParser.getTlvQName(), ospfRouterParser));
     }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this).add("ianaLinkstateAttribute", ianaLinkstateAttributeType).toString();
+    }
 }
index abf8681e42d1da7ea1dc6ea270eef6b1c81ff964..f9aa38f9d69da259caaab240aded4b77708f7952 100644 (file)
@@ -7,10 +7,11 @@
  */
 package org.opendaylight.protocol.bgp.linkstate.impl;
 
-import java.util.Collections;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.LinkstateAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.LinkstateSubsequentAddressFamily;
@@ -19,11 +20,12 @@ import org.opendaylight.yangtools.concepts.Registration;
 /**
  * Activator for registering Linkstate AFI/SAFI to RIB.
  */
+@MetaInfServices(value = RIBExtensionProviderActivator.class)
 public final class RIBActivator extends AbstractRIBExtensionProviderActivator {
     @Override
     protected List<Registration> startRIBExtensionProviderImpl(final RIBExtensionProviderContext context,
             final BindingNormalizedNodeSerializer mappingService) {
-        return Collections.singletonList(context.registerRIBSupport(LinkstateAddressFamily.class,
+        return List.of(context.registerRIBSupport(LinkstateAddressFamily.class,
                 LinkstateSubsequentAddressFamily.class, LinkstateRIBSupport.getInstance(mappingService)));
     }
 }
index 8fa1d8e1d36a97215d8171596fb76ce0002ef964..c80dacef648ae9d3237d447eae54bd41991640b0 100644 (file)
@@ -5,24 +5,24 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.linkstate.impl;
 
-import com.google.common.collect.Lists;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.openconfig.spi.AbstractBGPTableTypeRegistryProviderActivator;
 import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProvider;
+import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.LinkstateAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.LinkstateSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.LINKSTATE;
 import org.opendaylight.yangtools.concepts.AbstractRegistration;
 
+@MetaInfServices(value = BGPTableTypeRegistryProviderActivator.class)
 public final class TableTypeActivator extends AbstractBGPTableTypeRegistryProviderActivator {
     @Override
     protected List<AbstractRegistration> startBGPTableTypeRegistryProviderImpl(
             final BGPTableTypeRegistryProvider provider) {
-        return Lists.newArrayList(provider.registerBGPTableType(LinkstateAddressFamily.class,
+        return List.of(provider.registerBGPTableType(LinkstateAddressFamily.class,
                 LinkstateSubsequentAddressFamily.class, LINKSTATE.class));
     }
-
 }
diff --git a/bgp/extensions/linkstate/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator b/bgp/extensions/linkstate/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator
deleted file mode 100644 (file)
index 3e0046d..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.linkstate.impl.TableTypeActivator
\ No newline at end of file
diff --git a/bgp/extensions/linkstate/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator b/bgp/extensions/linkstate/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator
deleted file mode 100644 (file)
index be962e2..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
-# 
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which 
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.linkstate.impl.BGPActivator
diff --git a/bgp/extensions/linkstate/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator b/bgp/extensions/linkstate/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator
deleted file mode 100644 (file)
index 3c5ffda..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
-# 
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which 
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.linkstate.impl.RIBActivator
index de61796d1a9abdd40ea58c7ea972a18a9fd6a604..338d910a140571a2e41b3c56fb720f18e98a044b 100644 (file)
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-common-netty</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
 
         <!-- test scope dependencies -->
         <dependency>
index 58f23dcf66e52006d9bf4cad47635568186c81b5..7aa38d81ace5311e59f3e43796432d246eeb1471 100644 (file)
@@ -5,12 +5,12 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.mvpn.impl;
 
 import com.google.common.annotations.VisibleForTesting;
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.inet.codec.nexthop.Ipv4NextHopParserSerializer;
 import org.opendaylight.protocol.bgp.inet.codec.nexthop.Ipv6NextHopParserSerializer;
 import org.opendaylight.protocol.bgp.mvpn.impl.attributes.PEDistinguisherLabelsAttributeHandler;
@@ -18,6 +18,7 @@ import org.opendaylight.protocol.bgp.mvpn.impl.attributes.PMSITunnelAttributeHan
 import org.opendaylight.protocol.bgp.mvpn.impl.nlri.MvpnIpv4NlriHandler;
 import org.opendaylight.protocol.bgp.mvpn.impl.nlri.MvpnIpv6NlriHandler;
 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.ipv4.rev180417.mvpn.routes.ipv4.MvpnRoutesIpv4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.ipv6.rev180417.mvpn.routes.ipv6.MvpnRoutesIpv6;
@@ -33,6 +34,7 @@ import org.opendaylight.yangtools.concepts.Registration;
  *
  * @author Claudio D. Gasparini
  */
+@MetaInfServices(value = BGPExtensionProviderActivator.class)
 public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
     @VisibleForTesting
     static final int MVPN_SAFI = 5;
index 373c07dcd226f464c5f1085dbd4e2cedfa3292d7..5519bac9c23d77874963877cbf27db7e0162863f 100644 (file)
@@ -7,10 +7,11 @@
  */
 package org.opendaylight.protocol.bgp.mvpn.impl;
 
-import com.google.common.collect.Lists;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev200120.McastVpnSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily;
@@ -22,15 +23,15 @@ import org.opendaylight.yangtools.concepts.Registration;
  *
  * @author Claudio D. Gasparini
  */
+@MetaInfServices(value = RIBExtensionProviderActivator.class)
 public final class RIBActivator extends AbstractRIBExtensionProviderActivator {
     @Override
     protected List<Registration> startRIBExtensionProviderImpl(final RIBExtensionProviderContext context,
             final BindingNormalizedNodeSerializer mappingService) {
-        return Lists.newArrayList(
-                context.registerRIBSupport(Ipv4AddressFamily.class, McastVpnSubsequentAddressFamily.class,
-                        MvpnIpv4RIBSupport.getInstance(mappingService)),
-                context.registerRIBSupport(Ipv6AddressFamily.class, McastVpnSubsequentAddressFamily.class,
-                        MvpnIpv6RIBSupport.getInstance(mappingService))
-        );
+        return List.of(
+            context.registerRIBSupport(Ipv4AddressFamily.class, McastVpnSubsequentAddressFamily.class,
+                MvpnIpv4RIBSupport.getInstance(mappingService)),
+            context.registerRIBSupport(Ipv6AddressFamily.class, McastVpnSubsequentAddressFamily.class,
+                MvpnIpv6RIBSupport.getInstance(mappingService)));
     }
 }
index 7fa054bfdb26e98f2443878b72d64636597e1fa9..e12d4ca3227886f87ba164dd4125458ba7cc1ec7 100644 (file)
@@ -5,13 +5,13 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.mvpn.impl;
 
-import com.google.common.collect.Lists;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.openconfig.spi.AbstractBGPTableTypeRegistryProviderActivator;
 import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProvider;
+import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev200120.McastVpnSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.IPV4MCASTVPN;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.IPV6MCASTVPN;
@@ -24,11 +24,12 @@ import org.opendaylight.yangtools.concepts.AbstractRegistration;
  *
  * @author Claudio D. Gasparini
  */
+@MetaInfServices(value = BGPTableTypeRegistryProviderActivator.class)
 public final class TableTypeActivator extends AbstractBGPTableTypeRegistryProviderActivator {
     @Override
     protected List<AbstractRegistration> startBGPTableTypeRegistryProviderImpl(
             final BGPTableTypeRegistryProvider provider) {
-        return Lists.newArrayList(
+        return List.of(
                 provider.registerBGPTableType(
                         Ipv4AddressFamily.class, McastVpnSubsequentAddressFamily.class, IPV4MCASTVPN.class),
                 provider.registerBGPTableType(
diff --git a/bgp/extensions/mvpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator b/bgp/extensions/mvpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator
deleted file mode 100644 (file)
index d72a408..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.mvpn.impl.TableTypeActivator
\ No newline at end of file
diff --git a/bgp/extensions/mvpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator b/bgp/extensions/mvpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator
deleted file mode 100644 (file)
index 78fd9ec..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.mvpn.impl.BGPActivator
diff --git a/bgp/extensions/mvpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator b/bgp/extensions/mvpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator
deleted file mode 100644 (file)
index 5b9c8d4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.mvpn.impl.RIBActivator
\ No newline at end of file
index 21c9ce36ad5d096b2b24ba400880f9e9b7307350..9cd482f27f44afd16e9d092ff58349f04a566390 100644 (file)
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>mdsal-binding-spec-util</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
 
         <!-- test scope dependencies -->
         <dependency>
index 726c8d37b2865fdbbc859c986b13ad19229fdeae..dd5ee4cb3929d09fcd10fa150eb4ddec3d1d3d89 100644 (file)
@@ -5,14 +5,15 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.route.targetcontrain.impl.activators;
 
 import com.google.common.annotations.VisibleForTesting;
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.inet.codec.nexthop.Ipv4NextHopParserSerializer;
 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
 import org.opendaylight.protocol.bgp.route.targetcontrain.impl.nlri.RouteTargetConstrainNlriHandler;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.route.target.constrain.rev180618.RouteTargetConstrainSubsequentAddressFamily;
@@ -27,6 +28,7 @@ import org.opendaylight.yangtools.concepts.Registration;
  *
  * @author Claudio D. Gasparini
  */
+@MetaInfServices(value = BGPExtensionProviderActivator.class)
 public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
     @VisibleForTesting
     static final int RT_SAFI = 132;
index 4290ec0db0b4c475074fc44589924f7b7f75d2ff..a2b133e37d5aea3c49fe8424230809dde146bc6c 100644 (file)
@@ -9,8 +9,10 @@ package org.opendaylight.protocol.bgp.route.targetcontrain.impl.activators;
 
 import java.util.Collections;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
 import org.opendaylight.protocol.bgp.route.targetcontrain.impl.RouteTargetConstrainRIBSupport;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.route.target.constrain.rev180618.RouteTargetConstrainSubsequentAddressFamily;
@@ -22,6 +24,7 @@ import org.opendaylight.yangtools.concepts.Registration;
  *
  * @author Claudio D. Gasparini
  */
+@MetaInfServices(value = RIBExtensionProviderActivator.class)
 public final class RIBActivator extends AbstractRIBExtensionProviderActivator {
     @Override
     protected List<Registration> startRIBExtensionProviderImpl(final RIBExtensionProviderContext context,
index 56053d41ac6856ff996343edc9a7fc492fbad40b..3a219e191669a31771cd46c17d1429e2c7a93e08 100644 (file)
@@ -9,12 +9,15 @@ package org.opendaylight.protocol.bgp.route.targetcontrain.impl.activators;
 
 import java.util.Collections;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.AbstractBGPStatementProviderActivator;
+import org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementProviderActivator;
 import org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistryProvider;
 import org.opendaylight.protocol.bgp.route.targetcontrain.impl.route.policy.ClientAttributePrependHandler;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.route.target.constrain.rev180618.ClientAttributePrepend;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = StatementProviderActivator.class)
 public final class StatementActivator extends AbstractBGPStatementProviderActivator {
     @Override
     protected synchronized List<Registration> startImpl(final StatementRegistryProvider provider) {
index 56cd6b533f098c5ea470b3d8a446a4e050c3493e..f2192b8a65865f53be336a90862d1c336bc1ae31 100644 (file)
@@ -5,13 +5,14 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.route.targetcontrain.impl.activators;
 
 import java.util.Collections;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.openconfig.spi.AbstractBGPTableTypeRegistryProviderActivator;
 import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProvider;
+import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.ROUTETARGETCONSTRAIN;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.route.target.constrain.rev180618.RouteTargetConstrainSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily;
@@ -22,6 +23,7 @@ import org.opendaylight.yangtools.concepts.AbstractRegistration;
  *
  * @author Claudio D. Gasparini
  */
+@MetaInfServices(value = BGPTableTypeRegistryProviderActivator.class)
 public final class TableTypeActivator extends AbstractBGPTableTypeRegistryProviderActivator {
     @Override
     protected List<AbstractRegistration> startBGPTableTypeRegistryProviderImpl(
diff --git a/bgp/extensions/route-target/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementProviderActivator b/bgp/extensions/route-target/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementProviderActivator
deleted file mode 100644 (file)
index b27504c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-#
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.route.targetcontrain.impl.activators.StatementActivator
\ No newline at end of file
diff --git a/bgp/extensions/route-target/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator b/bgp/extensions/route-target/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator
deleted file mode 100644 (file)
index e833335..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-#
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.route.targetcontrain.impl.activators.TableTypeActivator
\ No newline at end of file
diff --git a/bgp/extensions/route-target/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator b/bgp/extensions/route-target/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator
deleted file mode 100644 (file)
index 7db132f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-#
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.route.targetcontrain.impl.activators.BGPActivator
diff --git a/bgp/extensions/route-target/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator b/bgp/extensions/route-target/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator
deleted file mode 100644 (file)
index 2557bf0..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-#
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.route.targetcontrain.impl.activators.RIBActivator
\ No newline at end of file
index 5884e40a9dd27758a9969136f109a7d1cfac3e9f..12ba52d2b836aab67e3e92b1da27e919a9ea2948 100644 (file)
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
+
         <!-- Test dependencies -->
         <dependency>
             <groupId>${project.groupId}</groupId>
index 0ecced86052dffcf3aa98f199981fb4c4e15dcec..e4395206304e8ea4d82d8dc1d211dbe43dc6bcac 100644 (file)
@@ -11,8 +11,10 @@ import static java.util.Objects.requireNonNull;
 
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.AbstractBGPStatementProviderActivator;
+import org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementProviderActivator;
 import org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistryProvider;
 import org.opendaylight.protocol.bgp.openconfig.routing.policy.statement.actions.AsPathPrepend;
 import org.opendaylight.protocol.bgp.openconfig.routing.policy.statement.actions.LocalAsPathPrependHandler;
@@ -48,9 +50,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp._default.policy.rev200120.VpnNonMemberCondition;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = StatementProviderActivator.class)
 public final class StatementActivator extends AbstractBGPStatementProviderActivator {
     private final DataBroker dataBroker;
 
+    // FIXME: this needs to be properly injected
     public StatementActivator(final DataBroker dataBroker) {
         this.dataBroker = requireNonNull(dataBroker);
     }
diff --git a/bgp/openconfig-rp-statement/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementProviderActivator b/bgp/openconfig-rp-statement/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementProviderActivator
deleted file mode 100644 (file)
index ad4e974..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.openconfig.routing.policy.statement.StatementActivator
\ No newline at end of file
index e8292247af084c20ace3c8f33b5835a38f51c286..03b3c765571e532b4108d33423119a4cd5b116c7 100644 (file)
             <groupId>org.osgi</groupId>
             <artifactId>osgi.cmpn</artifactId>
         </dependency>
-        <dependency>
-            <groupId>javax.annotation</groupId>
-            <artifactId>javax.annotation-api</artifactId>
-            <scope>provided</scope>
-            <optional>true</optional>
-        </dependency>
         <dependency>
             <groupId>javax.inject</groupId>
             <artifactId>javax.inject</artifactId>
             <scope>provided</scope>
             <optional>true</optional>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>mockito-configuration</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.hamcrest</groupId>
-            <artifactId>hamcrest-core</artifactId>
-        </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>bgp-util</artifactId>
index 8ab76e9b26706cc08de5e38215486570775e55a0..77e3c4cc57faf2a0c751efad5fd8e9f2791d336a 100644 (file)
@@ -11,6 +11,7 @@ import java.util.ArrayList;
 import java.util.List;
 import javax.inject.Inject;
 import javax.inject.Singleton;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.parser.impl.message.BGPKeepAliveMessageParser;
 import org.opendaylight.protocol.bgp.parser.impl.message.BGPNotificationMessageParser;
 import org.opendaylight.protocol.bgp.parser.impl.message.BGPOpenMessageParser;
@@ -117,6 +118,7 @@ import org.osgi.service.component.annotations.Component;
 @Singleton
 @Component(immediate = true, service = BGPExtensionProviderActivator.class,
            property = "type=org.opendaylight.protocol.bgp.parser.impl.BGPActivator")
+@MetaInfServices(value = BGPExtensionProviderActivator.class)
 public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
     private static final int IPV4_AFI = 1;
     private static final int IPV6_AFI = 2;
diff --git a/bgp/parser-impl/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator b/bgp/parser-impl/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator
deleted file mode 100644 (file)
index c079dc1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
-# 
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which 
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bgp.parser.impl.BGPActivator
index 622d7f6d2caf2ddd181752404db26f59191527a5..d378a49bb78db40e6142abf7a0f92d4c20359544 100644 (file)
             <groupId>io.netty</groupId>
             <artifactId>netty-buffer</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
+
         <!-- test dependencies -->
         <dependency>
             <groupId>${project.groupId}</groupId>
index 21fa761a6c66bee4cea3bcccc34abfb5f5e0784b..c1ee040f819888f739b85011df2d6fa77ffd2904 100644 (file)
@@ -5,11 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bmp.parser;
 
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.bgp.parser.spi.AddressFamilyRegistry;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionConsumerContext;
 import org.opendaylight.protocol.bgp.parser.spi.MessageRegistry;
@@ -41,6 +41,7 @@ import org.opendaylight.protocol.bmp.parser.tlv.StatType012TlvHandler;
 import org.opendaylight.protocol.bmp.parser.tlv.StatType013TlvHandler;
 import org.opendaylight.protocol.bmp.parser.tlv.StringTlvHandler;
 import org.opendaylight.protocol.bmp.spi.registry.AbstractBmpExtensionProviderActivator;
+import org.opendaylight.protocol.bmp.spi.registry.BmpExtensionProviderActivator;
 import org.opendaylight.protocol.bmp.spi.registry.BmpExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.InitiationMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.PeerDownNotification;
@@ -69,17 +70,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.stat.tlvs.UpdatesTreatedAsWithdrawTlv;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.string.tlv.StringTlv;
 
-
-
-/**
- * Created by cgasparini on 15.5.2015.
- */
+@MetaInfServices(value = BmpExtensionProviderActivator.class)
 public final class BmpActivator extends AbstractBmpExtensionProviderActivator {
-
     private final MessageRegistry messageRegistry;
     private final AddressFamilyRegistry afiRegistry;
     private final SubsequentAddressFamilyRegistry safiRegistry;
 
+    // FIXME: this needs to be properly injected
     public BmpActivator(final BGPExtensionConsumerContext context) {
         this.messageRegistry = context.getMessageRegistry();
         this.afiRegistry = context.getAddressFamilyRegistry();
diff --git a/bmp/bmp-parser-impl/src/main/resources/META-INF/services/org.opendaylight.protocol.bmp.spi.registry.BmpExtensionProviderActivator b/bmp/bmp-parser-impl/src/main/resources/META-INF/services/org.opendaylight.protocol.bmp.spi.registry.BmpExtensionProviderActivator
deleted file mode 100644 (file)
index ec2f25c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.bmp.parser.BmpActivator
index effc538df108712cdd4352738b9e0a95571779d6..b1da57dedaed128c527e90dbec741173aaa2d551 100644 (file)
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
 
         <!--test dependencies -->
         <dependency>
index 6c5ba9c5445e43f82d62ad8128081662add0a816..88feca0cf9ecbcde5198fd281d393bd7a9dd2994 100644 (file)
@@ -7,21 +7,23 @@
  */
 package org.opendaylight.protocol.pcep.auto.bandwidth.extension;
 
-import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.MoreObjects;
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
 import org.opendaylight.protocol.pcep.spi.pojo.AbstractPCEPExtensionProviderActivator;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.auto.bandwidth.rev181109.bandwidth.usage.object.BandwidthUsage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.Pcrpt;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = PCEPExtensionProviderActivator.class)
 public class Activator extends AbstractPCEPExtensionProviderActivator {
     private final int bandwidthUsageObjectType;
 
-    @VisibleForTesting
     public Activator() {
-        this(1);
+        this(5);
     }
 
     public Activator(final int bandwidthUsageObjectType) {
@@ -33,7 +35,7 @@ public class Activator extends AbstractPCEPExtensionProviderActivator {
         final List<Registration> regs = new ArrayList<>();
 
         final BandwidthUsageObjectCodec bandwidthUsageObjectCodec =
-                new BandwidthUsageObjectCodec(this.bandwidthUsageObjectType);
+                new BandwidthUsageObjectCodec(bandwidthUsageObjectType);
         regs.add(context.registerObjectParser(bandwidthUsageObjectCodec));
         regs.add(context.registerObjectSerializer(BandwidthUsage.class, bandwidthUsageObjectCodec));
 
@@ -43,4 +45,9 @@ public class Activator extends AbstractPCEPExtensionProviderActivator {
 
         return regs;
     }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this).add("bandwithUsage", bandwidthUsageObjectType).toString();
+    }
 }
diff --git a/pcep/auto-bandwidth-extension/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator b/pcep/auto-bandwidth-extension/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator
deleted file mode 100644 (file)
index fa65d62..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.pcep.auto.bandwidth.extension.Activator
index 875d24f037f791718ca3a72384e6de51f49d4b61..9407e365925525331ec45752dddc5e0decd90726 100644 (file)
             <artifactId>guava</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>osgi.cmpn</artifactId>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
         </dependency>
         <dependency>
-            <groupId>javax.annotation</groupId>
-            <artifactId>javax.annotation-api</artifactId>
-            <scope>provided</scope>
-            <optional>true</optional>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.cmpn</artifactId>
         </dependency>
         <dependency>
             <groupId>javax.inject</groupId>
index d5ab95aa4d196734001c5a24a7000246a7b4fe4c..8bf350b6d7a534ea992773284b2e351a65c3bf06 100644 (file)
@@ -11,6 +11,7 @@ import java.util.ArrayList;
 import java.util.List;
 import javax.inject.Inject;
 import javax.inject.Singleton;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.pcep.parser.message.PCEPCloseMessageParser;
 import org.opendaylight.protocol.pcep.parser.message.PCEPErrorMessageParser;
 import org.opendaylight.protocol.pcep.parser.message.PCEPKeepAliveMessageParser;
@@ -154,6 +155,7 @@ import org.opendaylight.yangtools.concepts.Registration;
 import org.osgi.service.component.annotations.Component;
 
 @Singleton
+@MetaInfServices(value = PCEPExtensionProviderActivator.class)
 @Component(immediate = true, service = PCEPExtensionProviderActivator.class,
            property = "type=org.opendaylight.protocol.pcep.parser.BaseParserExtensionActivator")
 public final class BaseParserExtensionActivator extends AbstractPCEPExtensionProviderActivator {
diff --git a/pcep/base-parser/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator b/pcep/base-parser/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator
deleted file mode 100644 (file)
index c43b259..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.pcep.parser.BaseParserExtensionActivator
index 235879a0c8adece80ffdf9043a82100221a3018c..db1479ab3c9381d992818921186fd46394599d9a 100644 (file)
             <groupId>${project.groupId}</groupId>
             <artifactId>util</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
     </dependencies>
 
     <scm>
@@ -56,4 +60,4 @@
         <url>https://wiki.opendaylight.org/display/ODL/BGPCEP</url>
         <tag>HEAD</tag>
     </scm>
-</project>
\ No newline at end of file
+</project>
index 0f0dd4715805f51e3a0cf203d08c341020571c05..c21b561d8936e3dfd14470415ef22845b6e4bfb2 100644 (file)
@@ -9,11 +9,14 @@ package org.opendaylight.protocol.pcep.p2mp.te.lsp;
 
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
 import org.opendaylight.protocol.pcep.spi.pojo.AbstractPCEPExtensionProviderActivator;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.p2mp.te.lsp.rev181109.p2mp.pce.capability.tlv.P2mpPceCapability;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = PCEPExtensionProviderActivator.class)
 public final class Activator extends AbstractPCEPExtensionProviderActivator {
     @Override
     protected List<Registration> startImpl(final PCEPExtensionProviderContext context) {
index 17b5e993474b5052fdf93dd99b9aaeb072b846c0..b7eb60c38593f1dd0e683a8c247f30dc2ffe3247 100644 (file)
@@ -7,25 +7,35 @@
  */
 package org.opendaylight.protocol.pcep.p2mp.te.lsp;
 
+import com.google.common.base.MoreObjects;
 import java.net.InetSocketAddress;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.pcep.PCEPCapability;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.p2mp.te.lsp.rev181109.TlvsP2mpCapabilityAug;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.p2mp.te.lsp.rev181109.TlvsP2mpCapabilityAugBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.p2mp.te.lsp.rev181109.p2mp.pce.capability.tlv.P2mpPceCapabilityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder;
 
+@MetaInfServices
 public final class P2MPTeLspCapability implements PCEPCapability {
     private static final TlvsP2mpCapabilityAug PATH_COMPUTATION_CAP_AUG = new TlvsP2mpCapabilityAugBuilder()
-        .setP2mpPceCapability(new P2mpPceCapabilityBuilder().build()).build();
+        .setP2mpPceCapability(new P2mpPceCapabilityBuilder().build())
+        .build();
+
     private final boolean supportsPathComputation;
 
+    public P2MPTeLspCapability() {
+        this(true);
+    }
+
+    // FIXME: this should return distinct implementations
     public P2MPTeLspCapability(final boolean supportsP2MPTeLspPathComputation) {
         this.supportsPathComputation = supportsP2MPTeLspPathComputation;
     }
 
     @Override
     public void setCapabilityProposal(final InetSocketAddress address, final TlvsBuilder builder) {
-        if (this.supportsPathComputation) {
+        if (supportsPathComputation) {
             builder.addAugmentation(PATH_COMPUTATION_CAP_AUG);
         }
     }
@@ -34,4 +44,9 @@ public final class P2MPTeLspCapability implements PCEPCapability {
     public boolean isStateful() {
         return false;
     }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this).add("pathComputation", supportsPathComputation).toString();
+    }
 }
diff --git a/pcep/ietf-p2mp-te-lsp/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.PCEPCapability b/pcep/ietf-p2mp-te-lsp/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.PCEPCapability
deleted file mode 100644 (file)
index 1277963..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-#
-org.opendaylight.protocol.pcep.p2mp.te.lsp.P2MPTeLspCapability
\ No newline at end of file
diff --git a/pcep/ietf-p2mp-te-lsp/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator b/pcep/ietf-p2mp-te-lsp/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator
deleted file mode 100644 (file)
index 2c34e7b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-#
-org.opendaylight.protocol.pcep.p2mp.te.lsp.Activator
index bb06f797cb14669d86de2b1a710ffc2b4ff95986..909594f66942012d9c053c124d0fc3d4124f0692 100644 (file)
             <artifactId>concepts</artifactId>
         </dependency>
 
-        <!--
-             FIXME: these are IETF models which are pre-generated in SAL infra.
-                    This should not be here, but rather should somehow be
-                    discovered by the plugin.
-        -->
         <dependency>
             <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
             <artifactId>rfc6991-ietf-inet-types</artifactId>
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
 
         <!--test dependencies -->
         <dependency>
index e837368d0b4a141a87d6e1f356f02997ac8775e3..3381b41b72ed6ca05edc58957e1acc7136010e35 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.protocol.pcep.ietf.initiated;
 
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
@@ -19,6 +21,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.iet
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.stateful.capability.tlv.Stateful;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = PCEPExtensionProviderActivator.class)
 public final class InitiatedActivator extends AbstractPCEPExtensionProviderActivator {
     @Override
     protected List<Registration> startImpl(final PCEPExtensionProviderContext context) {
index e3da9125902056d686d72d032d725c113178d1df..bdb0a21906748b1aacf313ed2dceb7bc907ad57e 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.ietf.stateful;
 
 import java.net.InetSocketAddress;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.pcep.PCEPCapability;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.ietf.stateful.app.config.rev160707.PcepIetfStatefulConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.initiated.rev200720.Stateful1Builder;
@@ -15,22 +16,26 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.iet
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.stateful.capability.tlv.StatefulBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder;
 
-public class PCEPStatefulCapability implements PCEPCapability {
-
+@MetaInfServices
+public final class PCEPStatefulCapability implements PCEPCapability {
     private final boolean stateful;
     private final boolean active;
-    private final boolean instant;
+    private final boolean intiated;
     private final boolean triggeredSync;
     private final boolean triggeredResync;
     private final boolean deltaLspSync;
     private final boolean includeDbVersion;
 
-    public PCEPStatefulCapability(final boolean stateful, final boolean active, final boolean instant,
+    public PCEPStatefulCapability() {
+        this(true, true, true, true, true, true, true);
+    }
+
+    public PCEPStatefulCapability(final boolean stateful, final boolean active, final boolean initiated,
             final boolean triggeredSync, final boolean triggeredResync, final boolean deltaLspSync,
             final boolean includeDbVersion) {
         this.stateful = stateful || active || triggeredSync || triggeredResync || deltaLspSync || includeDbVersion;
         this.active = active;
-        this.instant = instant;
+        this.intiated = initiated;
         this.triggeredSync = triggeredSync;
         this.triggeredResync = triggeredResync;
         this.deltaLspSync = deltaLspSync;
@@ -44,16 +49,16 @@ public class PCEPStatefulCapability implements PCEPCapability {
 
     @Override
     public void setCapabilityProposal(final InetSocketAddress address, final TlvsBuilder builder) {
-        if (this.stateful) {
+        if (stateful) {
             builder.addAugmentation(new Tlvs1Builder()
-                    .setStateful(new StatefulBuilder().setLspUpdateCapability(this.active)
-                        .addAugmentation(new Stateful1Builder().setInitiation(this.instant).build())
+                    .setStateful(new StatefulBuilder().setLspUpdateCapability(active)
+                        .addAugmentation(new Stateful1Builder().setInitiation(intiated).build())
                         .addAugmentation(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller
                             .pcep.sync.optimizations.rev200720.Stateful1Builder()
-                                .setTriggeredInitialSync(this.triggeredSync)
-                                .setTriggeredResync(this.triggeredResync)
-                                .setDeltaLspSyncCapability(this.deltaLspSync)
-                                .setIncludeDbVersion(this.includeDbVersion)
+                                .setTriggeredInitialSync(triggeredSync)
+                                .setTriggeredResync(triggeredResync)
+                                .setDeltaLspSyncCapability(deltaLspSync)
+                                .setIncludeDbVersion(includeDbVersion)
                                 .build())
                         .build())
                     .build());
@@ -62,30 +67,30 @@ public class PCEPStatefulCapability implements PCEPCapability {
 
     @Override
     public boolean isStateful() {
-        return this.stateful;
+        return stateful;
     }
 
     public boolean isActive() {
-        return this.active;
+        return active;
     }
 
     public boolean isInstant() {
-        return this.instant;
+        return intiated;
     }
 
     public boolean isTriggeredSync() {
-        return this.triggeredSync;
+        return triggeredSync;
     }
 
     public boolean isTriggeredResync() {
-        return this.triggeredResync;
+        return triggeredResync;
     }
 
     public boolean isDeltaLspSync() {
-        return this.deltaLspSync;
+        return deltaLspSync;
     }
 
     public boolean isIncludeDbVersion() {
-        return this.includeDbVersion;
+        return includeDbVersion;
     }
 }
index 97601fe6922b53d83ec636336844793928110a00..b53cff4f4f1dadfac559fbee2cf4575254d7f802 100644 (file)
@@ -9,7 +9,9 @@ package org.opendaylight.protocol.pcep.ietf.stateful;
 
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
@@ -28,6 +30,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.mes
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = PCEPExtensionProviderActivator.class)
 public final class StatefulActivator extends AbstractPCEPExtensionProviderActivator {
     @Override
     protected List<Registration> startImpl(final PCEPExtensionProviderContext context) {
index d9701ac77c3592e46b98cda65f1cb75cb3995bc3..793ecc72adbe0fe904c9fd18eb03e029a236bc0c 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.protocol.pcep.sync.optimizations;
 
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
@@ -20,8 +22,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.iet
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = PCEPExtensionProviderActivator.class)
 public class SyncOptimizationsActivator extends AbstractPCEPExtensionProviderActivator {
-
     @Override
     protected List<Registration> startImpl(final PCEPExtensionProviderContext context) {
         final List<Registration> regs = new ArrayList<>();
diff --git a/pcep/ietf-stateful/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.PCEPCapability b/pcep/ietf-stateful/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.PCEPCapability
deleted file mode 100644 (file)
index 32c1e40..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability
\ No newline at end of file
diff --git a/pcep/ietf-stateful/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator b/pcep/ietf-stateful/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator
deleted file mode 100644 (file)
index 9ac0d7b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-#
-org.opendaylight.protocol.pcep.ietf.stateful.StatefulActivator
-org.opendaylight.protocol.pcep.ietf.initiated.InitiatedActivator
-org.opendaylight.protocol.pcep.sync.optimizations.SyncOptimizationsActivator
index b7b1aa335143da4d3573a93661803d0c1e07f362..c9e647a9445729ea328d7d28faf1a5fff95e558e 100644 (file)
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
 
         <!--test dependencies -->
         <dependency>
index a749a51d949076f407f7b8dfc56f9fbd8b41ac9e..5fc7351f2e03450bdc1203c6f6ca2e263faaa99d 100644 (file)
@@ -7,37 +7,55 @@
  */
 package org.opendaylight.protocol.pcep.segment.routing;
 
+import com.google.common.base.MoreObjects;
 import java.net.InetSocketAddress;
+import org.eclipse.jdt.annotation.NonNull;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.pcep.PCEPCapability;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.Tlvs1;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.Tlvs1Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.pce.capability.tlv.SrPceCapabilityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder;
 import org.opendaylight.yangtools.yang.common.Uint8;
 
+@MetaInfServices
 public class PCEPSegmentRoutingCapability implements PCEPCapability {
+    private static final @NonNull Tlvs1 AUGMENTATION = new Tlvs1Builder()
+        .setSrPceCapability(new SrPceCapabilityBuilder()
+            .setNFlag(Boolean.FALSE)
+            .setXFlag(Boolean.FALSE)
+            .setMsd(Uint8.ZERO)
+            .build())
+        .build();
 
     private final boolean isSegmentRoutingCapable;
 
+    public PCEPSegmentRoutingCapability() {
+        this(true);
+    }
+
     public PCEPSegmentRoutingCapability(final boolean isSegmentRoutingCapable) {
         this.isSegmentRoutingCapable = isSegmentRoutingCapable;
     }
 
     @Override
     public void setCapabilityProposal(final InetSocketAddress address, final TlvsBuilder builder) {
-        if (this.isSegmentRoutingCapable) {
-            builder.addAugmentation(new Tlvs1Builder()
-                .setSrPceCapability(new SrPceCapabilityBuilder().setNFlag(Boolean.FALSE).setXFlag(Boolean.FALSE)
-                    .setMsd(Uint8.ZERO).build())
-                .build());
+        if (isSegmentRoutingCapable) {
+            builder.addAugmentation(AUGMENTATION);
         }
     }
 
     public boolean isSegmentRoutingCapable() {
-        return this.isSegmentRoutingCapable;
+        return isSegmentRoutingCapable;
     }
 
     @Override
     public boolean isStateful() {
         return false;
     }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this).add("srCapable", isSegmentRoutingCapable).toString();
+    }
 }
index 528472f1e25d528c64d3460e9104293350f2b79a..65ae9ef1346727f5c94c761ca8d5104ac7830247 100644 (file)
@@ -7,8 +7,11 @@
  */
 package org.opendaylight.protocol.pcep.segment.routing;
 
+import com.google.common.base.MoreObjects;
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
@@ -20,13 +23,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.path.setup.type.tlv.PathSetupType;
 import org.opendaylight.yangtools.concepts.Registration;
 
+@MetaInfServices(value = PCEPExtensionProviderActivator.class)
 public class SegmentRoutingActivator extends AbstractPCEPExtensionProviderActivator {
-
     @Deprecated
     private final boolean ianaSrSubobjectsType;
 
     public SegmentRoutingActivator() {
-        this.ianaSrSubobjectsType = true;
+        ianaSrSubobjectsType = true;
     }
 
     @Deprecated
@@ -46,7 +49,7 @@ public class SegmentRoutingActivator extends AbstractPCEPExtensionProviderActiva
         regs.add(context.registerTlvSerializer(SrPceCapability.class, new SrPceCapabilityTlvParser()));
 
         /* Subobjects */
-        final SrEroSubobjectParser srEroSubobjectParser = new SrEroSubobjectParser(this.ianaSrSubobjectsType);
+        final SrEroSubobjectParser srEroSubobjectParser = new SrEroSubobjectParser(ianaSrSubobjectsType);
         regs.add(context.registerEROSubobjectParser(srEroSubobjectParser.getCodePoint(), srEroSubobjectParser));
         regs.add(context.registerEROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
             .pcep.segment.routing.rev200720.network.topology.topology.node.path.computation.client.reported.lsp.path.ero
@@ -68,7 +71,7 @@ public class SegmentRoutingActivator extends AbstractPCEPExtensionProviderActiva
             srEroSubobjectParser));
         regs.add(context.registerEROSubobjectSerializer(SrEroType.class, srEroSubobjectParser));
 
-        final SrRroSubobjectParser srRroSubobjectParser = new SrRroSubobjectParser(this.ianaSrSubobjectsType);
+        final SrRroSubobjectParser srRroSubobjectParser = new SrRroSubobjectParser(ianaSrSubobjectsType);
         regs.add(context.registerRROSubobjectParser(srRroSubobjectParser.getCodePoint(), srRroSubobjectParser));
         regs.add(context.registerRROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
             .pcep.segment.routing.rev200720.network.topology.topology.node.path.computation.client.reported.lsp.path.rro
@@ -108,4 +111,9 @@ public class SegmentRoutingActivator extends AbstractPCEPExtensionProviderActiva
 
         return regs;
     }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this).add("ianaSubobjects", ianaSrSubobjectsType).toString();
+    }
 }
diff --git a/pcep/segment-routing/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.PCEPCapability b/pcep/segment-routing/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.PCEPCapability
deleted file mode 100644 (file)
index 704e25a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.pcep.segment.routing.PCEPSegmentRoutingCapability
\ No newline at end of file
diff --git a/pcep/segment-routing/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator b/pcep/segment-routing/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator
deleted file mode 100644 (file)
index 18d98b1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.pcep.segment.routing.SegmentRoutingActivator
index 745acccc8004c5d1cf06df39417f36cdb6d8dedb..95cb0974345855387ebd75f61506c925f3429a03 100644 (file)
             <groupId>io.netty</groupId>
             <artifactId>netty-buffer</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.kohsuke.metainf-services</groupId>
+            <artifactId>metainf-services</artifactId>
+        </dependency>
+
         <!-- Test dependencies -->
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
index 916c0a9a722f43d56838a517414c8ed74add2256..ba212bdb4d905ab2e830a242d53dc8e0387bdcaf 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.protocol.rsvp.parser.impl;
 
 import java.util.ArrayList;
 import java.util.List;
+import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.rsvp.parser.impl.subobject.ero.EROAsNumberSubobjectParser;
 import org.opendaylight.protocol.rsvp.parser.impl.subobject.ero.EROIpv4PrefixSubobjectParser;
 import org.opendaylight.protocol.rsvp.parser.impl.subobject.ero.EROIpv6PrefixSubobjectParser;
@@ -62,6 +63,7 @@ import org.opendaylight.protocol.rsvp.parser.impl.te.SessionAttributeLspObjectPa
 import org.opendaylight.protocol.rsvp.parser.impl.te.SessionAttributeLspRaObjectParser;
 import org.opendaylight.protocol.rsvp.parser.spi.AbstractRSVPExtensionProviderActivator;
 import org.opendaylight.protocol.rsvp.parser.spi.LabelRegistry;
+import org.opendaylight.protocol.rsvp.parser.spi.RSVPExtensionProviderActivator;
 import org.opendaylight.protocol.rsvp.parser.spi.RSVPExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.admin.status.object.AdminStatusObject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.association.object.AssociationObject;
@@ -99,7 +101,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.tspec.object.TspecObject;
 import org.opendaylight.yangtools.concepts.Registration;
 
-public class RSVPActivator extends AbstractRSVPExtensionProviderActivator {
+@MetaInfServices(value = RSVPExtensionProviderActivator.class)
+public final class RSVPActivator extends AbstractRSVPExtensionProviderActivator {
+
     @Override
     protected List<Registration> startImpl(final RSVPExtensionProviderContext context) {
         final List<Registration> regs = new ArrayList<>();
diff --git a/rsvp/impl/src/main/resources/META-INF/services/org.opendaylight.protocol.rsvp.parser.spi.RSVPExtensionProviderActivator b/rsvp/impl/src/main/resources/META-INF/services/org.opendaylight.protocol.rsvp.parser.spi.RSVPExtensionProviderActivator
deleted file mode 100644 (file)
index ef51a21..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
-# 
-# This program and the accompanying materials are made available
-# under the terms of the Eclipse Public License v1.0 which 
-# accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-org.opendaylight.protocol.rsvp.parser.impl.RSVPActivator