javax.management.RuntimeErrorException.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(56)

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

RuntimeErrorException.<init>介绍

暂无

代码示例

代码示例来源:origin: ninjaframework/ninja

/**
 * Simply reads a property resource file that contains the version of this
 * Ninja build. Helps to identify the Ninja version currently running.
 * 
 * @return The version of Ninja. Eg. "1.6-SNAPSHOT" while developing of "1.6" when released.
 */
private final String readNinjaVersion() {
  
  // location of the properties file
  String LOCATION_OF_NINJA_BUILTIN_PROPERTIES = "ninja/ninja-builtin.properties";
  // and the key inside the properties file.
  String NINJA_VERSION_PROPERTY_KEY = "ninja.version";
  
  String ninjaVersion;
  try (InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(LOCATION_OF_NINJA_BUILTIN_PROPERTIES)){
    Properties prop = new Properties();
    prop.load(stream);
    
    ninjaVersion = prop.getProperty(NINJA_VERSION_PROPERTY_KEY);
  
  } catch (Exception e) {
    //this should not happen. Never.
    throw new RuntimeErrorException(new Error("Something is wrong with your build. Cannot find resource " + LOCATION_OF_NINJA_BUILTIN_PROPERTIES));
  }
  
  return ninjaVersion;
  
}

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

Throwable t = x.getTargetException();
if (t instanceof Error)
 throw new MBeanException(new RuntimeErrorException((Error) t));
else
 throw new MBeanException((Exception) t);

代码示例来源:origin: nodebox/nodebox

public Image(File file) {
  if (file == null || file.getPath().equals(BLANK_IMAGE)) {
    image = blankImage;
  } else {
    try {
      image = ImageIO.read(file);
    } catch (IOException e) {
      throw new RuntimeErrorException(null, "Could not read image " + file);
    }
  }
}

代码示例来源:origin: nodebox/nodebox

public static Image fromData(byte[] data) {
  InputStream istream = new BufferedInputStream(new ByteArrayInputStream(data));
  try {
    return new Image(ImageIO.read(istream));
  } catch (IOException e) {
    throw new RuntimeErrorException(null, "Could not read image data.");
  }
}

代码示例来源:origin: stackoverflow.com

public void deleteStuffFromDb(){
  ..... usual code..
  if (failedCondition){
     throw new RuntimeErrorException(new Error("Couldn't delete"));
  }
}

代码示例来源:origin: jmacglashan/burlap

@Override
public void setSolver(MDPSolverInterface solver) {
  
  if(!(solver instanceof DeterministicPlanner)){
    throw new RuntimeErrorException(new Error("Planner is not a Deterministic Planner"));
  }
  
  this.dp = (DeterministicPlanner) solver;
  
}

代码示例来源:origin: jmacglashan/burlap

@Override
public void setSolver(MDPSolverInterface solver){
  
  if(!(solver instanceof QProvider)){
    throw new RuntimeErrorException(new Error("Planner is not a QComputablePlanner"));
  }
  
  this.qplanner = (QProvider) solver;
}

代码示例来源:origin: jmacglashan/burlap

@Override
public void setSolver(MDPSolverInterface solver){
  
  if(!(solver instanceof QProvider)){
    throw new RuntimeErrorException(new Error("Planner is not a QComputablePlanner"));
  }
  
  this.qplanner = (QProvider) solver;
}

代码示例来源:origin: jmacglashan/burlap

@Override
public void setSolver(MDPSolverInterface solver){
  
  if(!(solver instanceof QProvider)){
    throw new RuntimeErrorException(new Error("Planner is not a QComputablePlanner"));
  }
  
  this.qplanner = (QProvider) solver;
}

代码示例来源:origin: jmacglashan/burlap

@Override
public void setSolver(MDPSolverInterface solver) {
  if(!(solver instanceof QProvider)){
    throw new RuntimeErrorException(new Error("Planner is not a QComputablePlanner"));
  }
  
  this.qplanner = (QProvider) solver;
  
}

代码示例来源:origin: jmacglashan/burlap

@Override
public void setSolver(MDPSolverInterface solver) {
  
  if(!(solver instanceof DeterministicPlanner)){
    throw new RuntimeErrorException(new Error("Planner is not a Deterministic Planner"));
  }
  
  this.dp = (DeterministicPlanner) solver;
  
}

代码示例来源:origin: org.doctester/doctester-core

@Override
public Response makeRequest(Request httpRequest) {
  Response httpResponse;
  if (Sets.newHashSet(HEAD, GET, DELETE).contains(httpRequest.httpRequestType)) {
    httpResponse = makeHeadGetOrDeleteRequest(httpRequest);
  } else if (Sets.newHashSet(POST, PUT).contains(httpRequest.httpRequestType)) {
    httpResponse = makePostOrPutRequest(httpRequest);
  } else {
    throw new RuntimeErrorException(new Error("Your requested httpRequest.httpRequestType is not supported"));
  }
  return httpResponse;
}

代码示例来源:origin: org.jboss.jbossas/jboss-as-mbeans

private void rethrowAsRuntimeMBeanException(Throwable t)
  {
   if (t instanceof RuntimeException)
     throw new RuntimeMBeanException((RuntimeException) t);
   else if (t instanceof Error)
     throw new RuntimeErrorException((Error) t);
   else
     throw new RuntimeMBeanException(new RuntimeException("Unhandled exception", t));
  }
}

代码示例来源:origin: jmacglashan/burlap

/**
 * Samples the output probability distribution.
 * @return the index of the sampled element
 */
public int sample(){
  
  if(this.needsUpdate){
    this.computeProbs();
  }
  
  double r = this.rand.nextDouble();
  double sum = 0.;
  for(int i = 0; i < this.probs.length; i++){
    sum += this.probs[i];
    if(r < sum){
      return i;
    }
  }
  
  throw new RuntimeErrorException(new Error("Error in sample; Boltzmann distribution did not sum to 1"));
  
}

代码示例来源:origin: org.jboss.mx/jboss-mbeans

private void rethrowAsRuntimeMBeanException(Throwable t)
  {
   if (t instanceof RuntimeException)
     throw new RuntimeMBeanException((RuntimeException) t);
   else if (t instanceof Error)
     throw new RuntimeErrorException((Error) t);
   else
     throw new RuntimeMBeanException(new RuntimeException("Unhandled exception", t));
  }
}

代码示例来源:origin: org.jboss.mx/jboss-mbeans

private void rethrowAsMBeanException(Throwable t) throws MBeanException
{
 if (t instanceof RuntimeException)
   throw new RuntimeMBeanException((RuntimeException) t);
 else if (t instanceof Error)
   throw new RuntimeErrorException((Error) t);
 else
   throw new MBeanException((Exception) t);
}

代码示例来源:origin: org.jboss.jbossas/jboss-as-mbeans

private void rethrowAsMBeanException(Throwable t) throws MBeanException
{
 if (t instanceof RuntimeException)
   throw new RuntimeMBeanException((RuntimeException) t);
 else if (t instanceof Error)
   throw new RuntimeErrorException((Error) t);
 else
   throw new MBeanException((Exception) t);
}

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

protected Object invokeImpl(MBeanMetaData metadata, String method, String[] signature, Object[] args) throws ReflectionException, MBeanException, IllegalArgumentException
{
 Method m = getStandardManagementMethod(metadata, method, signature);
 try
 {
   return m.invoke(metadata.mbean, args);
 }
 catch (IllegalAccessException x)
 {
   throw new ReflectionException(x);
 }
 catch (InvocationTargetException x)
 {
   Throwable t = x.getTargetException();
   if (t instanceof Error) throw new RuntimeErrorException((Error)t);
   if (t instanceof JMRuntimeException) throw (JMRuntimeException)t;
   if (t instanceof RuntimeException) throw new RuntimeMBeanException((RuntimeException)t);
   throw new MBeanException((Exception)t);
 }
}

代码示例来源:origin: jmacglashan/burlap

/**
 * Returns the {@link QLearningStateNode} object stored for the given hashed state. If no {@link QLearningStateNode} object.
 * is stored, then it is created and has its Q-value initialize using this objects {@link burlap.behavior.valuefunction.QFunction} data member.
 * @param s the hashed state for which to get the {@link QLearningStateNode} object
 * @return the {@link QLearningStateNode} object stored for the given hashed state. If no {@link QLearningStateNode} object.
 */
protected QLearningStateNode getStateNode(HashableState s){
  
  QLearningStateNode node = qFunction.get(s);
  
  if(node == null){
    node = new QLearningStateNode(s);
    List<Action> gas = this.applicableActions(s.s());
    if(gas.isEmpty()){
      gas = this.applicableActions(s.s());
      throw new RuntimeErrorException(new Error("No possible actions in this state, cannot continue Q-learning"));
    }
    for(Action ga : gas){
      node.addQValue(ga, qInitFunction.qValue(s.s(), ga));
    }
    
    qFunction.put(s, node);
  }
  
  return node;
  
}

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

public Object getAttribute(MBeanMetaData metadata, String attribute) throws MBeanException, AttributeNotFoundException, ReflectionException
{
 if (metadata.dynamic)
 {
   try
   {
    return ((DynamicMBean)metadata.mbean).getAttribute(attribute);
   }
   catch (JMRuntimeException x)
   {
    throw x;
   }
   catch (RuntimeException x)
   {
    throw new RuntimeMBeanException(x);
   }
   catch (Error x)
   {
    throw new RuntimeErrorException(x);
   }
 }
 else
 {
   return metadata.invoker.getAttribute(metadata, attribute);
 }
}

相关文章

微信公众号

最新文章

更多