@Override public LogWriter getLogger() { return this.system.getLogWriter(); }
LogWriter getLogWriter() { return ds.getLogWriter(); }
private static LogWriter getLogger() { LogWriter result = null; InternalDistributedSystem ids = InternalDistributedSystem.unsafeGetConnectedInstance(); if (ids != null) { result = ids.getLogWriter(); } return result; } }
private void waitDisconnected() { synchronized (this.isConnectedMutex) { while (this.isConnected) { boolean interrupted = Thread.interrupted(); try { this.isConnectedMutex.wait(); } catch (InterruptedException e) { interrupted = true; getLogWriter() .warning("Disconnect wait interrupted", e); } finally { if (interrupted) { Thread.currentThread().interrupt(); } } } // while } }
@Override public void setStatisticSampleRate(int value) { if (value < DEFAULT_STATISTIC_SAMPLE_RATE) { // fix 48228 InternalDistributedSystem ids = InternalDistributedSystem.getConnectedInstance(); if (ids != null) { ids.getLogWriter() .info("Setting statistic-sample-rate to " + DEFAULT_STATISTIC_SAMPLE_RATE + " instead of the requested " + value + " because VSD does not work with sub-second sampling."); } value = DEFAULT_STATISTIC_SAMPLE_RATE; } statisticSampleRate = value; }
@Override public void run() { try { Region<?, ?> root = getRootRegion("root"); Region<String, ?> rgn = root.getSubregion(rgnName2); rgn.create("key", null); getSystem().getLogWriter().info("testTXMultiRegion: Created Key"); } catch (CacheException e) { fail("While creating region", e); } } };
@Override public void run() { dsToDisconnect.getLogWriter() .info("OffHeapStorage about to invoke disconnect on " + dsToDisconnect); dsToDisconnect.disconnect(cause.getMessage(), cause, false); } };
@Override public void run() { try { Region<String, ?> rgn = getRootRegion("root").getSubregion(rgnName1); rgn.create("key", null); getSystem().getLogWriter().info("testTXMultiRegion: Created key"); } catch (CacheException e) { fail("While creating region", e); } } };
@Override public void run() { try { Region<?, ?> root = getRootRegion("root"); Region<String, ?> rgn = root.getSubregion(rgnName3); rgn.create("key", null); getSystem().getLogWriter().info("testTXMultiRegion: Created Key"); } catch (CacheException e) { fail("While creating region", e); } } };
@Override public void run() { CacheTransactionManager txMgr2 = getCache().getCacheTransactionManager(); MyTransactionListener<Object, Object> tl = new MyTransactionListener<>(); setTxListener(txMgr2, tl); try { createRegion(rgnName3); getSystem().getLogWriter().info("testTXMultiRegion: Created Region"); } catch (CacheException e) { fail("While creating region", e); } } };
@Override public void run() { CacheTransactionManager txMgr2 = getCache().getCacheTransactionManager(); MyTransactionListener<Object, Object> tl = new MyTransactionListener<>(); setTxListener(txMgr2, tl); try { createRegion(rgnName2); getSystem().getLogWriter().info("testTXMultiRegion: Created region2"); } catch (CacheException e) { fail("While creating region", e); } } };
@Before public void setUp() throws Exception { when(ids.getLogWriter()).thenReturn(lw); when(ids.getDistributionManager()).thenReturn(dm); }
@Override public void run() { try { if (!getRegionAttributes().getDataPolicy().withReplication() && getRegionAttributes().getPartitionAttributes() == null) { Region<?, ?> root = getRootRegion("root"); Region<Object, Object> rgn = root.getSubregion(rgnName); rgn.create("key", null); getSystem().getLogWriter().info("testDistributedPut: Created Key"); } } catch (CacheException e) { fail("While creating region", e); } } };
/** * Notifies all registered <code>ConnectListener</code>s that a connection to a distributed system * has been created. */ private static void notifyConnectListeners(InternalDistributedSystem sys) { synchronized (connectListeners) { for (Iterator iter = connectListeners.iterator(); iter.hasNext();) { try { ConnectListener listener = (ConnectListener) iter.next(); listener.onConnect(sys); } catch (VirtualMachineError err) { SystemFailure.initiateFailure(err); // If this ever returns, rethrow the error. We're poisoned // now, so don't let this thread continue. throw err; } catch (Throwable t) { // Whenever you catch Error or Throwable, you must also // catch VirtualMachineError (see above). However, there is // _still_ a possibility that you are dealing with a cascading // error condition, so you also need to check to see if the JVM // is still usable: SystemFailure.checkFailure(); sys.getLogWriter() .severe("ConnectListener threw...", t); } } } }
@Override public void run() { try { Region<?, ?> root = getRootRegion(); Region<Object, Object> rgn = root.getSubregion(rgnName); rgn.create("key", null); CountingDistCacheListener cacheListener = (CountingDistCacheListener) rgn.getAttributes().getCacheListeners()[0]; cacheListener.assertCount(0, 0, 0, 0); getSystem().getLogWriter().info("testTXSimpleOps: Created Key"); } catch (CacheException e) { fail("While creating region", e); } } };
@Override public void process(DistributionMessage msg) { final LogWriter log = this.system.getLogWriter(); super.process(msg); if (log.fineEnabled()) { log.fine(this.toString() + " done processing " + msg + " from " + msg.getSender()); } }
private void executeWithNoLastResult(FunctionContext context) { // add expected exception InternalDistributedSystem.getConnectedInstance().getLogWriter() .info("<ExpectedException action=add>did not send last result" + "</ExpectedException>"); context.getResultSender().sendResult(context.getArguments()); }
@Override public void run() { CacheTransactionManager txMgr2 = getCache().getCacheTransactionManager(); MyTransactionListener<Object, Object> tl = new MyTransactionListener<>(); setTxListener(txMgr2, tl); try { createRegion(rgnName1); getSystem().getLogWriter().info("testTXMultiRegion: Created region1"); } catch (CacheException e) { fail("While creating region", e); } } };
@Override public void run2() { try { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); // can't be local since used with // registerInterest factory.setCacheLoader(new CacheServerCacheLoader()); beginCacheXml(); createRootRegion(rName, factory.create()); startBridgeServer(port); finishCacheXml(rName + "-" + port); Region region = getRootRegion(rName); assertNotNull(region); region.put(BridgeServerKey, new Integer(port)); // A unique key/value to identify the // BridgeServer } catch (Exception e) { getSystem().getLogWriter().severe(e); fail("Failed to start CacheServer " + e); } } });
getSystem().getLogWriter().info("textTXRmtMirror: create mirror and non-mirror"); txMgr.commit();