Search in sources :

Example 21 with OpenwireException

use of io.fabric8.gateway.handlers.detecting.protocol.openwire.support.OpenwireException in project fabric8 by jboss-fuse.

the class BaseDataStreamMarshaller method createThrowable.

private Throwable createThrowable(UTF8Buffer className, UTF8Buffer message) {
    try {
        Class clazz = Class.forName(className.toString(), false, BaseDataStreamMarshaller.class.getClassLoader());
        Constructor constructor = clazz.getConstructor(new Class[] { UTF8Buffer.class });
        return (Throwable) constructor.newInstance(new Object[] { message.toString() });
    } catch (Throwable e) {
        return new OpenwireException(message.toString(), className.toString());
    }
}
Also used : OpenwireException(io.fabric8.gateway.handlers.detecting.protocol.openwire.OpenwireException) Constructor(java.lang.reflect.Constructor)

Aggregations

OpenwireException (io.fabric8.gateway.handlers.detecting.protocol.openwire.support.OpenwireException)18 OpenwireException (io.fabric8.gateway.handlers.detecting.protocol.openwire.OpenwireException)3 InflaterInputStream (java.util.zip.InflaterInputStream)3 Buffer (org.fusesource.hawtbuf.Buffer)3 ByteArrayInputStream (org.fusesource.hawtbuf.ByteArrayInputStream)3 IOException (java.io.IOException)2 UTF8Buffer (org.fusesource.hawtbuf.UTF8Buffer)2 Constructor (java.lang.reflect.Constructor)1 URL (java.net.URL)1 Deflater (java.util.zip.Deflater)1 DeflaterOutputStream (java.util.zip.DeflaterOutputStream)1 ByteArrayOutputStream (org.fusesource.hawtbuf.ByteArrayOutputStream)1