@Override protected void tearDown() throws Exception { super.tearDown(); if (this.overflowDir != null) { this.overflowDir.delete(); } InternalDistributedSystem ids = InternalDistributedSystem .getConnectedInstance(); if (ids != null) { ids.disconnect(); } }
/** return the argument, or if null the DistributedMember id of this vm */ private DistributedMember getMember(DistributedMember mbr) { if (mbr == null) { return InternalDistributedSystem.getAnyInstance().getDistributedMember(); } else { return null; } }
public ReliableCacheReplyProcessor(InternalDistributedSystem system, Collection initMembers, Set departedMembers) { super(system, initMembers); this.dm = system.getDistributionManager(); this.failedMembers = departedMembers; }
@Override public boolean isDisconnecting() { InternalDistributedSystem system = InternalDistributedSystem.getAnyInstance(); return (system != null && system.isDisconnecting()); }
public void run() { InternalDistributedSystem system = InternalDistributedSystem.getAnyInstance(); system.disconnect(); } });
public void run() { try { // Allow the Function call to exit Thread.sleep(1000); } catch (InterruptedException e) { } ConnectionTable.threadWantsSharedResources(); if (ids.isConnected()) { ids.disconnect(); } } });
@Override public void setUp() throws Exception { final InternalDistributedSystem sys = InternalDistributedSystem .getConnectedInstance(); if (sys != null && sys.isConnected()) { sys.disconnect(); } final Properties props = new Properties(); props.setProperty("mcast-port", "0"); // loner this.cache = new CacheFactory(props).create(); }
public void disconnect() { // get rid of the command-line distributed system created by SystemAdmin system = null; InternalDistributedSystem sys = InternalDistributedSystem.getAnyInstance(); if (sys != null && sys.isConnected()) { getLogWriter().info("disconnecting(3)"); sys.disconnect(); } }
public Manager(ManagementResourceRepo repo , InternalDistributedSystem system, Cache cache){ this.repo = repo; this.cache = (GemFireCacheImpl)cache; this.system = system; logger = InternalDistributedSystem.getLoggerI18n(); } public abstract boolean isRunning();
public static LogWriter getOrCreateLogWriter() { InternalDistributedSystem ids = InternalDistributedSystem.getAnyInstance(); if (ids == null || ids.getLogWriter() == null) { return new PureLogWriter(LogWriterImpl.levelNameToCode("info")); } else { return ids.getLogWriter(); } } }
private String getMemberID() { String formattedMemberID = MBeanJMXAdapter.getMemberNameOrId(InternalDistributedSystem .getConnectedInstance().getDistributedMember()); return formattedMemberID; }
protected void handleFromDataExceptionCheckCancellation(Throwable t) throws CancelException { // check if system is closing, else rethrow the exception final InternalDistributedSystem ds = InternalDistributedSystem .getAnyInstance(); if (ds == null) { throw InternalDistributedSystem.newDisconnectedException(t); } else { ds.getCancelCriterion().checkCancelInProgress(t); } }
public boolean processEvents(List<AsyncEvent<Object, Object>> events) { for (AsyncEvent event : events) { if(this.eventsMap.containsKey(event.getKey())) { InternalDistributedSystem.getConnectedInstance().getLogWriter().fine("This is a duplicate event --> " + event.getKey()); } this.eventsMap.put(event.getKey(), event.getDeserializedValue()); InternalDistributedSystem.getConnectedInstance().getLogWriter().fine("Received an event --> " + event.getKey()); } return true; }
private static int getDSTimeoutSecs() { final InternalDistributedSystem dsys = InternalDistributedSystem .getConnectedInstance(); if (dsys != null) { final int timeoutSecs = dsys.getConfig().getAckWaitThreshold(); if (timeoutSecs > 0) { return timeoutSecs; } return WAIT_INFINITE; } return DS_NOTFOUND; }
private boolean isServerNode(){ return (this.system.getDistributedMember().getVmKind() != DistributionManager.LOCATOR_DM_TYPE && this.system.getDistributedMember().getVmKind() != DistributionManager.ADMIN_ONLY_DM_TYPE && !isClient()); }
@Override public void releaseQuorumChecker(QuorumChecker checker) { ((GMSQuorumChecker)checker).suspend(); InternalDistributedSystem system = InternalDistributedSystem.getAnyInstance(); if (system == null || !system.isConnected()) { checker.close(); } }
private void getCanonicalIDs() { if (this.versionTags != null) { DM dm = InternalDistributedSystem.getConnectedInstance().getDistributionManager(); if (dm != null) { for (VersionTag tag: this.versionTags) { if (tag != null) { tag.setCanonicalIDs(dm); } } } } }
/** * Return the time in sec to wait before removing unresponsive members * from the distributed system. This period starts after the ack-wait-threshold * period has elapsed */ protected int getSevereAlertThreshold() { return this.system.getConfig().getAckSevereAlertThreshold(); }
public void run() { // validate config level of LogWriter InternalDistributedSystem sys = getSystem(); Config conf = sys.getConfig(); Object value = conf.getAttributeObject("log-level"); assertEquals(oldLogLevel, value); // validate runtime level of LogWriter (requires bugfix 35320) LogWriter logWriter = sys.getLogWriter(); assertTrue(logWriter.warningEnabled()); assertTrue(logWriter.infoEnabled()); } });
public boolean isPresent() { InternalDistributedSystem sys = InternalDistributedSystem.getAnyInstance(); if (sys == null) { throw new IllegalStateException(LocalizedStrings.InternalRole_ISPRESENT_REQUIRES_A_CONNECTION_TO_THE_DISTRIBUTED_SYSTEM.toLocalizedString()); } DM dm = sys.getDistributionManager(); return dm.isRolePresent(this); }