Search in sources :

Example 21 with AMX

use of com.sun.appserv.management.base.AMX in project Payara by payara.

the class SystemPropertiesAccessTest method checkGetProperties.

public synchronized void checkGetProperties(final ObjectName src) throws Exception {
    final AMX proxy = getProxy(src, AMX.class);
    if (!(proxy instanceof SystemPropertiesAccess)) {
        throw new IllegalArgumentException("MBean does not implement SystemPropertiesAccess: " + quote(src));
    }
    final SystemPropertiesAccess props = (SystemPropertiesAccess) proxy;
    checkPropertiesGet(props);
}
Also used : SystemPropertiesAccess(com.sun.appserv.management.config.SystemPropertiesAccess) AMX(com.sun.appserv.management.base.AMX)

Example 22 with AMX

use of com.sun.appserv.management.base.AMX in project Payara by payara.

the class AMXTestBase method isRemoteIncomplete.

protected boolean isRemoteIncomplete(final ObjectName objectName) {
    final AMX amx = getProxyFactory().getProxy(objectName, AMX.class);
    final String j2eeType = amx.getJ2EEType();
    final boolean isRemote = !amx.isDAS();
    if (isRemote && !EXPECTED_REMOTE_INCOMPLETE_TYPES.contains(j2eeType)) {
        warning("isRemoteIncomplete: not expecting j2eeType=" + j2eeType + ", has the implementation changed?");
    }
    return isRemote;
}
Also used : AMX(com.sun.appserv.management.base.AMX)

Example 23 with AMX

use of com.sun.appserv.management.base.AMX in project Payara by payara.

the class CoverageInfoAnalyzer method getCoverageSummary.

public String getCoverageSummary() {
    final Set<AMX> amx = mTestUtil.getAllAMX();
    final Map<String, CoverageInfo> coverage = getCoverage(amx);
    final String[] j2eeTypes = GSetUtil.toStringArray(coverage.keySet());
    Arrays.sort(j2eeTypes);
    final String LINE_SEP = System.getProperty("line.separator");
    final StringBuilder builder = new StringBuilder();
    for (final String j2eeType : j2eeTypes) {
        final CoverageInfo info = coverage.get(j2eeType);
        final String infoString = "Coverage for j2eeType = " + j2eeType + ": " + (info.getFullCoverage() ? "100%" : "INCOMPLETE COVERAGE") + LINE_SEP + info.toString(false) + LINE_SEP + LINE_SEP;
        builder.append(infoString);
    }
    final String msg = "No AMX MBeans having the following types " + "were ever present, and so were NEVER TESTED:" + NEWLINE;
    builder.append(createMissingString(msg));
    return builder.toString();
}
Also used : AMX(com.sun.appserv.management.base.AMX) CoverageInfo(com.sun.appserv.management.ext.coverage.CoverageInfo)

Example 24 with AMX

use of com.sun.appserv.management.base.AMX in project Payara by payara.

the class TestUtil method getAllAMX.

/**
 *     @return all AMX, sorted by ObjectName
 */
public SortedSet<AMX> getAllAMX() {
    final SortedSet<ObjectName> all = getAllObjectNames();
    final SortedSet<AMX> allAMX = new TreeSet<AMX>(new AMXComparator<AMX>());
    final ProxyFactory proxyFactory = Util.getExtra(mDomainRoot).getProxyFactory();
    for (final ObjectName objectName : all) {
        try {
            final AMX amx = proxyFactory.getProxy(objectName, AMX.class);
            allAMX.add(amx);
        } catch (Exception e) {
            trace(ExceptionUtil.toString(e));
        }
    }
    return allAMX;
}
Also used : ProxyFactory(com.sun.appserv.management.client.ProxyFactory) TreeSet(java.util.TreeSet) AMX(com.sun.appserv.management.base.AMX) ObjectName(javax.management.ObjectName)

Example 25 with AMX

use of com.sun.appserv.management.base.AMX in project Payara by payara.

the class TestUtil method getAllAMX.

public <T> SortedSet<T> getAllAMX(final Class<T> theInterface) {
    final SortedSet<AMX> all = getAllAMX();
    final TreeSet<AMX> allOfInterface = new TreeSet<AMX>(new AMXComparator<AMX>());
    for (final AMX amx : all) {
        if (theInterface.isAssignableFrom(amx.getClass())) {
            allOfInterface.add(amx);
        }
    }
    return TypeCast.asSortedSet(allOfInterface);
}
Also used : TreeSet(java.util.TreeSet) AMX(com.sun.appserv.management.base.AMX)

Aggregations

AMX (com.sun.appserv.management.base.AMX)37 ObjectName (javax.management.ObjectName)10 Container (com.sun.appserv.management.base.Container)6 MBeanInfo (javax.management.MBeanInfo)6 HashSet (java.util.HashSet)5 AMXConfig (com.sun.appserv.management.config.AMXConfig)4 Method (java.lang.reflect.Method)3 Iterator (java.util.Iterator)3 Set (java.util.Set)3 MBeanOperationInfo (javax.management.MBeanOperationInfo)3 MBeanServerConnection (javax.management.MBeanServerConnection)3 AMXDebugStuff (org.glassfish.admin.amx.util.AMXDebugStuff)3 QueryMgr (com.sun.appserv.management.base.QueryMgr)2 ProxyFactory (com.sun.appserv.management.client.ProxyFactory)2 DomainConfig (com.sun.appserv.management.config.DomainConfig)2 CoverageInfo (com.sun.appserv.management.ext.coverage.CoverageInfo)2 Map (java.util.Map)2 TreeSet (java.util.TreeSet)2 MBeanAttributeInfo (javax.management.MBeanAttributeInfo)2 DomainRoot (com.sun.appserv.management.DomainRoot)1