O'Reilly logo

Java 7 Concurrency Cookbook by Javier Fernández González

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the ThreadFactory interface to generate custom threads

The factory pattern is a widely used design pattern in the object-oriented programming world. It is a creational pattern and its objective is to develop a class whose mission will be creating objects of one or several classes. Then, when we want to create an object of one of those classes, we use the factory instead of using the new operator.

  • With this factory, we centralize the creation of objects gaining an advantage of easily changing the class of objects created or the way we create these objects that are easily limiting the creation of objects for limited resources. For example, we can only have N objects of a type that is easily generating statistical data about the creation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required