Package org.jboss.marshalling

Examples of org.jboss.marshalling.Marshaller.start()


        }
        if (timer.getPrimaryKey() != null) {
            try {
                Marshaller marshaller = factory.createMarshaller(configuration);
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                marshaller.start(new OutputStreamByteOutput(out));
                marshaller.writeObject(timer.getPrimaryKey());
                marshaller.finish();
                marshaller.flush();
                primaryKey = Base64.encodeBytes(out.toByteArray());
            } catch (Exception e) {
View Full Code Here


        String primaryKey = null;
        if (timer.getInfo() != null) {
            try {
                Marshaller marshaller = factory.createMarshaller(configuration);
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                marshaller.start(new OutputStreamByteOutput(out));
                marshaller.writeObject(timer.getInfo());
                marshaller.finish();
                marshaller.flush();
                info = Base64.encodeBytes(out.toByteArray());
            } catch (Exception e) {
View Full Code Here

        }
        if (timer.getPrimaryKey() != null) {
            try {
                Marshaller marshaller = factory.createMarshaller(configuration);
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                marshaller.start(new OutputStreamByteOutput(out));
                marshaller.writeObject(timer.getPrimaryKey());
                marshaller.finish();
                marshaller.flush();
                primaryKey = Base64.encodeBytes(out.toByteArray());
            } catch (Exception e) {
View Full Code Here

                } else if (locator instanceof StatelessEJBLocator) {
                    return beanReferenceFactory.createReference(beanRepositoryIds[0]);
                } else if (locator instanceof StatefulEJBLocator) {
                    final Marshaller marshaller = factory.createMarshaller(configuration);
                    final ByteArrayOutputStream stream = new ByteArrayOutputStream();
                    marshaller.start(new OutputStreamByteOutput(stream));
                    marshaller.writeObject(((StatefulEJBLocator) locator).getSessionId());
                    marshaller.finish();
                    return beanReferenceFactory.createReferenceWithId(stream.toByteArray(), beanRepositoryIds[0]);
                } else if (locator instanceof EntityEJBLocator) {
                    final Marshaller marshaller = factory.createMarshaller(configuration);
View Full Code Here

                    marshaller.finish();
                    return beanReferenceFactory.createReferenceWithId(stream.toByteArray(), beanRepositoryIds[0]);
                } else if (locator instanceof EntityEJBLocator) {
                    final Marshaller marshaller = factory.createMarshaller(configuration);
                    final ByteArrayOutputStream stream = new ByteArrayOutputStream();
                    marshaller.start(new OutputStreamByteOutput(stream));
                    marshaller.writeObject(((EntityEJBLocator) locator).getPrimaryKey());
                    marshaller.finish();
                    return beanReferenceFactory.createReferenceWithId(stream.toByteArray(), beanRepositoryIds[0]);
                }
                throw EjbLogger.ROOT_LOGGER.unknownEJBLocatorType(locator);
View Full Code Here

                for (Map.Entry<String, PersistentSession> sessionEntry : sessionData.entrySet()) {
                    Map<String, byte[]> data = new HashMap<String, byte[]>();
                    for (Map.Entry<String, Object> sessionAttribute : sessionEntry.getValue().getSessionData().entrySet()) {
                        try {
                            final ByteArrayOutputStream out = new ByteArrayOutputStream();
                            marshaller.start(new OutputStreamByteOutput(out));
                            marshaller.writeObject(sessionAttribute.getValue());
                            marshaller.finish();
                            data.put(sessionAttribute.getKey(), out.toByteArray());
                        } catch (Exception e) {
                            UndertowLogger.ROOT_LOGGER.failedToPersistSessionAttribute(sessionAttribute.getKey(), sessionAttribute.getValue(), sessionEntry.getKey(), e);
View Full Code Here

        File file = new File(baseDir, deploymentName);
        FileOutputStream out = new FileOutputStream(file, false);
        try {
            Marshaller marshaller = createMarshaller();
            try {
                marshaller.start(new OutputStreamByteOutput(out));
                marshaller.writeObject(serializedData);
                marshaller.finish();
            } finally {
                marshaller.close();
            }
View Full Code Here

                } else if (locator instanceof StatelessEJBLocator) {
                    return beanReferenceFactory.createReference(beanRepositoryIds[0]);
                } else if (locator instanceof StatefulEJBLocator) {
                    final Marshaller marshaller = factory.createMarshaller(configuration);
                    final ByteArrayOutputStream stream = new ByteArrayOutputStream();
                    marshaller.start(new OutputStreamByteOutput(stream));
                    marshaller.writeObject(((StatefulEJBLocator) locator).getSessionId());
                    marshaller.finish();
                    return beanReferenceFactory.createReferenceWithId(stream.toByteArray(), beanRepositoryIds[0]);
                } else if (locator instanceof EntityEJBLocator) {
                    final Marshaller marshaller = factory.createMarshaller(configuration);
View Full Code Here

                    marshaller.finish();
                    return beanReferenceFactory.createReferenceWithId(stream.toByteArray(), beanRepositoryIds[0]);
                } else if (locator instanceof EntityEJBLocator) {
                    final Marshaller marshaller = factory.createMarshaller(configuration);
                    final ByteArrayOutputStream stream = new ByteArrayOutputStream();
                    marshaller.start(new OutputStreamByteOutput(stream));
                    marshaller.writeObject(((EntityEJBLocator) locator).getPrimaryKey());
                    marshaller.finish();
                    return beanReferenceFactory.createReferenceWithId(stream.toByteArray(), beanRepositoryIds[0]);
                }
                throw new RuntimeException("Unkown locator type " + locator);
View Full Code Here

    protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception {
        Marshaller marshaller = provider.getMarshaller(ctx);
        ChannelBufferByteOutput output = new ChannelBufferByteOutput(
                ctx.getChannel().getConfig().getBufferFactory(), estimatedLength);
        output.getBuffer().writeBytes(LENGTH_PLACEHOLDER);
        marshaller.start(output);
        marshaller.writeObject(msg);
        marshaller.finish();
        marshaller.close();

        ChannelBuffer encoded = output.getBuffer();
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.