X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pcep%2Fimpl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fpcep%2Fimpl%2FPCEPDispatcherImpl.java;h=686c0d86ba84b66d74b15eedb61819d9ee96b1af;hb=5540d8ee115e70cd37af3437503b8166f3efbb9c;hp=1fda6fe572328698e938e258c52a52ebb7f54195;hpb=57a3b9fcef67c74a775cc4e3836adc70ebc0387e;p=bgpcep.git diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPDispatcherImpl.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPDispatcherImpl.java index 1fda6fe572..686c0d86ba 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPDispatcherImpl.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPDispatcherImpl.java @@ -7,39 +7,41 @@ */ package org.opendaylight.protocol.pcep.impl; +import com.google.common.base.Preconditions; import io.netty.channel.ChannelFuture; +import io.netty.channel.EventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.util.concurrent.Promise; - -import java.io.IOException; -import java.net.InetSocketAddress; - import org.opendaylight.protocol.framework.AbstractDispatcher; import org.opendaylight.protocol.framework.SessionListenerFactory; import org.opendaylight.protocol.framework.SessionNegotiatorFactory; import org.opendaylight.protocol.pcep.PCEPDispatcher; import org.opendaylight.protocol.pcep.PCEPSessionListener; +import org.opendaylight.protocol.pcep.spi.MessageHandlerRegistry; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message; -import com.google.common.base.Preconditions; +import java.io.IOException; +import java.net.InetSocketAddress; /** * Implementation of PCEPDispatcher. */ -public class PCEPDispatcherImpl extends AbstractDispatcher implements PCEPDispatcher { +public class PCEPDispatcherImpl extends AbstractDispatcher implements PCEPDispatcher, AutoCloseable { private final SessionNegotiatorFactory snf; - - private final PCEPHandlerFactory hf = new PCEPHandlerFactory(); + private final PCEPHandlerFactory hf; /** * Creates an instance of PCEPDispatcherImpl, gets the default selector and opens it. - * + * * @throws IOException if some error occurred during opening the selector */ - public PCEPDispatcherImpl(final SessionNegotiatorFactory negotiatorFactory) { - super(); + public PCEPDispatcherImpl(final MessageHandlerRegistry registry, + final SessionNegotiatorFactory negotiatorFactory, + EventLoopGroup bossGroup, EventLoopGroup workerGroup) { + super(bossGroup, workerGroup); this.snf = Preconditions.checkNotNull(negotiatorFactory); + this.hf = new PCEPHandlerFactory(registry); } @Override @@ -53,4 +55,8 @@ public class PCEPDispatcherImpl extends AbstractDispatcher