public Object load(LoaderHelper helper) throws CacheLoaderException { if (helper.getKey().equals("loadkey")) { return "loadvalue"; } else if (helper.getKey().equals("loadexception")) { throw new CacheLoaderException("expected"); } else { return null; } } public void close() {
public static boolean checkIfENFE(CacheLoaderException ex) { Throwable e = ex.getCause(); while(e != null) { if (e instanceof EntryNotFoundException) { return true; } e = e.getCause(); } return false; }
} catch (CacheLoaderException e) { String message = e.getMessage(); Log.getLogWriter().info("CacheLoaderException " + e + " expected, continuing test");
String expected = com.gemstone.gemfire.internal.cache.LoaderHelperImpl.NET_SEARCH_LOCAL.toLocalizedString(); String message = ex.getMessage(); assertTrue("Unexpected message \"" + message + "\"", message.indexOf(expected) != -1);
private RuntimeException transformException(RuntimeException ex, Op op) { if(isLoaderOp(op)) { if (ex instanceof SubscriptionNotEnabledException) { return new CacheLoaderException("establishCallbackConnection must be set to true", ex); } else if (ex instanceof CacheLoaderException) { return ex; } else if (ex instanceof CancelException) { return ex; } else if (ex instanceof ServerConnectivityException && ex.getCause() != null) { return new CacheLoaderException(ex.getCause()); } else { return new CacheLoaderException(ex); } } else { if (ex instanceof SubscriptionNotEnabledException) { return new BridgeWriterException("establishCallbackConnection must be set to true", ex); } else if (ex instanceof CacheWriterException) { return ex; } else if (ex instanceof CancelException) { return ex; } else if (ex instanceof ServerConnectivityException && ex.getCause() != null) { return new BridgeWriterException(ex.getCause()); } else { return new BridgeWriterException(ex); } } }
public static boolean checkIfENFE(CacheLoaderException ex) { Throwable e = ex.getCause(); while(e != null) { if (e instanceof EntryNotFoundException) { return true; } e = e.getCause(); } return false; }
private void checkClosed() { String reason = this.proxy.getCancelCriterion().cancelInProgress(); if(reason != null) { throw new BridgeWriterException("The BridgeWriter has been closed: " + reason); } if (this.isClosed) { throw new CacheLoaderException(LocalizedStrings.BridgeLoader_THE_BRIDGELOADER_HAS_BEEN_CLOSED.toLocalizedString()); } if (this.proxy != null && !this.proxy.isOpen()) { throw new CacheLoaderException(LocalizedStrings.BridgeLoader_THE_BRIDGELOADER_HAS_BEEN_CLOSED.toLocalizedString()); } }
public static boolean checkIfENFE(CacheLoaderException ex) { Throwable e = ex.getCause(); while(e != null) { if (e instanceof EntryNotFoundException) { return true; } e = e.getCause(); } return false; }
public Object load(LoaderHelper helper) throws CacheLoaderException { String s = "Should not be loading \"" + helper.getKey() + "\" in \"" + helper.getRegion().getFullPath() + "\""; throw new CacheLoaderException(s); }
if (e.getCause() instanceof ServerConnectivityException) cms.removeBucketServerLocation(server);
c = Class.forName(objtype); } catch (ClassNotFoundException nfe) { throw new CacheLoaderException("Database loader cannot find class " + objtype); } catch (Exception ex) { throw new CacheLoaderException("Error for class " + objtype, ex); ((ConfigurableObject) newObj).init( Integer.parseInt(index) ); } catch (NumberFormatException e) { throw new CacheLoaderException("Could not get index for key: " + key); } catch (Exception ex) { throw new CacheLoaderException("Error creating instance of " + objtype, ex);
if (e.getCause() instanceof ServerConnectivityException) cms.removeBucketServerLocation(server);
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; } };
cause = this.remoteException; throw new CacheLoaderException(LocalizedStrings.SearchLoadAndWriteProcessor_WHILE_INVOKING_A_REMOTE_NETLOAD_0.toLocalizedString(cause), cause);
cause = this.remoteException; throw new CacheLoaderException(LocalizedStrings.SearchLoadAndWriteProcessor_WHILE_INVOKING_A_REMOTE_NETLOAD_0.toLocalizedString(cause), cause);
public Object load(LoaderHelper<Object, Object> helper) throws CacheLoaderException { RegionKey primaryKey = null; try { primaryKey = (RegionKey)helper.getKey(); Object[] columnValues = new Object[this.numberOfColumns]; Object[] primaryKeyAsJavaObjectArray = new Object[primaryKey.nCols()]; primaryKey.getKeyColumns(primaryKeyAsJavaObjectArray); for (int index = 0; index < primaryKeyAsJavaObjectArray.length; ++index) { columnValues[pkIndexes[index] - 1] = primaryKeyAsJavaObjectArray[index]; } Object row = this.gfxdLdr.getRow(this.schemaName, this.tableName, primaryKeyAsJavaObjectArray); if (row != null) { GemFireContainer gfcontainer = (GemFireContainer)helper.getRegion() .getUserAttribute(); final Object value = gfcontainer.makeValueAsPerStorage(row); if (value != null) { return value; } } } catch (Throwable t) { if (GemFireXDUtils.retryToBeDone(t)) { throw new InternalFunctionInvocationTargetException(t); } throw new CacheLoaderException("exception while loading a row", t); } throw new EntryNotFoundException("no value obtained for key: " + primaryKey + " from row loader"); }
public Object load(LoaderHelper<Object, Object> helper) throws CacheLoaderException { RegionKey primaryKey = null; try { primaryKey = (RegionKey)helper.getKey(); Object[] columnValues = new Object[this.numberOfColumns]; Object[] primaryKeyAsJavaObjectArray = new Object[primaryKey.nCols()]; primaryKey.getKeyColumns(primaryKeyAsJavaObjectArray); for (int index = 0; index < primaryKeyAsJavaObjectArray.length; ++index) { columnValues[pkIndexes[index] - 1] = primaryKeyAsJavaObjectArray[index]; } Object row = this.gfxdLdr.getRow(this.schemaName, this.tableName, primaryKeyAsJavaObjectArray); if (row != null) { GemFireContainer gfcontainer = (GemFireContainer)helper.getRegion() .getUserAttribute(); final Object value = gfcontainer.makeValueAsPerStorage(row); if (value != null) { return value; } } } catch (Throwable t) { if (GemFireXDUtils.retryToBeDone(t)) { throw new InternalFunctionInvocationTargetException(t); } throw new CacheLoaderException("exception while loading a row", t); } throw new EntryNotFoundException("no value obtained for key: " + primaryKey + " from row loader"); }
public Object load(LoaderHelper<Object, Object> helper) throws CacheLoaderException { RegionKey primaryKey = null; try { primaryKey = (RegionKey)helper.getKey(); Object[] columnValues = new Object[this.numberOfColumns]; Object[] primaryKeyAsJavaObjectArray = new Object[primaryKey.nCols()]; primaryKey.getKeyColumns(primaryKeyAsJavaObjectArray); for (int index = 0; index < primaryKeyAsJavaObjectArray.length; ++index) { columnValues[pkIndexes[index] - 1] = primaryKeyAsJavaObjectArray[index]; } Object row = this.gfxdLdr.getRow(this.schemaName, this.tableName, primaryKeyAsJavaObjectArray); if (row != null) { GemFireContainer gfcontainer = (GemFireContainer)helper.getRegion() .getUserAttribute(); final Object value = gfcontainer.makeValueAsPerStorage(row); if (value != null) { return value; } } } catch (Throwable t) { if (GemFireXDUtils.retryToBeDone(t)) { throw new InternalFunctionInvocationTargetException(t); } throw new CacheLoaderException("exception while loading a row", t); } throw new EntryNotFoundException("no value obtained for key: " + primaryKey + " from row loader"); }
throw new CacheLoaderException(NET_SEARCH_LOCAL.toLocalizedString());
throw new CacheLoaderException(NET_SEARCH_LOCAL.toLocalizedString());