public void run2() throws CacheException { Region region = getRootRegion(PR_REGION_NAME); ExpectedException expect = addExpectedException("CacheClosedException"); try { region.put(10, "b"); fail("Expect CacheClosedException here"); } catch (CacheClosedException cce) { System.out.println(title+cce.getMessage()); if (DiskStoreImpl.KRF_DEBUG) { assert cce.getMessage().contains("The disk store is closed."); } else { assert cce.getMessage().contains("The disk store is closed"); } } finally { expect.remove(); } } });
public void run2() throws CacheException { Region region = getRootRegion(PR_REGION_NAME); ExpectedException expect = addExpectedException("CacheClosedException"); try { region.put(1, "b"); fail("Expect CacheClosedException here"); } catch (CacheClosedException cce) { System.out.println(title+cce.getMessage()); if (DiskStoreImpl.KRF_DEBUG) { assert cce.getMessage().contains("The disk store is closed."); } else { assert cce.getMessage().contains("The disk store is closed"); } } finally { expect.remove(); } } });
public void run2() throws CacheException { Region region = getRootRegion(PR_REGION_NAME); ExpectedException expect = addExpectedException("CacheClosedException"); try { region.destroy(2, "b"); fail("Expect CacheClosedException here"); } catch (CacheClosedException cce) { System.out.println(title+cce.getMessage()); if (DiskStoreImpl.KRF_DEBUG) { assert cce.getMessage().contains("The disk store is closed."); } else { assert cce.getMessage().contains("The disk store is closed"); } } finally { expect.remove(); } } });
@Override public Object getDataValue() { String dataType = getDataType(); if (dataType == null || dataType.equals("N/A")) { return null; } else if (isCompressed()) { return ((Chunk)this.block).getCompressedBytes(); } else if (!isSerialized()) { // byte array //return "byte[" + ((Chunk)this.block).getDataSize() + "]"; return ((Chunk)this.block).getRawBytes(); } else { try { byte[] bytes = ((Chunk)this.block).getRawBytes(); return DataSerializer.readObject(DataType.getDataInput(bytes)); } catch (IOException e) { e.printStackTrace(); return "IOException:" + e.getMessage(); } catch (ClassNotFoundException e) { e.printStackTrace(); return "ClassNotFoundException:" + e.getMessage(); } catch (CacheClosedException e) { e.printStackTrace(); return "CacheClosedException:" + e.getMessage(); } } } @Override
return crex.getResult(); }catch (CacheClosedException e) { return ResultBuilder.createGemFireErrorResult(e.getMessage()); } catch (FunctionInvocationTargetException e) { return ResultBuilder.createGemFireErrorResult(CliStrings.format(CliStrings.COULD_NOT_EXECUTE_COMMAND_TRY_AGAIN, CliStrings.ALTER_RUNTIME_CONFIG));
logger.debug(ccex.getMessage(), ccex);
this.commandService = CommandService.createLocalCommandService(cache); } catch (CacheClosedException e) { commandServiceInitError = e.getMessage(); logger.info(LogMarker.CONFIG, "Command Service could not be initialized. {}", e.getMessage()); } catch (CommandServiceException e) { commandServiceInitError = e.getMessage();
logger.debug("Encounter CacheClosedException when shutDownAll is closing PR: {}:{}", pr.getFullPath(), cce.getMessage()); } catch (CancelException ce) { logger.debug("Encounter CancelException when shutDownAll is closing PR: {}:{}", pr.getFullPath(), ce.getMessage());
result = ResultBuilder.createGemFireErrorResult(e.getMessage()); } catch (FunctionInvocationTargetException e) { result = ResultBuilder.createGemFireErrorResult(CliStrings.format(
result = ResultBuilder.createGemFireErrorResult(e.getMessage()); } catch (FunctionInvocationTargetException e) { result = ResultBuilder.createGemFireErrorResult(CliStrings.format(
result = ResultBuilder.createGemFireErrorResult(e.getMessage()); } catch (FunctionInvocationTargetException e) { result = ResultBuilder.createGemFireErrorResult(CliStrings.format(
result = ResultBuilder.createGemFireErrorResult(e.getMessage()); } catch (FunctionInvocationTargetException e) { result = ResultBuilder.createGemFireErrorResult(CliStrings.format(
@Test(expected = CacheClosedException.class) public void testExecuteOnMemberWithNoCache() throws Throwable { final FunctionContext mockFunctionContext = mockContext.mock(FunctionContext.class, "MockFunctionContext"); final ListDiskStoresFunction testListDiskStoresFunction = new TestListDiskStoresFunction(mockContext.mock(Cache.class, "MockCache")) { @Override protected Cache getCache() { throw new CacheClosedException("Expected"); } }; final TestResultSender testResultSender = new TestResultSender(); mockContext.checking(new Expectations() {{ oneOf(mockFunctionContext).getResultSender(); will(returnValue(testResultSender)); }}); testListDiskStoresFunction.execute(mockFunctionContext); try { testResultSender.getResults(); } catch (CacheClosedException expected) { assertEquals("Expected", expected.getMessage()); throw expected; } }
commandServiceInitError = e.getMessage(); this.logger.convertToLogWriter().config("Command Service could not be initialized. " + e.getMessage()); // This should be error, isn't it? } catch (CommandServiceException e) { commandServiceInitError = e.getMessage();
isDisconnected = true; } catch (CacheClosedException e) { Log.getLogWriter().info("DISCONNECTED " + e.getMessage()); isDisconnected = true; } catch (Exception e) {
context.getResultSender().lastResult(new CliFunctionResult(memberId, e, e.getMessage())); } catch (Exception e) { context.getResultSender().lastResult(new CliFunctionResult(memberId, e, e.getMessage()));
context.getResultSender().lastResult(new CliFunctionResult(memberId, e, e.getMessage())); } catch (Exception e) { context.getResultSender().lastResult(new CliFunctionResult(memberId, e, e.getMessage()));
if (!(execution instanceof DistributedRegionFunctionExecutor || execution instanceof MultiRegionFunctionExecutor) || !fn.isHA()) { FunctionInvocationTargetException fite = new FunctionInvocationTargetException(e.getMessage()); throw new FunctionException(fite); clearResults(); FunctionInvocationTargetException fite = new InternalFunctionInvocationTargetException( e.getMessage()); throw new FunctionException(fite);
if (!this.fn.isHA()) { FunctionInvocationTargetException fite = new FunctionInvocationTargetException(e.getMessage()); throw new FunctionException(fite); e.getMessage(), this.execution.getFailedNodes()); throw new FunctionException(fite);
+ pr.getFullPath() + ":" + cce.getMessage()); } catch (CancelException ce) { logger.fine("Encounter CancelException when shutDownAll is closing PR: "