Search in sources :

Example 6 with AMXConfig

use of com.sun.appserv.management.config.AMXConfig in project Payara by payara.

the class AMXTest method checkImplementsAMXConfig.

/**
 *     Verify:
 *     <ul>
 *     <li>if the interface name ends in "Config" or "ConfigMgr", then is is an AMXConfig</li>
 *     </ul>
 */
public void checkImplementsAMXConfig(final ObjectName objectName) throws Exception {
    final AMX proxy = getProxyFactory().getProxy(objectName, AMX.class);
    final String interfaceName = Util.getExtra(proxy).getInterfaceName();
    if (interfaceName.endsWith("Config") || interfaceName.endsWith("ConfigMgr")) {
        if (!(proxy instanceof AMXConfig)) {
            trace("WARNING: " + ClassUtil.stripPackageName(interfaceName) + " does not implement AMXConfig");
        }
    }
}
Also used : AMX(com.sun.appserv.management.base.AMX) AMXConfig(com.sun.appserv.management.config.AMXConfig)

Example 7 with AMXConfig

use of com.sun.appserv.management.config.AMXConfig in project Payara by payara.

the class ConfigMgrTestBase method testCreateRemove.

public final synchronized void testCreateRemove() throws Exception {
    if (!checkNotOffline("testCreateRemove")) {
        return;
    }
    final long start = now();
    String name = getProgenyTestName();
    final String progenyJ2EEType = getProgenyJ2EEType();
    AMXConfig proxy = getProgeny(name);
    if (proxy != null) {
        final ObjectName objectName = Util.getExtra(proxy).getObjectName();
        remove(name);
        waitUnregistered(objectName);
        assert (!getConnection().isRegistered(objectName));
        assert (getProgeny(name) == null);
        proxy = null;
    }
    final Container container = getProgenyContainer();
    final CreateRemoveListener listener = new CreateRemoveListener(container, progenyJ2EEType, name);
    // create it
    try {
        proxy = createProgeny(name, null);
    } catch (Exception e) {
        trace(getStackTrace(ExceptionUtil.getRootCause(e)));
        failure("Can't create item of j2eeType=" + progenyJ2EEType + ",name=" + name);
    }
    assert (proxy.getName().equals(name));
    final ObjectName objectName = Util.getObjectName(proxy);
    assert (getConnection().isRegistered(objectName));
    assert (container.getContainee(progenyJ2EEType, name) != null);
    assert (container.getContainee(progenyJ2EEType, name) == proxy);
    final AMXConfig progeny = getProgeny(name);
    assert (progeny == proxy);
    // remove it
    final ProxyFactory factory = Util.getExtra(proxy).getProxyFactory();
    assert (name.equals(progeny.getName()));
    remove(name);
    waitUnregistered(objectName);
    assert (!getConnection().isRegistered(objectName));
    waitProxyGone(factory, objectName);
    assert (getProgeny(name) == null);
    listener.waitNotifs();
    printElapsed("testCreateRemove: created/remove/listen for: " + progenyJ2EEType, start);
}
Also used : Container(com.sun.appserv.management.base.Container) ProxyFactory(com.sun.appserv.management.client.ProxyFactory) AMXConfig(com.sun.appserv.management.config.AMXConfig) CreateRemoveListener(org.glassfish.admin.amxtest.support.CreateRemoveListener) ObjectName(javax.management.ObjectName)

Aggregations

AMXConfig (com.sun.appserv.management.config.AMXConfig)7 AMX (com.sun.appserv.management.base.AMX)4 Container (com.sun.appserv.management.base.Container)3 HashSet (java.util.HashSet)2 MBeanInfo (javax.management.MBeanInfo)2 ObjectName (javax.management.ObjectName)2 QueryMgr (com.sun.appserv.management.base.QueryMgr)1 ProxyFactory (com.sun.appserv.management.client.ProxyFactory)1 SecurityMapConfig (com.sun.appserv.management.config.SecurityMapConfig)1 EventProvider (com.sun.appserv.management.j2ee.EventProvider)1 J2EEManagedObject (com.sun.appserv.management.j2ee.J2EEManagedObject)1 StateManageable (com.sun.appserv.management.j2ee.StateManageable)1 Monitoring (com.sun.appserv.management.monitor.Monitoring)1 IOException (java.io.IOException)1 Method (java.lang.reflect.Method)1 Date (java.util.Date)1 MBeanAttributeInfo (javax.management.MBeanAttributeInfo)1 MBeanOperationInfo (javax.management.MBeanOperationInfo)1 CreateRemoveListener (org.glassfish.admin.amxtest.support.CreateRemoveListener)1