Package org.jboss.marshalling

Examples of org.jboss.marshalling.Marshaller


        final File file = fileName(entity.getTimedObjectId(), entity.getId());

        FileOutputStream fileOutputStream = null;
        try {
            fileOutputStream = new FileOutputStream(file, false);
            final Marshaller marshaller = factory.createMarshaller(configuration);
            marshaller.start(new OutputStreamByteOutput(fileOutputStream));
            marshaller.writeObject(entity);
            marshaller.finish();
            fileOutputStream.flush();
            fileOutputStream.getFD().sync();
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
View Full Code Here


      MarshallerFactory marshallerFactory = Marshalling.getProvidedMarshallerFactory("river");

      ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
      long tStart = System.nanoTime();
      for (int i = 0; i < NUM_INNER_LOOPS; i++) {
         Marshaller marshaller = marshallerFactory.createMarshaller(configuration);
         marshaller.start(Marshalling.createByteOutput(out));
         marshaller.writeObject(user);
         marshaller.finish();
         out.close();
         if (i != NUM_INNER_LOOPS - 1) {
            out.reset();
         }
      }
View Full Code Here

        }

        @Override
        protected void sendResponse(final OutputStream outputStream) throws IOException {
            ServerStatus status = processChange(serverManagerName, serverName, gracefulTimeout);
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(outputStream));
            marshaller.writeByte(DomainClientProtocol.RETURN_SERVER_STATUS);
            marshaller.writeObject(status);
            marshaller.finish();
        }
View Full Code Here

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {

            List<DomainUpdateResult<?>> responses = domainController.applyUpdates(updates);

            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            marshaller.writeByte(DomainClientProtocol.RETURN_APPLY_UPDATES_RESULT_COUNT);
            marshaller.writeInt(responses.size());
            for (DomainUpdateResult<?> response : responses) {
                marshaller.writeByte(DomainClientProtocol.RETURN_APPLY_UPDATE);
                marshaller.writeObject(response);
            }
            marshaller.finish();
        }
View Full Code Here

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
            List<HostUpdateResult<?>> responses = domainController.applyHostUpdates(serverManagerName, updates);

            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            marshaller.writeByte(DomainClientProtocol.RETURN_APPLY_UPDATES_RESULT_COUNT);
            marshaller.writeInt(responses.size());
            for (HostUpdateResult<?> response : responses) {
                marshaller.writeByte(DomainClientProtocol.RETURN_APPLY_HOST_UPDATE);
                marshaller.writeObject(response);
            }
            marshaller.finish();
        }
View Full Code Here

        }

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
            DomainUpdateApplierResponse response = processUpdate();
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            marshaller.writeByte(DomainClientProtocol.RETURN_APPLY_UPDATE);
            marshaller.writeObject(response);
            marshaller.finish();
        }
View Full Code Here

        }

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
            UpdateResultHandlerResponse<?> response = processUpdate();
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            marshaller.writeByte(DomainClientProtocol.RETURN_APPLY_SERVER_MODEL_UPDATE);
            marshaller.writeObject(response);
            marshaller.finish();
        }
View Full Code Here

            unmarshaller.finish();
        }

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));

            BlockingQueue<List<StreamedResponse>> responseQueue = new LinkedBlockingQueue<List<StreamedResponse>>();
            domainController.executeDeploymentPlan(deploymentPlan, responseQueue);
            StreamedResponse rsp;
            do {
                rsp = null;
                List<StreamedResponse> rspList;
                try {
                    rspList = responseQueue.take();
                }
                catch (InterruptedException ie) {
                    Thread.currentThread().interrupt();
                    throw new IOException("Interrupted while reading deployment plan execution responses", ie);
                }
                for (StreamedResponse item : rspList) {
                    rsp = item;
                    marshaller.writeByte(rsp.getProtocolValue());
                    log.tracef("Marshalling StreamedResponse %s", rsp.getProtocolValue());
                    if (rsp.getValue() != null) {
                        marshaller.writeObject(rsp.getValue());
                    }
                }
            }
            while (rsp != null && !rsp.isLastInStream());

            marshaller.finish();
        }
View Full Code Here

            }
        }

        @Override
        protected final void sendResponse(final OutputStream output) throws IOException {
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            marshaller.writeByte(DomainControllerProtocol.PARAM_DOMAIN_MODEL);
            marshaller.writeObject(domainController.getDomainModel());
            marshaller.finish();
        }
View Full Code Here

            return DomainClientProtocol.GET_DOMAIN_RESPONSE;
        }

        @Override
        protected void sendResponse(final OutputStream outputStream) throws IOException {
                final Marshaller marshaller = getMarshaller();
                marshaller.start(createByteOutput(outputStream));
                marshaller.writeByte(DomainClientProtocol.RETURN_DOMAIN_MODEL);
                marshaller.writeObject(domainController.getDomainModel());
                marshaller.finish();
        }
View Full Code Here

TOP

Related Classes of org.jboss.marshalling.Marshaller

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.