public Object load2(LoaderHelper helper) throws CacheLoaderException { try { helper.netSearch(true); } catch (TimeoutException ex) { fail("Why did I timeout?", ex); } return null; } };
public Object load(LoaderHelper helper) throws CacheLoaderException { if(helper.getRegion().getAttributes().getScope().equals(Scope.DISTRIBUTED_ACK)) { System.err.println("Doing a net search for " + helper.getKey()); Object result = helper.netSearch(false); System.err.println("Net search found " + result); if(result != null) { return result; } } Object key = helper.getKey(); return message + "-" + key; }
public Object load2(LoaderHelper helper) throws CacheLoaderException { assertEquals(key, helper.getKey()); assertEquals(name, helper.getRegion().getName()); try { helper.getRegion().getAttributes(); Object result = helper.netSearch(false); assertEquals(value, result); return result; } catch (TimeoutException ex) { fail("Why did I time out?", ex); } return null; } };
public Object load2(LoaderHelper helper) throws CacheLoaderException { assertEquals(key, helper.getKey()); assertEquals(name, helper.getRegion().getName()); try { helper.getRegion().getAttributes(); Object result = helper.netSearch(true); assertEquals(value, result); return result; } catch (TimeoutException ex) { fail("Why did I time out?", ex); } return null; } };
public Object load2(LoaderHelper helper) throws CacheLoaderException { assertEquals(key, helper.getKey()); assertEquals(name, helper.getRegion().getName()); try { RegionAttributes attrs = helper.getRegion().getAttributes(); if (attrs.getScope().isDistributed()) { assertNull(helper.netSearch(false)); assertNull(helper.netSearch(true)); } } catch (TimeoutException ex) { fail("Why did I time out?", ex); } Object argument = helper.getArgument(); if (argument != null) { if (argument.equals(exception)) { String s = "Test Exception"; throw new CacheLoaderException(s); } else { assertEquals(arg, argument); } } return value; } };