Package org.jboss.marshalling

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


                } 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);
            } else {
                throw new IllegalArgumentException("Provided locator " + locator + " was not for EJB " + ejbComponent);
View Full Code Here


        ByteArrayOutputStream out = new ByteArrayOutputStream();
        try {
            final Marshaller marshaller = factory.createMarshaller(configuration);
            marshaller.start(new OutputStreamByteOutput(out));
            marshaller.writeObject(serializable);
            marshaller.finish();
            out.flush();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return Base64.encodeBytes(out.toByteArray());
View Full Code Here

            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) {
                EjbLogger.ROOT_LOGGER.failedToPersistTimer(timer, e);
                return;
View Full Code Here

            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) {
                EjbLogger.ROOT_LOGGER.failedToPersistTimer(timer, e);
                return;
View Full Code Here

            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) {
                EjbLogger.ROOT_LOGGER.failedToPersistTimer(timer, e);
                return;
View Full Code Here

            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) {
                EjbLogger.ROOT_LOGGER.failedToPersistTimer(timer, e);
                return;
View Full Code Here

                } 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);
                    final ByteArrayOutputStream stream = new ByteArrayOutputStream();
                    marshaller.start(new OutputStreamByteOutput(stream));
View Full Code Here

                } 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);
            } else {
                throw EjbLogger.ROOT_LOGGER.incorrectEJBLocatorForBean(locator, ejbComponent.getComponentName());
View Full Code Here

            final Marshaller marshaller = this.prepareForMarshalling(marshallerFactory, outputStream);
            marshaller.writeObject(t);
            // write the attachments
            this.writeAttachments(marshaller, attachments);
            // finish marshalling
            marshaller.finish();
        } finally {
            channelAssociation.releaseChannelMessageOutputStream(messageOutputStream);
            outputStream.close();
        }
    }
View Full Code Here

                    final Marshaller marshaller = TransactionRecoverMessageHandler.this.prepareForMarshalling(marshallerFactory, dataOutputStream);
                    for (int i = 0; i < xids.length; i++) {
                        marshaller.writeObject(new XidTransactionID(xids[i]));
                    }
                    // finish marshalling
                    marshaller.finish();
                }
            } finally {
                channelAssociation.releaseChannelMessageOutputStream(messageOutputStream);
                dataOutputStream.close();
            }
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.