1 package com.jcorporate.expresso.core.registry; 2 3 23 public class ExpressoThread 24 extends Thread { 25 28 private final ExpressoThreadContext context; 29 30 33 public ExpressoThread() { 34 super(); 35 context = new ExpressoThreadContext(); 36 } 37 38 44 protected ExpressoThreadContext getThreadContext() { 45 return context; 46 } 47 48 54 public ExpressoThread(Runnable target) { 55 super(target); 56 context = new ExpressoThreadContext(); 57 } 58 59 65 public ExpressoThread(String name) { 66 super(name); 67 context = new ExpressoThreadContext(); 68 } 69 70 77 public ExpressoThread(ThreadGroup group, Runnable target) { 78 super(group, target); 79 context = new ExpressoThreadContext(); 80 } 81 82 89 public ExpressoThread(Runnable target, String name) { 90 super(target, name); 91 context = new ExpressoThreadContext(); 92 } 93 94 101 public ExpressoThread(ThreadGroup group, String name) { 102 super(group, name); 103 context = new ExpressoThreadContext(); 104 } 105 106 114 public ExpressoThread(ThreadGroup group, Runnable target, String name) { 115 super(group, target, name); 116 context = new ExpressoThreadContext(); 117 } 118 119 128 public ExpressoThread(ThreadGroup group, Runnable target, String name, 129 long stackSize) { 130 super(group, target, name, stackSize); 131 context = new ExpressoThreadContext(); 132 } 133 134 137 public void run() { 138 getThreadContext().applyToCurrentThread(); 139 super.run(); 140 } 141 } 142 | Popular Tags |