Questions tagged [managedthreadfactory]
10 questions
292
votes
20 answers
Naming threads and thread-pools of ExecutorService
Let's say I have an application that utilizes the Executor framework as such
Executors.newSingleThreadExecutor().submit(new Runnable(){
@Override
public void run(){
// do stuff
}
}
When I run this application in the debugger, a…

mre
- 43,520
- 33
- 120
- 170
4
votes
1 answer
How to create ManagedThreadFactory instance inside Glassfish V4.0
I am calling rabbitMQ client (and not server) from inside my Java code running in Glassfish V4.0 (build 89) container to connect to rabbitmq server on another machine. As per rabbitmq client document, we should supply a ManagedThreadFactory instance…

rjha94
- 4,292
- 3
- 30
- 37
3
votes
1 answer
Shutdown or Not Shutdown? in ExecutorService (Java8)
I am trying to understand the behaviour of the executor service relative to shutdown. The documentation says that the application won't terminate unless there is a shutdown() call - but in this simple example. It exits after one minute precisely.…

EKK
- 171
- 2
- 12
2
votes
2 answers
How can I manage multiple threads in Ruby on Rails (equivalent of a Java thread factory)?
I'm using Ruby on Rails 5 although I'm fairly a novice to Ruby/Rails. I have read about creating threads using
t = Thread.new {
sleep(rand(0)/10.0)
Thread.current["mycount"] = count
count += 1
}
However, I'm wondering if…
user7055375
2
votes
1 answer
"Traditional" threads cannot lookup JNDI names in WildFly
I'm migrating an old application (uses no beans or dependency injection) from Weblogic to WildFly. For the most part, it now works fine. However, it also creates threads in "traditional way" (new Thread()), and these threads cannot lookup JNDI…
user319799
1
vote
1 answer
java Guava ThreadFactoryBuilder why we need the count as AtomicLong
private static ThreadFactory doBuild(ThreadFactoryBuilder builder) {
final String nameFormat = builder.nameFormat;
final Boolean daemon = builder.daemon;
final Integer priority = builder.priority;
final UncaughtExceptionHandler…

Boyu Zhang
- 219
- 2
- 12
1
vote
1 answer
Implement custom naming for ExecutorService ScheduledExecutorService based on instance type of runnable input to ThreadFactory
I have a ExecutorService and ScheduledExecutorService for which I am using custom ThreadFactory so that I can name every thread as per type of runnable input to Thread factory for thread creation, but the input runnable to ThreadFactory is of type…

krishna T
- 425
- 4
- 14
0
votes
3 answers
How do I wait for my thread factory to finish executing all its tasks?
I'm using Spring 4.3.8.RELEASE with Java 7. I want to create a thread factory to help manage certain workers in my application. I declare my thread factory like so

Dave
- 15,639
- 133
- 442
- 830
0
votes
1 answer
How to build a recursive tree in Java-ee?
Here is my pseudo-code:
class Builder implements Callable {
T obj;
ManagedExecutorService pool;
Builder (T obj, ManagedExecutorService pool){
this.obj = obj;
this.pool = pool;
}
T call(){
build();
}
private void…

donlys
- 440
- 6
- 13
0
votes
2 answers
What happens if my Java ThreadPoolTaskExecutor gets called more than the "maxPoolSize" setting?
I’m using Java 6 with Spring 3.2.11.RELEASE and JBoss 7.1.3.Final. I have this in my Spring application context file
user6447029