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

com.genexus.management.HTTPConnectionJMX Maven / Gradle / Ivy

Go to download

Core classes for the runtime used by Java and Android apps generated with GeneXus

There is a newer version: 4.7.3
Show newest version
package com.genexus.management;

import org.apache.http.conn.routing.HttpRoute;
import org.apache.logging.log4j.Logger;

public class HTTPConnectionJMX implements HTTPConnectionJMXBean{

	private static Logger log = org.apache.logging.log4j.LogManager.getLogger(HTTPConnectionJMX.class);

	HttpRoute httpRoute;

	public HTTPConnectionJMX(HttpRoute httpRoute) {
		this.httpRoute = httpRoute;
	}

	static public void CreateHTTPConnectionJMX(HttpRoute connection) {
		try {
			MBeanUtils.createMBean(connection);
		}
		catch (Exception e) {
			log.error("Failed to register HTTP connection MBean.", e);
		}
	}

	static public void DestroyHTTPConnectionJMX(HttpRoute connection) {
		try {
			MBeanUtils.destroyMBean(connection);
		}
		catch (Exception e) {
			log.error("Failed to destroy HTTP connection MBean.", e);
		}
	}

	public int getPort() {
		return httpRoute.getTargetHost().getPort();
	}

	public String getHost() {
		return httpRoute.getTargetHost().getHostName();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy