Example usage for javax.management RuntimeOperationsException RuntimeOperationsException

List of usage examples for javax.management RuntimeOperationsException RuntimeOperationsException

Introduction

In this page you can find the example usage for javax.management RuntimeOperationsException RuntimeOperationsException.

Prototype

public RuntimeOperationsException(java.lang.RuntimeException e) 

Source Link

Document

Creates a RuntimeOperationsException that wraps the actual java.lang.RuntimeException.

Usage

From source file:com.cyberway.issue.crawler.admin.CrawlJob.java

public void setAttribute(Attribute attribute) throws AttributeNotFoundException {
    // Is it a crawl order attribute?
    CrawlOrder order = this.getController().getOrder();
    String attName = attribute.getName();
    if (attName.startsWith(order.getAbsoluteName())) {
        try {// w  ww .j a  v a 2s  .  co  m
            setCrawlOrderAttribute(attribute.getName().substring(order.getAbsoluteName().length()), order,
                    attribute);
        } catch (NullPointerException e) {
            logger.log(Level.SEVERE, "Failed set of " + attName, e);
        } catch (AttributeNotFoundException e) {
            logger.log(Level.SEVERE, "Failed set of " + attName, e);
        } catch (MBeanException e) {
            logger.log(Level.SEVERE, "Failed set of " + attName, e);
        } catch (ReflectionException e) {
            logger.log(Level.SEVERE, "Failed set of " + attName, e);
        } catch (InvalidAttributeValueException e) {
            logger.log(Level.SEVERE, "Failed set of " + attName, e);
        }
        return;
    }

    // Is it a bdbje attribute?
    if (this.bdbjeAttributeNameList.contains(attName)) {
        try {
            this.bdbjeMBeanHelper.setAttribute(this.controller.getBdbEnvironment(), attribute);
        } catch (AttributeNotFoundException e) {
            throw new RuntimeOperationsException(new RuntimeException(e));
        } catch (InvalidAttributeValueException e) {
            throw new RuntimeOperationsException(new RuntimeException(e));
        }
        return;
    }

    // Else, we don't know how to handle this attribute.
    throw new AttributeNotFoundException("Attribute " + attName + " can not be set.");
}

From source file:org.archive.crawler.admin.CrawlJob.java

protected void setAttributeInternal(Attribute attribute) throws AttributeNotFoundException {
    // Is it a crawl order attribute?
    CrawlOrder order = this.getController().getOrder();
    String attName = attribute.getName();
    if (attName.startsWith(order.getAbsoluteName())) {
        try {/* w w w  .  j  a  v a  2s.  c o  m*/
            setCrawlOrderAttribute(attribute.getName().substring(order.getAbsoluteName().length()), order,
                    attribute);
        } catch (NullPointerException e) {
            logger.log(Level.SEVERE, "Failed set of " + attName, e);
        } catch (AttributeNotFoundException e) {
            logger.log(Level.SEVERE, "Failed set of " + attName, e);
        } catch (MBeanException e) {
            logger.log(Level.SEVERE, "Failed set of " + attName, e);
        } catch (ReflectionException e) {
            logger.log(Level.SEVERE, "Failed set of " + attName, e);
        } catch (InvalidAttributeValueException e) {
            logger.log(Level.SEVERE, "Failed set of " + attName, e);
        }
        return;
    }

    // Is it a bdbje attribute?
    if (this.bdbjeAttributeNameList.contains(attName)) {
        try {
            this.bdbjeMBeanHelper.setAttribute(this.controller.getBdbEnvironment(), attribute);
        } catch (AttributeNotFoundException e) {
            throw new RuntimeOperationsException(new RuntimeException(e));
        } catch (InvalidAttributeValueException e) {
            throw new RuntimeOperationsException(new RuntimeException(e));
        }
        return;
    }

    // Else, we don't know how to handle this attribute.
    throw new AttributeNotFoundException("Attribute " + attName + " can not be set.");
}