Search in sources :

Example 1 with PCEPExtensionProviderContext

use of org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext in project bgpcep by opendaylight.

the class ServiceLoaderPCEPExtensionProviderContext method create.

public static PCEPExtensionProviderContext create() {
    final PCEPExtensionProviderContext ctx = new SimplePCEPExtensionProviderContext();
    final ServiceLoader<PCEPExtensionProviderActivator> loader = ServiceLoader.load(PCEPExtensionProviderActivator.class);
    for (final PCEPExtensionProviderActivator a : loader) {
        a.start(ctx);
    }
    return ctx;
}
Also used : PCEPExtensionProviderContext(org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext) PCEPExtensionProviderActivator(org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator)

Example 2 with PCEPExtensionProviderContext

use of org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext in project bgpcep by opendaylight.

the class PCCsBuilder method startActivators.

private static void startActivators() {
    final PCCActivator pccActivator = new PCCActivator();
    final StatefulActivator stateful = new StatefulActivator();
    final SyncOptimizationsActivator optimizationsActivator = new SyncOptimizationsActivator();
    final CrabbeInitiatedActivator activator = new CrabbeInitiatedActivator();
    final PCEPExtensionProviderContext ctx = ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance();
    pccActivator.start(ctx);
    stateful.start(ctx);
    optimizationsActivator.start(ctx);
    activator.start(ctx);
}
Also used : StatefulActivator(org.opendaylight.protocol.pcep.ietf.stateful07.StatefulActivator) ServiceLoaderPCEPExtensionProviderContext(org.opendaylight.protocol.pcep.spi.pojo.ServiceLoaderPCEPExtensionProviderContext) PCEPExtensionProviderContext(org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext) SyncOptimizationsActivator(org.opendaylight.protocol.pcep.sync.optimizations.SyncOptimizationsActivator) CrabbeInitiatedActivator(org.opendaylight.protocol.pcep.ietf.initiated00.CrabbeInitiatedActivator)

Example 3 with PCEPExtensionProviderContext

use of org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext in project bgpcep by opendaylight.

the class ActivatorTest method testStartImplPCEPExtensionProviderContext.

@Test
public void testStartImplPCEPExtensionProviderContext() throws PCEPDeserializerException {
    final Activator activator = new Activator(1);
    final PCEPExtensionProviderContext ctx = ServiceLoaderPCEPExtensionProviderContext.create();
    final List<AutoCloseable> registrations = activator.startImpl(ctx);
    Assert.assertEquals(4, registrations.size());
    activator.close();
}
Also used : PCEPExtensionProviderContext(org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext) ServiceLoaderPCEPExtensionProviderContext(org.opendaylight.protocol.pcep.spi.pojo.ServiceLoaderPCEPExtensionProviderContext) Test(org.junit.Test)

Aggregations

PCEPExtensionProviderContext (org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext)3 ServiceLoaderPCEPExtensionProviderContext (org.opendaylight.protocol.pcep.spi.pojo.ServiceLoaderPCEPExtensionProviderContext)2 Test (org.junit.Test)1 CrabbeInitiatedActivator (org.opendaylight.protocol.pcep.ietf.initiated00.CrabbeInitiatedActivator)1 StatefulActivator (org.opendaylight.protocol.pcep.ietf.stateful07.StatefulActivator)1 PCEPExtensionProviderActivator (org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator)1 SyncOptimizationsActivator (org.opendaylight.protocol.pcep.sync.optimizations.SyncOptimizationsActivator)1