Package org.jboss.marshalling

Examples of org.jboss.marshalling.Unmarshaller.finish()


        bytes = baos.toByteArray();
        byteInput = Marshalling.createByteInput(new ByteArrayInputStream(bytes));
        unmarshaller.start(byteInput);
        System.out.println("Unmarshaller = " + unmarshaller + " (version set to " + configuration.getVersion() + ")");
        assertEquals(t, unmarshaller.readObject());
        unmarshaller.finish();
    }

    static class TestStreamHeader implements StreamHeader {

        private byte B1 = (byte) 12;
View Full Code Here


        byte[] bytes = baos.toByteArray();
        ByteInput byteInput = Marshalling.createByteInput(new ByteArrayInputStream(bytes));
        Unmarshaller unmarshaller = testUnmarshallerProvider.create(configuration.clone(), byteInput);
        System.out.println("Unmarshaller = " + unmarshaller + " (version set to " + configuration.getVersion() + ")");
        assertEquals(serializable, unmarshaller.readObject());
        unmarshaller.finish();
        assertEOF(unmarshaller);
        assertTrue(streamHeader.ok());
    }

    public static class TestObjectResolver implements ObjectResolver {
View Full Code Here

        marshaller.finish();
        final byte[] bytes = baos.toByteArray();
        final Unmarshaller unmarshaller = factory.createUnmarshaller(configuration);
        unmarshaller.start(Marshalling.createByteInput(new ByteArrayInputStream(bytes)));
        runRead(unmarshaller);
        unmarshaller.finish();
    }

    public void configure(MarshallingConfiguration configuration) throws Throwable {}

    public void runWrite(Marshaller marshaller) throws Throwable {};
View Full Code Here

        final ByteInput byteInput = Marshalling.createByteInput(new ByteArrayInputStream(bytes));
        System.out.println("Write Configuration = " + writeConfiguration);
        final Unmarshaller unmarshaller = testUnmarshallerProvider.create(writeConfiguration, byteInput);
        System.out.println("Unmarshaller = " + unmarshaller + " (version set to " + writeConfiguration.getVersion() + ")");
        readWriteTest.runRead(unmarshaller);
        unmarshaller.finish();
    }
}
View Full Code Here

            configuration.setClassResolver(new SimpleClassResolver(DomainServerMain.class.getClassLoader()));
            unmarshaller = factory.createUnmarshaller(configuration);
            byteInput = Marshalling.createByteInput(initialInput);
            unmarshaller.start(byteInput);
            final ServerTask task = unmarshaller.readObject(ServerTask.class);
            unmarshaller.finish();
            containerFuture = task.run(Arrays.<ServiceActivator>asList(new ServiceActivator() {
                @Override
                public void activate(final ServiceActivatorContext serviceActivatorContext) {
                    // TODO activate host controller client service
                }
View Full Code Here

        try {
            final byte[] idData = poaCurrent.get_object_id();
            final Unmarshaller unmarshaller = factory.createUnmarshaller(configuration);
            unmarshaller.start(new InputStreamByteInput(new ByteArrayInputStream(idData)));
            id = unmarshaller.readObject();
            unmarshaller.finish();
        } catch (NoContext noContext) {
            throw new RuntimeException(noContext);
        }
        return id;
    }
View Full Code Here

                MarshallingConfiguration config = this.passivationManager.getMarshallingConfiguration(version);
                Unmarshaller unmarshaller = this.marshallerFactory.createUnmarshaller(config);
                unmarshaller.start(input);
                try {
                    V value = (V) unmarshaller.readObject();
                    unmarshaller.finish();
                    return value;
                } finally {
                    unmarshaller.close();
                }
            } finally {
View Full Code Here

            configuration.setClassResolver(new SimpleClassResolver(DomainServerMain.class.getClassLoader()));
            unmarshaller = factory.createUnmarshaller(configuration);
            byteInput = Marshalling.createByteInput(initialInput);
            unmarshaller.start(byteInput);
            final ServerTask task = unmarshaller.readObject(ServerTask.class);
            unmarshaller.finish();
            containerFuture = task.run(Arrays.<ServiceActivator>asList(new ServiceActivator() {
                @Override
                public void activate(final ServiceActivatorContext serviceActivatorContext) {
                    // TODO activate host controller client service
                }
View Full Code Here

                    } finally {
                        if (contextLoader != null) {
                            setCurrentThreadContextClassLoader(currentLoader);
                        }
                    }
                    unmarshaller.finish();
                    this.bytes = null; // Free up memory
                } finally {
                    unmarshaller.close();
                }
            }
View Full Code Here

        final Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller(configuration);
        final ByteArrayInputStream is = new ByteArrayInputStream(bytes);
        try {
            unmarshaller.start(Marshalling.createByteInput(is));
            Object result = unmarshaller.readObject();
            unmarshaller.finish();
            is.close();
            return result;
        } finally {
            // clean up stream resource
            try {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.