Package org.jboss.marshalling

Examples of org.jboss.marshalling.Marshaller


        this.provider = provider;
    }

    @Override
    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();
        encoded.setInt(0, encoded.writerIndex() - 4);

        return encoded;
View Full Code Here


        this.factory = factory;
        this.config = config;
    }

    public Marshaller getMarshaller(ChannelHandlerContext ctx) throws Exception {
        Marshaller marshaller = marshallers.get();
        if (marshaller == null) {
            marshaller = factory.createMarshaller(config);
            marshallers.set(marshaller);
        }
        return marshaller;
View Full Code Here

        this.provider = provider;
    }

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

        return output.getBuffer();
    }
View Full Code Here

            return ServerManagerProtocol.GET_HOST_MODEL_RESPONSE;
        }

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            marshaller.writeObject(serverManager.getModelManager().getHostModel());
            marshaller.finish();
        }
View Full Code Here

            return ServerManagerProtocol.GET_SERVER_LIST_RESPONSE;
        }

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            Map<ServerIdentity, ServerStatus> serverStatuses = serverManager.getServerStatuses();

            marshaller.writeByte(ServerManagerProtocol.RETURN_SERVER_COUNT);
            marshaller.writeInt(serverStatuses.size());
            for (Map.Entry<ServerIdentity, ServerStatus> entry : serverStatuses.entrySet()) {
                marshaller.writeByte(ServerManagerProtocol.RETURN_SERVER_NAME);
                marshaller.writeUTF(entry.getKey().getServerName());
                marshaller.writeByte(ServerManagerProtocol.RETURN_SERVER_GROUP_NAME);
                marshaller.writeUTF(entry.getKey().getServerGroupName());
                marshaller.writeByte(ServerManagerProtocol.RETURN_SERVER_STATUS);
                marshaller.writeObject(entry.getValue());
            }

            marshaller.finish();
        }
View Full Code Here

        }

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

        }

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
            ServerModel serverModel = serverManager.getServerModel(serverName);
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            marshaller.writeByte(ServerManagerProtocol.RETURN_SERVER_MODEL);
            marshaller.writeObject(serverModel);
            marshaller.finish();
        }
View Full Code Here

        }

        @Override
        protected void sendResponse(final OutputStream output) throws IOException {
            List<UpdateResultHandlerResponse<?>> responses = serverManager.applyServerUpdates(serverName, updates, allowOverallRollback);
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            marshaller.writeByte(ServerManagerProtocol.PARAM_MODEL_UPDATE_RESPONSE_COUNT);
            marshaller.writeInt(responses.size());
            for(UpdateResultHandlerResponse<?> response : responses) {
                marshaller.writeByte(ServerManagerProtocol.PARAM_MODEL_UPDATE_RESPONSE);
                marshaller.writeObject(response);
            }
            marshaller.finish();
        }
View Full Code Here

        }

        /** {@inheritDoc} */
        @Override
        protected void sendRequest(int protocolVersion, OutputStream output) throws IOException {
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            marshaller.writeByte(StandaloneClientProtocol.PARAM_APPLY_UPDATES_RESULT_COUNT);
            marshaller.writeInt(updates.size());
            for (AbstractServerModelUpdate<?> update : updates) {
                marshaller.writeByte(StandaloneClientProtocol.PARAM_SERVER_MODEL_UPDATE);
                marshaller.writeObject(update);
            }
            marshaller.finish();
        }
View Full Code Here

        }

        /** {@inheritDoc} */
        @Override
        protected void sendRequest(final int protocolVersion, final OutputStream output) throws IOException {
            final Marshaller marshaller = getMarshaller();
            marshaller.start(createByteOutput(output));
            marshaller.writeByte(StandaloneClientProtocol.PARAM_DEPLOYMENT_PLAN);
            marshaller.writeObject(deploymentPlan);
            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.