Package org.apache.activemq.util

Examples of org.apache.activemq.util.ClassLoadingAwareObjectInputStream


                InputStream is = new ByteArrayInputStream(content);
                if (isCompressed()) {
                    is = new InflaterInputStream(is);
                }
                DataInputStream dataIn = new DataInputStream(is);
                ClassLoadingAwareObjectInputStream objIn = new ClassLoadingAwareObjectInputStream(dataIn);
                try {
                    object = (Serializable)objIn.readObject();
                } catch (ClassNotFoundException ce) {
                    throw new IOException(ce.getMessage());
                }
                dataIn.close();
            } catch (IOException e) {
View Full Code Here


        byte[] serializedProxy = baos.toByteArray();
        oos.close();
        baos.close();

        // deserialize the proxy
        ClassLoadingAwareObjectInputStream claois =
            new ClassLoadingAwareObjectInputStream(new ByteArrayInputStream(serializedProxy));

        // this is where it fails due to the rudimentary classloader selection
        // in ClassLoadingAwareObjectInputStream
        List deserializedProxy = (List) claois.readObject();

        // assert the invocation worked
        Assert.assertEquals("foo", deserializedProxy.get(0));
    }
View Full Code Here

                InputStream is = new ByteArrayInputStream(content);
                if (isCompressed()) {
                    is = new InflaterInputStream(is);
                }
                DataInputStream dataIn = new DataInputStream(is);
                ClassLoadingAwareObjectInputStream objIn = new ClassLoadingAwareObjectInputStream(dataIn);
                try {
                    object = (Serializable)objIn.readObject();
                } catch (ClassNotFoundException ce) {
                    throw JMSExceptionSupport.create("Failed to build body from content. Serializable class not available to broker. Reason: " + ce, ce);
                } finally {
                    dataIn.close();
                }
View Full Code Here

                InputStream is = new ByteArrayInputStream(content);
                if (isCompressed()) {
                    is = new InflaterInputStream(is);
                }
                DataInputStream dataIn = new DataInputStream(is);
                ClassLoadingAwareObjectInputStream objIn = new ClassLoadingAwareObjectInputStream(dataIn);
                try {
                    object = (Serializable)objIn.readObject();
                } catch (ClassNotFoundException ce) {
                    throw JMSExceptionSupport.create("Failed to build body from content. Serializable class not available to broker. Reason: " + ce, ce);
                } finally {
                    dataIn.close();
                }
View Full Code Here

                InputStream is = new ByteArrayInputStream(content);
                if( isCompressed() ) {
                    is = new InflaterInputStream(is);
                }
                DataInputStream dataIn = new DataInputStream(is);
                ClassLoadingAwareObjectInputStream objIn = new ClassLoadingAwareObjectInputStream(dataIn);
                try {
                    object = (Serializable) objIn.readObject();
                } catch (ClassNotFoundException ce) {
                    throw new IOException(ce.getMessage());
                }
                dataIn.close();
            } catch (IOException e) {
View Full Code Here

        out.reset();
    }

    public Object unmarshal(DataInput ds) throws IOException {
        try {
            ClassLoadingAwareObjectInputStream in = new ClassLoadingAwareObjectInputStream((InputStream)ds);
            Object command;
            command = in.readObject();
            in.close();
            return command;
        } catch (ClassNotFoundException e) {
            throw (IOException)new IOException("unmarshal failed: "+e).initCause(e);
        }
    }
View Full Code Here

        byte[] serializedProxy = baos.toByteArray();
        oos.close();
        baos.close();

        // deserialize the proxy
        ClassLoadingAwareObjectInputStream claois =
            new ClassLoadingAwareObjectInputStream(new ByteArrayInputStream(serializedProxy));

        // this is where it fails due to the rudimentary classloader selection
        // in ClassLoadingAwareObjectInputStream
        List deserializedProxy = (List) claois.readObject();

        claois.close();

        // assert the invocation worked
        assertEquals("foo", deserializedProxy.get(0));
    }
View Full Code Here

                InputStream is = new ByteArrayInputStream(content);
                if (isCompressed()) {
                    is = new InflaterInputStream(is);
                }
                DataInputStream dataIn = new DataInputStream(is);
                ClassLoadingAwareObjectInputStream objIn = new ClassLoadingAwareObjectInputStream(dataIn);
                try {
                    object = (Serializable)objIn.readObject();
                } catch (ClassNotFoundException ce) {
                    throw JMSExceptionSupport.create("Failed to build body from content. Serializable class not available to broker. Reason: " + ce, ce);
                } finally {
                    dataIn.close();
                }
View Full Code Here

        out.reset();
    }

    public Object unmarshal(DataInput ds) throws IOException {
        try {
            ClassLoadingAwareObjectInputStream in = new ClassLoadingAwareObjectInputStream((InputStream)ds);
            Object command;
            command = in.readObject();
            in.close();
            return command;
        } catch (ClassNotFoundException e) {
            throw (IOException)new IOException("unmarshal failed: " + e).initCause(e);
        }
    }
View Full Code Here

        out.reset();
    }

    public Object unmarshal(DataInput ds) throws IOException {
        try {
            ClassLoadingAwareObjectInputStream in = new ClassLoadingAwareObjectInputStream((InputStream)ds);
            Object command;
            command = in.readObject();
            in.close();
            return command;
        } catch (ClassNotFoundException e) {
            throw (IOException)new IOException("unmarshal failed: " + e).initCause(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.util.ClassLoadingAwareObjectInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.