Search in sources :

Example 6 with JmxEnabled

use of org.apache.catalina.JmxEnabled in project tomcat by apache.

the class StandardHost method getValveNames.

// -------------------- JMX  --------------------
/**
      * @return the MBean Names of the Valves associated with this Host
      *
      * @exception Exception if an MBean cannot be created or registered
      */
public String[] getValveNames() throws Exception {
    Valve[] valves = this.getPipeline().getValves();
    String[] mbeanNames = new String[valves.length];
    for (int i = 0; i < valves.length; i++) {
        if (valves[i] instanceof JmxEnabled) {
            ObjectName oname = ((JmxEnabled) valves[i]).getObjectName();
            if (oname != null) {
                mbeanNames[i] = oname.toString();
            }
        }
    }
    return mbeanNames;
}
Also used : Valve(org.apache.catalina.Valve) JmxEnabled(org.apache.catalina.JmxEnabled) ObjectName(javax.management.ObjectName)

Example 7 with JmxEnabled

use of org.apache.catalina.JmxEnabled in project tomcat by apache.

the class StandardPipeline method getValveObjectNames.

public ObjectName[] getValveObjectNames() {
    ArrayList<ObjectName> valveList = new ArrayList<>();
    Valve current = first;
    if (current == null) {
        current = basic;
    }
    while (current != null) {
        if (current instanceof JmxEnabled) {
            valveList.add(((JmxEnabled) current).getObjectName());
        }
        current = current.getNext();
    }
    return valveList.toArray(new ObjectName[0]);
}
Also used : ArrayList(java.util.ArrayList) Valve(org.apache.catalina.Valve) ObjectName(javax.management.ObjectName) JmxEnabled(org.apache.catalina.JmxEnabled)

Example 8 with JmxEnabled

use of org.apache.catalina.JmxEnabled in project tomcat by apache.

the class StandardService method initInternal.

/**
     * Invoke a pre-startup initialization. This is used to allow connectors
     * to bind to restricted ports under Unix operating environments.
     */
@Override
protected void initInternal() throws LifecycleException {
    super.initInternal();
    if (engine != null) {
        engine.init();
    }
    // Initialize any Executors
    for (Executor executor : findExecutors()) {
        if (executor instanceof JmxEnabled) {
            ((JmxEnabled) executor).setDomain(getDomain());
        }
        executor.init();
    }
    // Initialize mapper listener
    mapperListener.init();
    // Initialize our defined Connectors
    synchronized (connectorsLock) {
        for (Connector connector : connectors) {
            connector.init();
        }
    }
}
Also used : Connector(org.apache.catalina.connector.Connector) Executor(org.apache.catalina.Executor) JmxEnabled(org.apache.catalina.JmxEnabled)

Aggregations

JmxEnabled (org.apache.catalina.JmxEnabled)8 ObjectName (javax.management.ObjectName)6 Valve (org.apache.catalina.Valve)6 Container (org.apache.catalina.Container)5 ArrayList (java.util.ArrayList)1 MBeanException (javax.management.MBeanException)1 MalformedObjectNameException (javax.management.MalformedObjectNameException)1 Executor (org.apache.catalina.Executor)1 Connector (org.apache.catalina.connector.Connector)1