Package org.jboss.marshalling

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


                Unmarshaller unmarshaller = context.createUnmarshaller();
                ContextClassLoaderSwitcher.SwitchContext switchContext = switcher.getSwitchContext(context.getClassLoader());
                try {
                    unmarshaller.start(Marshalling.createByteInput(new ByteArrayInputStream(this.bytes)));
                    this.object = (T) unmarshaller.readObject();
                    unmarshaller.finish();
                    this.bytes = null; // Free up memory
                } finally {
                    switchContext.reset();
                    unmarshaller.close();
                }
View Full Code Here


      long tStart = System.nanoTime();
      for (int i = 0; i < NUM_INNER_LOOPS; i++) {
         Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller(configuration);
         unmarshaller.start(Marshalling.createByteInput(bais));
         unmarshaller.readObject();
         unmarshaller.finish();
         bais.close();
         bais.reset();
      }
      result[0] = System.nanoTime() - tStart;
      log.infof("JBoss marshalling read duration     = %d ns", result[0]);
View Full Code Here

      long tStart = System.nanoTime();
      for (int i = 0; i < NUM_INNER_LOOPS; i++) {
         Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller(configuration);
         unmarshaller.start(Marshalling.createByteInput(bais));
         unmarshaller.readObject();
         unmarshaller.finish();
         bais.close();
         bais.reset();
      }
      result[0] = System.nanoTime() - tStart;
      log.infof("JBoss marshalling read duration     = %d ns", result[0]);
View Full Code Here

                // write out the failure
                MethodInvocationMessageHandler.this.writeException(channelAssociation, MethodInvocationMessageHandler.this.marshallerFactory, invocationId, cnfe, null);
                return;
            }
            // done with unmarshalling
            unmarshaller.finish();

            runnable = new Runnable() {

                @Override
                public void run() {
View Full Code Here

                eu.start(Marshalling.createByteInput(es));
                return (List<Pickle>)eu.readObject();
            } catch (ClassNotFoundException e) {
                throw new IOException("Failed to read the stream",e);
            } finally {
                eu.finish();
            }
        } finally {
            closeQuietly(es);
        }
    }
View Full Code Here

        ByteInput input = new ChannelBufferByteInput(frame);

        try {
            unmarshaller.start(input);
            Object obj = unmarshaller.readObject();
            unmarshaller.finish();
            return obj;
        } finally {
            // Call close in a finally block as the ReplayingDecoder will throw an Error if not
            // enough bytes are readable. This helps to be sure that we do not leak resource
            unmarshaller.close();
View Full Code Here

            input = new LimitingByteInput(input, maxObjectSize);
        }
        try {
            unmarshaller.start(input);
            Object obj = unmarshaller.readObject();
            unmarshaller.finish();
            return obj;
        } catch (LimitingByteInput.TooBigObjectException e) {
            discardingTooLongFrame = true;
            throw new TooLongFrameException();
        } finally {
View Full Code Here

            for(int i = 0; i < count; i++) {
                expectHeader(unmarshaller, ServerManagerProtocol.PARAM_HOST_MODEL_UPDATE);
                final AbstractHostModelUpdate<?> update = unmarshal(unmarshaller, AbstractHostModelUpdate.class);
                updates.add(update);
            }
            unmarshaller.finish();
            log.infof("Received host model updates %s", updates);
        }

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
View Full Code Here

            expectHeader(unmarshaller, ServerManagerProtocol.PARAM_SERVER_NAME);
            serverName = unmarshaller.readUTF();
            if (expectGracefulTimeout) {
                expectHeader(unmarshaller, ServerManagerProtocol.PARAM_GRACEFUL_TIMEOUT);
            }
            unmarshaller.finish();
        }

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
            ServerStatus serverStatus = processChange(serverName, gracefulTimeout);
View Full Code Here

        protected final void readRequest(final InputStream input) throws IOException {
            final Unmarshaller unmarshaller = getUnmarshaller();
            unmarshaller.start(createByteInput(input));
            expectHeader(unmarshaller, ServerManagerProtocol.PARAM_SERVER_NAME);
            serverName = unmarshaller.readUTF();
            unmarshaller.finish();
        }

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
            ServerModel serverModel = serverManager.getServerModel(serverName);
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.