use of org.apache.geode.admin.internal.AdminDistributedSystemImpl in project geode by apache.
the class ShutdownAllDUnitTest method shutDownAllMembers.
// TODO prpersist
// test move bucket
// test async put
// test create a new bucket by put async
private void shutDownAllMembers(VM vm, final int expnum) {
vm.invoke(new SerializableRunnable("Shutdown all the members") {
public void run() {
DistributedSystemConfig config;
AdminDistributedSystemImpl adminDS = null;
try {
config = AdminDistributedSystemFactory.defineDistributedSystem(getSystem(), "");
adminDS = (AdminDistributedSystemImpl) AdminDistributedSystemFactory.getDistributedSystem(config);
adminDS.connect();
Set members = adminDS.shutDownAllMembers();
int num = members == null ? 0 : members.size();
assertEquals(expnum, num);
} catch (AdminException e) {
throw new RuntimeException(e);
} finally {
if (adminDS != null) {
adminDS.disconnect();
}
}
}
});
// clean up for this vm
System.setProperty("TestInternalGemFireError", "false");
}
use of org.apache.geode.admin.internal.AdminDistributedSystemImpl in project geode by apache.
the class JUnit4DistributedTestCase method disconnectFromDS.
/**
* Disconnects this VM from the distributed system
*/
public static final void disconnectFromDS() {
// setTestMethodName(null);
GemFireCacheImpl.testCacheXml = null;
if (system != null) {
system.disconnect();
system = null;
}
for (; ; ) {
DistributedSystem ds = InternalDistributedSystem.getConnectedInstance();
if (ds == null) {
break;
}
try {
ds.disconnect();
} catch (Exception e) {
// ignore
}
}
AdminDistributedSystemImpl ads = AdminDistributedSystemImpl.getConnectedInstance();
if (ads != null) {
// && ads.isConnected()) {
ads.disconnect();
}
}
use of org.apache.geode.admin.internal.AdminDistributedSystemImpl in project geode by apache.
the class AlertsNotificationMessage method process.
@Override
protected void process(DistributionManager dm) {
// TODO add code to invoke process notification of agrregator
// TODO: need to check whether it's a valid implimentation
AdminDistributedSystemImpl ds = AdminDistributedSystemImpl.getConnectedInstance();
if (ds instanceof StatAlertsAggregator) {
StatAlertsAggregator aggregator = (StatAlertsAggregator) ds;
RemoteGemFireVM remoteVM = dm.getAgent().getMemberById(getSender());
aggregator.processNotifications(this._alerts, remoteVM);
}
}
use of org.apache.geode.admin.internal.AdminDistributedSystemImpl in project geode by apache.
the class ClientMembershipMessage method process.
/**
*
* @see org.apache.geode.distributed.internal.DistributionMessage#process(org.apache.geode.distributed.internal.DistributionManager)
*/
@Override
protected void process(DistributionManager dm) {
AdminDistributedSystemImpl adminDs = AdminDistributedSystemImpl.getConnectedInstance();
/*
* Disconnect can be called on AdminDistributedSystem from Agent and it is not synchronous with
* processing of this message. Null check added to avoid null if disconnect has been called on
* AdminDistributedSystem
*/
if (adminDs != null) {
String senderId = null;
InternalDistributedMember msgSender = this.getSender();
if (msgSender != null) {
senderId = msgSender.getId();
}
adminDs.processClientMembership(senderId, clientId, clientHost, eventType);
}
}
Aggregations