...
Framework
The agent uses the PICO Container PicoContainer to handle class instantiation. The container is following the principle of Dependency Injection and Inversion of Control.
...
The classes are loaded at that moment, when there are needed for the first time. Not earlier.
Static classes and that containing static methods are instantiated on application startup and are not effected by this the upper rule.
When a class is needed, the class loader loads the class and then it's linked.
...
Three points of interest are essential on threads:
- Which thread created a the current thread
- Which one starts it
- Which thread executes it
...
Its important to keep the principle of thread pools in mind. Its commonly used by web applications.
It allows the reuse of threads, which means there is no need to create new thread instances. This reduces overhead, since the system don't have to manage new threads(no new memory allocation etc.). .
Runnables
Runnables can be also reused.
But a thread cannot switch the Runnable during execution.