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");
}
}
}
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);
}
Aggregations