All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jamonapi.http.HttpMonNull Maven / Gradle / Ivy

There is a newer version: 2.82
Show newest version
package com.jamonapi.http;

import javax.servlet.ServletException;
import java.io.IOException;

/**
 * HttpMon that is used instead of HttpMonRequest when monitoring is disabled.
 * Essentially this class will be used as a singleton with noop methods.
 * 
 * @author steve souza
 *
 */
class HttpMonNull implements HttpMon {

    HttpMonNull() {
    }

    public HttpMon start() {
        return this;
    }

    public void stop() {
    }

    public String getDetailLabel() {
        return "";
    }

    public Throwable getException() {
        return null;
    }

    public void setException(Throwable t) {
    }

    public void throwException(Throwable t) throws IOException, ServletException {
        if (t instanceof ServletException)
            throw (ServletException)t;
        else if (t instanceof IOException)
            throw (IOException)t;
        else
            throw new ServletException(t);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy