use of com.sun.appserv.management.DomainRoot in project Payara by payara.
the class ContainerTest method checkContainerContainsChild.
public void checkContainerContainsChild(final ObjectName containeeObjectName) throws Exception {
final MBeanServerConnection conn = getMBeanServerConnection();
assert (containeeObjectName != null);
assert (conn.isRegistered(containeeObjectName));
final AMX containedProxy = getProxyFactory().getProxy(containeeObjectName, AMX.class);
if (containedProxy instanceof DomainRoot) {
// DomainRoot has no Container
return;
}
final ObjectName containerObjectName = (ObjectName) conn.getAttribute(containeeObjectName, "ContainerObjectName");
if (!conn.isRegistered(containerObjectName)) {
warning("Container " + StringUtil.quote(containerObjectName) + " for " + StringUtil.quote(containeeObjectName) + " is not registered.");
return;
}
final AMX parentProxy = containedProxy.getContainer();
if (parentProxy instanceof Container) {
if (!(parentProxy instanceof Container)) {
trace("WARNING: proxy is instance of Container, but not Container: " + Util.getExtra(parentProxy).getObjectName());
} else {
final Container container = (Container) parentProxy;
if (container != null) {
final Set<AMX> containees = container.getContaineeSet();
final Set<ObjectName> containeeObjectNames = Util.toObjectNames(containees);
if (!containeeObjectNames.contains(Util.getExtra(containedProxy).getObjectName())) {
trace("ERROR: Container " + Util.getExtra(parentProxy).getObjectName() + " does not contain its child: " + containeeObjectName);
assertTrue(false);
}
}
}
}
}
use of com.sun.appserv.management.DomainRoot in project Payara by payara.
the class TestMain method initOffline.
private static DomainRoot initOffline(final File domainXML) {
final MBeanServer server = MBeanServerFactory.createMBeanServer("test");
assert (domainXML.exists() && domainXML.length() != 0);
final OfflineConfigIniter initer = new OfflineConfigIniter(server, domainXML);
final DomainRoot domainRoot = initer.getDomainRoot();
return domainRoot;
}
Aggregations