X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fcodegen%2Fimpl%2FSingletonHolder.java;h=827644676665a1d1576abdbd2fe5caf2d8113a66;hp=cf754cc74e7c5b386c9b27209726d111f3ebb147;hb=66249d6ccc367fad055a269f561860d2d96af385;hpb=f02aa37017e8cf62375bd84e29b0a6df324891a4 diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/SingletonHolder.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/SingletonHolder.java index cf754cc74e..8276446766 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/SingletonHolder.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/SingletonHolder.java @@ -7,9 +7,6 @@ */ package org.opendaylight.controller.sal.binding.codegen.impl; -import com.google.common.util.concurrent.ListeningExecutorService; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.common.util.concurrent.ThreadFactoryBuilder; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -18,13 +15,19 @@ import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; + import javassist.ClassPool; + import org.apache.commons.lang3.StringUtils; import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeGenerator; import org.opendaylight.controller.sal.binding.spi.NotificationInvokerFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.common.util.concurrent.ListeningExecutorService; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.common.util.concurrent.ThreadFactoryBuilder; + public class SingletonHolder { private static final Logger logger = LoggerFactory.getLogger(SingletonHolder.class); @@ -69,6 +72,8 @@ public class SingletonHolder { // occurs in RejectedExecutionHandler. // This impl saturates threadpool first, then queue. When both are full caller will get blocked. BlockingQueue queue = new LinkedBlockingQueue(queueSize) { + private static final long serialVersionUID = 1L; + @Override public boolean offer(Runnable r) { // ThreadPoolExecutor will spawn a new thread after core size is reached only if the queue.offer returns false.