com.gemstone.gemfire.GemFireException类的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(47)

本文整理了Java中com.gemstone.gemfire.GemFireException类的一些代码示例,展示了GemFireException类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GemFireException类的具体详情如下:
包路径:com.gemstone.gemfire.GemFireException
类名称:GemFireException

GemFireException介绍

[英]This is the abstract superclass of exceptions that are thrown to indicate incorrect usage of GemFire. Since these exceptions are unchecked, this class really ought to be called GemFireRuntimeException; however, the current name is retained for compatibility's sake.
[中]

代码示例

代码示例来源:origin: apache/geode

/**
 * Returns the root cause of this <code>GemFireException</code> or <code>null</code> if the cause
 * is nonexistent or unknown.
 */
public Throwable getRootCause() {
 if (this.getCause() == null) {
  return null;
 }
 Throwable root = this.getCause();
 while (root.getCause() != null) {
  root = root.getCause();
 }
 return root;
}

代码示例来源:origin: io.snappydata/snappydata-store-core

|| gfeex instanceof FunctionExecutionException
  || gfeex.getClass().equals(FunctionException.class))
  && gfeex.getCause() instanceof GemFireException) {
 gfeex = (GemFireException)gfeex.getCause();
   cause, gfeex.getMessage());
    .toLocalizedString();
 expected = expected.substring(0, expected.indexOf('.'));
 String msgThis = gfeex.getLocalizedMessage();
 if (msgThis.indexOf(expected) != -1
   || msgThis.contains(LocalizedStrings
 String[] messageParts = gfeex.getMessage().split(": ");
 return StandardException.newException(SQLState.NO_DATASTORE_FOUND, cause,
   messageParts.length > 1 ? messageParts[1] : op);
 return StandardException.newException(SQLState.GFXD_DISK_SPACE_FULL, gfeex, gfeex.getMessage());
   gfeex);
Throwable innerCause = gfeex.getCause();
if (innerCause != null && innerCause instanceof GemFireException) {
 StandardException se = processKnownGemFireException(

代码示例来源:origin: org.apache.geode/gemfire-core

@Override
 public String getMessage() {
  InternalDistributedMember s = getSender();
  String m = super.getMessage();
  return (s!=null) ? ("From " + s + ": " + m) : m;
 }
}

代码示例来源:origin: io.snappydata/snappydata-store-core

if (gfeex.getCause() instanceof ForcedDisconnectException) {
 return StandardException.newException(
   SQLState.GFXD_FORCED_DISCONNECT_EXCEPTION, gfeex);
  SQLState.LANG_UNEXPECTED_USER_EXCEPTION, gfeex, gfeex.toString());

代码示例来源:origin: org.apache.geode/gemfire-core

private void handleGemFireException(final GemFireException e) {
  String message = LocalizedStrings.AgentLauncher_SERVER_FAILED_TO_START_0.toLocalizedString(e.getMessage());
  if (e.getCause() != null) {
   if (e.getCause().getCause() != null) {
    message += ", " + e.getCause().getCause().getMessage();
   }
  }
  setServerError(null, new Exception(message));
 }
};

代码示例来源:origin: org.apache.geode/gemfire-core

private void handleArchiverException(GemFireException ex) {
 if (this.archiver.getSampleCount() > 0) {
  StringWriter sw = new StringWriter();
  ex.printStackTrace(new PrintWriter(sw, true));
  logger.warn(LogMarker.STATISTICS, LocalizedMessage.create(LocalizedStrings.HostStatSampler_STATISTIC_ARCHIVER_SHUTTING_DOWN_BECAUSE__0, sw));
 }
 try {
  this.archiver.close();
 } catch (GemFireException ignore) {
  if (this.archiver.getSampleCount() > 0) {
   logger.warn(LogMarker.STATISTICS, LocalizedMessage.create(LocalizedStrings.HostStatSampler_STATISIC_ARCHIVER_SHUTDOWN_FAILED_BECAUSE__0, ignore.getMessage()));
  }
 }
 if (this.archiver.getSampleCount() == 0 && this.archiveId != -1) {
  // dec since we didn't use the file and close deleted it.
  this.archiveId--;
 }
 this.archiver = null;
}

代码示例来源:origin: io.snappydata/gemfire-core

@Override
 public String toString() {
  String result = super.toString();
  Throwable cause = getCause();
  if (cause != null) {
   String causeStr = cause.toString();
   final String glue = ", caused by ";
   StringBuffer sb = new StringBuffer(result.length() + causeStr.length() + glue.length());
   sb.append(result)
    .append(glue)
    .append(causeStr);
   result = sb.toString();
  }
  return result;
 }
}

代码示例来源:origin: io.snappydata/snappydata-store-core

public static DistributedMember getSenderFromException(Throwable t) {
 DistributedMember member = null;
 // try to find remote member from some wrapped exception
 while (t != null && member == null) {
  if (t instanceof ReplyException) {
   member = ((ReplyException)t).getSender();
  }
  else if (t instanceof GemFireXDRuntimeException) {
   member = ((GemFireXDRuntimeException)t).getOrigin();
  }
  else if (t instanceof StandardException) {
   member = ((StandardException)t).getOrigin();
  }
  else if (t instanceof DerbySQLException) {
   member = ((DerbySQLException)t).getOrigin();
  }
  else if (t instanceof GemFireException) {
   member = ((GemFireException)t).getOrigin();
  }
  else if (t instanceof GemFireCheckedException) {
   member = ((GemFireCheckedException)t).getOrigin();
  }
  t = t.getCause();
 }
 return member;
}

代码示例来源:origin: io.snappydata/gemfire-core

public void run() {
 try {
  agent.start();
  writeStatus(createStatus(status, RUNNING));
 }
 catch (IOException e) {
  e.printStackTrace();
 }
 catch (GemFireException e) {
  e.printStackTrace();
  handleGemFireException(e);
 }
}

代码示例来源:origin: io.snappydata/gemfirexd-core

|| gfeex instanceof FunctionExecutionException
  || gfeex.getClass().equals(FunctionException.class))
  && gfeex.getCause() instanceof GemFireException) {
 gfeex = (GemFireException)gfeex.getCause();
   cause, gfeex.getMessage());
    .toLocalizedString();
 expected = expected.substring(0, expected.indexOf('.'));
 String msgThis = gfeex.getLocalizedMessage();
 if (msgThis.indexOf(expected) != -1
   || msgThis.contains(LocalizedStrings
 return StandardException.newException(SQLState.GFXD_DISK_SPACE_FULL, gfeex, gfeex.getMessage());
   gfeex);
Throwable innerCause = gfeex.getCause();
if (innerCause != null && innerCause instanceof GemFireException) {
 StandardException se = processKnownGemFireException(

代码示例来源:origin: io.snappydata/gemfire-core

@Override
 public String getMessage() {
  InternalDistributedMember s = getSender();
  String m = super.getMessage();
  return (s!=null) ? ("From " + s + ": " + m) : m;
 }
}

代码示例来源:origin: io.snappydata/gemfirexd-core

if (gfeex.getCause() instanceof ForcedDisconnectException) {
 return StandardException.newException(
   SQLState.GFXD_FORCED_DISCONNECT_EXCEPTION, gfeex);
  SQLState.LANG_UNEXPECTED_USER_EXCEPTION, gfeex, gfeex.toString());

代码示例来源:origin: io.snappydata/gemfire-core

private void handleGemFireException(final GemFireException e) {
  String message = LocalizedStrings.AgentLauncher_SERVER_FAILED_TO_START_0.toLocalizedString(e.getMessage());
  if (e.getCause() != null) {
   if (e.getCause().getCause() != null) {
    message += ", " + e.getCause().getCause().getMessage();
   }
  }
  setServerError(null, new Exception(message));
 }
};

代码示例来源:origin: io.snappydata/gemfire-core

private void handleArchiverException(GemFireException ex) {
 if (this.archiver.getSampleCount() > 0) {
  StringWriter sw = new StringWriter();
  ex.printStackTrace(new PrintWriter(sw, true));
  this.collector.getLogWriterI18n().warning(LocalizedStrings.HostStatSampler_STATISTIC_ARCHIVER_SHUTTING_DOWN_BECAUSE__0, sw);
 }
 try {
  this.archiver.close();
 } catch (GemFireException ignore) {
  if (this.archiver.getSampleCount() > 0) {
   this.collector.getLogWriterI18n().warning(LocalizedStrings.HostStatSampler_STATISIC_ARCHIVER_SHUTDOWN_FAILED_BECAUSE__0, ignore.getMessage());
  }
 }
 if (this.archiver.getSampleCount() == 0 && this.archiveId != -1) {
  // dec since we didn't use the file and close deleted it.
  this.archiveId--;
 }
 this.archiver = null;
}

代码示例来源:origin: org.apache.geode/gemfire-core

@Override
 public String toString() {
  String result = super.toString();
  Throwable cause = getCause();
  if (cause != null) {
   String causeStr = cause.toString();
   final String glue = ", caused by ";
   StringBuffer sb = new StringBuffer(result.length() + causeStr.length() + glue.length());
   sb.append(result)
    .append(glue)
    .append(causeStr);
   result = sb.toString();
  }
  return result;
 }
}

代码示例来源:origin: io.snappydata/gemfirexd

public static DistributedMember getSenderFromException(Throwable t) {
 DistributedMember member = null;
 // try to find remote member from some wrapped exception
 while (t != null && member == null) {
  if (t instanceof ReplyException) {
   member = ((ReplyException)t).getSender();
  }
  else if (t instanceof GemFireXDRuntimeException) {
   member = ((GemFireXDRuntimeException)t).getOrigin();
  }
  else if (t instanceof StandardException) {
   member = ((StandardException)t).getOrigin();
  }
  else if (t instanceof DerbySQLException) {
   member = ((DerbySQLException)t).getOrigin();
  }
  else if (t instanceof GemFireException) {
   member = ((GemFireException)t).getOrigin();
  }
  else if (t instanceof GemFireCheckedException) {
   member = ((GemFireCheckedException)t).getOrigin();
  }
  t = t.getCause();
 }
 return member;
}

代码示例来源:origin: org.apache.geode/gemfire-core

public void run() {
 try {
  agent.start();
  writeStatus(createStatus(AgentLauncher.this.basename, RUNNING, OSProcess.getId()));
 }
 catch (IOException e) {
  e.printStackTrace();
 }
 catch (GemFireException e) {
  e.printStackTrace();
  handleGemFireException(e);
 }
}

代码示例来源:origin: io.snappydata/gemfirexd

|| gfeex instanceof FunctionExecutionException
  || gfeex.getClass().equals(FunctionException.class))
  && gfeex.getCause() instanceof GemFireException) {
 gfeex = (GemFireException)gfeex.getCause();
   cause, gfeex.getMessage());
    .toLocalizedString();
 expected = expected.substring(0, expected.indexOf('.'));
 String msgThis = gfeex.getLocalizedMessage();
 if (msgThis.indexOf(expected) != -1
   || msgThis.contains(LocalizedStrings
 return StandardException.newException(SQLState.GFXD_DISK_SPACE_FULL, gfeex, gfeex.getMessage());
   gfeex);
Throwable innerCause = gfeex.getCause();
if (innerCause != null && innerCause instanceof GemFireException) {
 StandardException se = processKnownGemFireException(

代码示例来源:origin: org.apache.geode/gemfire-core

public void close() {
 // sync SampleCollector.class and then this.sampleHandlers
 synchronized (SampleCollector.class) {
  synchronized (this.sampleHandlers) {
   if (logger.isTraceEnabled(LogMarker.STATISTICS)) {
    logger.trace(LogMarker.STATISTICS, "SampleCollector#close");
   }
   try {
    StatArchiveHandler handler = this.statArchiveHandler; 
    if (handler != null) {
     handler.close();
    }
   } catch (GemFireException ignore) {
    logger.warn(LogMarker.STATISTICS, LocalizedMessage.create(LocalizedStrings.HostStatSampler_STATISTIC_ARCHIVER_SHUTDOWN_FAILED_BECAUSE__0, ignore.getMessage()));
   }
   StatMonitorHandler handler = this.statMonitorHandler;
   if (handler != null) {
    handler.close();
   }
  }
  instance = null;
 }
}

代码示例来源:origin: io.snappydata/gemfirexd

if (gfeex.getCause() instanceof ForcedDisconnectException) {
 return StandardException.newException(
   SQLState.GFXD_FORCED_DISCONNECT_EXCEPTION, gfeex);
  SQLState.LANG_UNEXPECTED_USER_EXCEPTION, gfeex, gfeex.toString());

相关文章