| java.lang.Object java.lang.Thread com.jcorporate.expresso.core.registry.ExpressoThread
All known Subclasses: com.jcorporate.expresso.ext.tests.StressThread, com.jcorporate.expresso.core.job.Job, com.jcorporate.expresso.ext.controller.RunTestThread, com.jcorporate.expresso.core.misc.EventHandler, com.jcorporate.expresso.core.logging.LogHandler, com.jcorporate.expresso.core.cache.CacheTestThread, com.jcorporate.expresso.core.registry.ExpressoThreadTestModel, com.jcorporate.expresso.core.cache.CacheCleaner, com.jcorporate.expresso.services.asyncprocess.ProcessThread, com.jcorporate.expresso.core.utility.JobHandler,
ExpressoThread | public class ExpressoThread extends Thread (Code) | | Provides a thread with an Expresso Thread Context already set for you.
If your architecture allows you to do it, then deriving from
ExpressoThread instead of Thread allows you to have
a predefined environment with a build RequestRegistry.
You create an ExpressoThread which takes a snapshot of the credentials
of the thread in which it was created. Then when it runs() the
original credentials are applied to the new thread.
Note: To get the benefits of this class, you must call
super.run() inside your own run method before proceeding.
If you are using a Runnable interface, you may use the code:
ExpressoThread et = new ExpressoThread(myRunnableInstance);
et.start();
which will get the RequestRegistry set before the runnable instance begins.
author: Michael Rimov |
ExpressoThread | public ExpressoThread()(Code) | | Default constructor.
|
getThreadContext | protected ExpressoThreadContext getThreadContext()(Code) | | Protected getter to allow for future extension.
ExpressoThreadContext the thread context created inthe constructor. |
run | public void run()(Code) | | Call super.run() from your own threads running inside Expresso to
|
|
|