public LogConnector() { this(Tracee.getBackend().getLoggerFactory().getLogger(LogConnector.class)); }
public static SimpleTraceeBackend createNonLoggingAllPermittingBackend() { return new SimpleTraceeBackend(new PermitAllTraceeFilterConfiguration(), new NoopTraceeLoggerFactory()); }
@SuppressWarnings("unused") public TraceeSessionListener() { this(Tracee.getBackend()); }
public TraceeServletRequestListener() { this(Tracee.getBackend(), new HttpJsonHeaderTransport(Tracee.getBackend().getLoggerFactory())); }
/** * Returns the TraceeBackend. There must be exactly one Tracee implementation on the classpath. * <p/> * A call to this method may initially block to lookup the implementation with a {@link java.util.ServiceLoader}. * The call to this method from multiple threads with different class loader contexts may initially be slow * because cache writes can overwrite each other in concurrent situations and some class loader contexts may have * to be looked up multiple times. This allows the lookup mechanism to completely avoid synchronization. * <p/> * TODO: If you run a nested class loader environment (like a servlet container) and have the Tracee Api in a top * level class loader and a Tracee Implementation in a child class loader, the child class loader may not be unloaded * until a low memory situation occurs (since the SoftReference keeps the TraceeBackendProvider in memory). * It could be a solution to change the SoftReference to WeakReference but let a TraceeBackend keep a strong * reference to its TraceeBackendProvider. */ public static TraceeBackend getBackend() { return getBackend(new BackendProviderResolver()); }
public HttpJsonHeaderTransport(TraceeLoggerFactory traceeLoggerFactory) { logger = traceeLoggerFactory.getLogger(HttpJsonHeaderTransport.class); }
@Override public final void sendErrorReport(String json) { logger.error(json); } }
@Override public void requestDestroyed(ServletRequestEvent sre) { backend.clear(); }
private String anonymizedSessionKey(String sessionKey, int length) { return Utilities.createAlphanumericHash(sessionKey, length); } }
@Override public final void sessionDestroyed(HttpSessionEvent httpSessionEvent) { backend.remove(TraceeConstants.SESSION_ID_KEY); }
public static ClassLoader fromContext() { return doPrivileged(new GetClassLoader(null)); }
@Override public String setValue(String value) { return MDCLikeTraceeBackend.this.put(key, value); } }
@Override public String getValue() { return MDCLikeTraceeBackend.this.get(key); }
protected ThreadLocalRandom initialValue() { return new ThreadLocalRandom(); } };
public static <T> EmptyEnumeration<T> emptyEnumeration() { return new EmptyEnumeration<T>(); }
public TraceeFilter() { this(Tracee.getBackend(), new HttpJsonHeaderTransport(Tracee.getBackend().getLoggerFactory())); }
@Override public final void init(FilterConfig filterConfig) throws ServletException { traceeBackend = Tracee.getBackend(); }
private String anonymizedSessionKey(String sessionKey, int length) { return Utilities.createAlphanumericHash(sessionKey, length); }
public TraceeClientHandler() { this(Tracee.getBackend()); }
public TraceeContextProvider() { this.traceeBackend = Tracee.getBackend(); }