| | |
| | | import org.opends.server.types.ErrorLogSeverity; |
| | | import org.opends.server.types.Operation; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import static org.opends.server.messages.CoreMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | public class TraditionalWorkerThread |
| | | extends DirectoryThread |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | |
| | | // Indicates whether the Directory Server is shutting down and this thread |
| | | // should stop running. |
| | | private boolean shutdownRequested; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugWarning( |
| | | TRACER.debugWarning( |
| | | "Uncaught exception in worker thread while processing " + |
| | | "operation %s: %s", String.valueOf(operation), e); |
| | | |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | try |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugWarning( |
| | | TRACER.debugWarning( |
| | | "Exception in worker thread while trying to log a " + |
| | | "message about an uncaught exception %s: %s", e, e2); |
| | | |
| | | debugCaught(DebugLogLevel.ERROR, e2); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e2); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e2); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e2); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | debugInfo(getName() + " exiting."); |
| | | TRACER.debugInfo(getName() + " exiting."); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugInfo(getName() + " being signaled to shut down."); |
| | | TRACER.debugInfo(getName() + " being signaled to shut down."); |
| | | } |
| | | |
| | | // Set a flag that indicates that the thread should stop running. |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugWarning( |
| | | TRACER.debugWarning( |
| | | "Caught an exception while trying to interrupt the worker " + |
| | | "thread waiting for work: %s", e); |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugWarning( |
| | | TRACER.debugWarning( |
| | | "Caught an exception while trying to abandon the " + |
| | | "operation in progress for the worker thread: %s", e); |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |