com.quartzdesk.api.agent.log
Class LoggingInterceptorWrapper

java.lang.Object
  extended by com.quartzdesk.api.agent.log.LoggingInterceptorWrapper

public class LoggingInterceptorWrapper
extends Object

This wrapper uses Java reflection to look up and invoke the QuartzDesk JVM Agent logging interceptor (com.quartzdesk.agent.api.scheduler.common.log.IExecutingJobLoggingInterceptor).

By using this wrapper, initialization of various QuartzDesk API log interception handlers / appenders no longer fails with ClassNotFoundException when the QuartzDesk JVM Agent is not installed and available on the handler / appender classpath.

Please note that this class has no compile-time dependency on the QuartzDesk Agent API, nor on the QuartzDesk Domain API. This is intentional and crucial for the proper function of this wrapper. Please note that there are no QuartzDesk Agent API imports apart from the core Java API ones.

Version:
$Id:$
Author:
Jan Moravec

Nested Class Summary
static class LoggingInterceptorWrapper.MessagePriority
          Log message priorities.
 
Field Summary
static LoggingInterceptorWrapper.MessagePriority DEFAULT_MESSAGE_PRIORITY
          Default log message priority used if the logging framework specific logging level / priority cannot be mapped.
 
Method Summary
static LoggingInterceptorWrapper create()
          Creates and returns a new instance of the LoggingInterceptorWrapper.
 void intercept(Thread thread, LoggingInterceptorWrapper.MessagePriority priority, String message)
          Invokes the com.quartzdesk.agent.api.scheduler.common.log.IExecutingJobLoggingInterceptor#intercept(Thread, com.quartzdesk.agent.api.domain.model.log.LoggingEvent) method on the wrapped QuartzDesk JVM Agent logging interceptor.
 boolean isIntercepting(Thread jobThread)
          Invokes the com.quartzdesk.agent.api.scheduler.common.log.IExecutingJobLoggingInterceptor#isIntercepting(Thread) method on the wrapped QuartzDesk JVM Agent logging interceptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MESSAGE_PRIORITY

public static final LoggingInterceptorWrapper.MessagePriority DEFAULT_MESSAGE_PRIORITY
Default log message priority used if the logging framework specific logging level / priority cannot be mapped.

Method Detail

create

public static LoggingInterceptorWrapper create()
                                        throws LoggingInterceptorWrapperException
Creates and returns a new instance of the LoggingInterceptorWrapper.

Returns:
the created LoggingInterceptorWrapper instance.
Throws:
LoggingInterceptorWrapperException

isIntercepting

public boolean isIntercepting(Thread jobThread)
Invokes the com.quartzdesk.agent.api.scheduler.common.log.IExecutingJobLoggingInterceptor#isIntercepting(Thread) method on the wrapped QuartzDesk JVM Agent logging interceptor.

Parameters:
jobThread - a job thread.
Returns:
the result.
See Also:
IExecutingJobLoggingInterceptor.isIntercepting(Thread)

intercept

public void intercept(Thread thread,
                      LoggingInterceptorWrapper.MessagePriority priority,
                      String message)
Invokes the com.quartzdesk.agent.api.scheduler.common.log.IExecutingJobLoggingInterceptor#intercept(Thread, com.quartzdesk.agent.api.domain.model.log.LoggingEvent) method on the wrapped QuartzDesk JVM Agent logging interceptor.

Parameters:
thread - a job thread or one of its worker (children) threads registered with the WorkerThreadLoggingInterceptorRegistry.
priority - a log message priority.
message - a log message.
See Also:
IExecutingJobLoggingInterceptor.intercept(Thread, com.quartzdesk.agent.api.domain.model.log.LoggingEvent)


Copyright © 2013–2017 QuartzDesk.com. All rights reserved.