Example usage for javax.xml.bind JAXBException getClass

List of usage examples for javax.xml.bind JAXBException getClass

Introduction

In this page you can find the example usage for javax.xml.bind JAXBException getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:net.emotivecloud.scheduler.drp4ost.DRP4OST.java

private OVFWrapper parse(String ovfXml) {
    OVFWrapper rv = null;/* w  ww  .  j a  va2 s  .  com*/
    StringBuilder cause = new StringBuilder();

    try {
        rv = OVFWrapperFactory.parse(ovfXml);
    } catch (JAXBException e) {
        if (e instanceof PropertyException) {
            cause.append("Access to property failed: " + e.getErrorCode());
        } else if (e instanceof MarshalException) {
            cause.append("Marshalling failed: " + e.getLocalizedMessage());
        } else if (e instanceof UnmarshalException) {
            cause.append("Unmarshalling failed: " + e.getCause());
        } else if (e instanceof ValidationException) {
            cause.append("XML Validation failed: " + e.getErrorCode());
        } else {
            cause.append("Unespected " + e.getErrorCode());
            cause.append(e.getClass().getName());
            cause.append(": ");
        }

        cause.append(e.getMessage());

        throw new DRPOSTException(cause.toString(), e, StatusCodes.XML_PROBLEM);
    } catch (OVFException e) {
        cause.append("Problems parsing OVF file: ");
        cause.append(e.getMessage());

        throw new DRPOSTException(cause.toString(), e, StatusCodes.XML_PROBLEM);
    }
    return rv;
}

From source file:net.emotivecloud.scheduler.drp4one.DRP4OVF.java

private OCAComputeWrapper parseOcaCompute(String s) {
    OCAComputeWrapper rv = null;//from  w w  w  .  j  a v a  2  s . c o m
    StringBuilder cause = new StringBuilder();
    try {
        rv = OCAComputeWrapperFactory.parse(s);
    } catch (SAXException se) {
        throw new DRPOneException("XML Parsing error", se, StatusCodes.INTERNAL);
    } catch (JAXBException e) {
        if (e instanceof PropertyException) {
            cause.append("Access to property failed: " + e.getErrorCode());
        } else if (e instanceof MarshalException) {
            cause.append("Marshalling failed: " + e.getLocalizedMessage());
        } else if (e instanceof UnmarshalException) {
            cause.append("Unmarshalling failed: " + e.getCause());
        } else if (e instanceof ValidationException) {
            cause.append("XML Validation failed: " + e.getErrorCode());
        } else {
            cause.append("Unespected " + e.getErrorCode());
            cause.append(e.getClass().getName());
            cause.append(": ");
        }
        cause.append(e.getMessage());
        log.error(cause.toString());
        if (log.isTraceEnabled()) {
            log.trace(cause, e);
        }
        throw new DRPOneException(cause.toString(), e, StatusCodes.ONE_FAILURE);
    }
    return rv;
}

From source file:net.emotivecloud.scheduler.drp4one.DRP4OVF.java

private OCAComputeListWrapper parseOcaComputeList(String s) {
    OCAComputeListWrapper rv = null;//from ww  w.  ja va2  s  .c o m
    StringBuilder cause = new StringBuilder();
    try {
        rv = OCAComputeListWrapperFactory.parseList(s);
    } catch (SAXException se) {
        throw new DRPOneException("XML Parsing error", se, StatusCodes.INTERNAL);
    } catch (JAXBException e) {
        if (e instanceof PropertyException) {
            cause.append("Access to property failed: " + e.getErrorCode());
        } else if (e instanceof MarshalException) {
            cause.append("Marshalling failed: " + e.getLocalizedMessage());
        } else if (e instanceof UnmarshalException) {
            cause.append("Unmarshalling failed: " + e.getCause());
        } else if (e instanceof ValidationException) {
            cause.append("XML Validation failed: " + e.getErrorCode());
        } else {
            cause.append("Unespected " + e.getErrorCode());
            cause.append(e.getClass().getName());
            cause.append(": ");
        }
        cause.append(e.getMessage());
        log.error(cause.toString());
        if (log.isTraceEnabled()) {
            log.trace(cause, e);
        }
        throw new DRPOneException(cause.toString(), e, StatusCodes.ONE_FAILURE);
    }
    return rv;

}

From source file:net.emotivecloud.scheduler.drp4one.DRP4OVF.java

private OVFWrapper parse(String ovfXml) throws DRPOneException {
    OVFWrapper rv = null;/*from  w ww.  j  a  va 2 s  .c o m*/
    StringBuilder cause = new StringBuilder();

    try {
        rv = OVFWrapperFactory.parse(ovfXml);
    } catch (JAXBException e) {
        if (e instanceof PropertyException) {
            cause.append("Access to property failed: " + e.getErrorCode());
        } else if (e instanceof MarshalException) {
            cause.append("Marshalling failed: " + e.getLocalizedMessage());
        } else if (e instanceof UnmarshalException) {
            cause.append("Unmarshalling failed: " + e.getCause());
        } else if (e instanceof ValidationException) {
            cause.append("XML Validation failed: " + e.getErrorCode());
        } else {
            cause.append("Unespected " + e.getErrorCode());
            cause.append(e.getClass().getName());
            cause.append(": ");
        }

        cause.append(e.getMessage());
        log.error(cause.toString());
        if (log.isTraceEnabled()) {
            log.trace(cause, e);
        }
        throw new DRPOneException(cause.toString(), e, StatusCodes.XML_PROBLEM);
    } catch (OVFException e) {
        cause.append("Problems parsing OVF file: ");
        cause.append(e.getMessage());
        log.error(cause.toString());
        if (log.isTraceEnabled()) {
            log.trace(cause, e);
        }
        throw new DRPOneException(cause.toString(), e, StatusCodes.XML_PROBLEM);
    }
    return rv;
}