Package org.jboss.marshalling

Examples of org.jboss.marshalling.SimpleDataInput


*/
public class SimpleByteDataInput extends InputStream implements ByteDataInput {
    private final SimpleDataInput input;

    public SimpleByteDataInput(final InputStream inputStream) {
        this.input = new SimpleDataInput(Marshalling.createByteInput(inputStream));
    }
View Full Code Here


    @Override
    public void handleMessage(final Channel channel, final MessageInputStream message) {
        try {
            ROOT_LOGGER.tracef("%s handling incoming data", this);
            final DataInput input = new SimpleDataInput(Marshalling.createByteInput(message));
            final ManagementProtocolHeader header = ManagementProtocolHeader.parse(input);
            final byte type = header.getType();
            if(type == ManagementProtocol.TYPE_PING) {
                // Handle legacy ping/pong directly
                ROOT_LOGGER.tracef("Received ping on %s", this);
View Full Code Here

        log.tracef("Loading state from %s", file);
        try {
            FileInputStream inputStream = null;
            try {
                inputStream = FISAction.open(file);
                SimpleDataInput input = new SimpleDataInput(Marshalling.createByteInput(inputStream));
                int version = input.readInt();
                MarshallingConfiguration config = this.passivationManager.getMarshallingConfiguration(version);
                Unmarshaller unmarshaller = this.marshallerFactory.createUnmarshaller(config);
                unmarshaller.start(input);
                try {
                    V value = (V) unmarshaller.readObject();
View Full Code Here

        if (this.object == null) {
            this.context = context;
            if (this.bytes != null) {
                ByteArrayInputStream input = new ByteArrayInputStream(this.bytes);
                ClassLoader loader = setThreadContextClassLoader(this.context.getClassLoader());
                try (SimpleDataInput data = new SimpleDataInput(Marshalling.createByteInput(input))) {
                    int version = data.readInt();
                    try (Unmarshaller unmarshaller = context.createUnmarshaller(version)) {
                        unmarshaller.start(data);
                        this.object = (T) unmarshaller.readObject();
                        unmarshaller.finish();
                        this.bytes = null; // Free up memory
View Full Code Here

    }

    @Override
    protected void doHandle(final MessageInputStream message) {
        log.tracef("%s handling incoming data", this);
        final SimpleDataInput input = new SimpleDataInput(Marshalling.createByteInput(message));
        Exception error = null;
        ManagementRequestHeader requestHeader = null;
        ManagementRequestHandler requestHandler = null;
        boolean wasPing = false;
        try {
            ManagementProtocolHeader header;
            header = ManagementProtocolHeader.parse(input);

            switch (header.getType()) {
            case ManagementProtocol.TYPE_REQUEST:
                requestHeader = (ManagementRequestHeader)header;
                requestHandler = requestReceiver.readRequest(requestHeader, input);
                break;
            case ManagementProtocol.TYPE_RESPONSE:
                gotIncomingResponse();
                responseReceiver.handleResponse((ManagementResponseHeader)header, input);
                break;
            case ManagementProtocol.TYPE_BYE_BYE:
                log.tracef("Received bye bye on %s, closing", this);
                close();
                break;
            case ManagementProtocol.TYPE_PING:
                wasPing = true;
                log.tracef("Received ping on %s", this);
                break;
            case ManagementProtocol.TYPE_PONG:
                log.tracef("Received pong on %s", this);
                gotIncomingResponse();
                break;
            }
        } catch (Exception e) {
            error = e;
            log.tracef(e, "%s error handling incoming data", this);
        } finally {
            log.tracef("%s done handling incoming data", this);
            try {
                //Consume the rest of the output if any
                while (input.read() != -1) {
                }

            } catch (IOException ignore) {
            }
            IoUtils.safeClose(input);
View Full Code Here

*/
public class SimpleByteDataInput extends InputStream implements ByteDataInput {
    private final SimpleDataInput input;

    public SimpleByteDataInput(final InputStream inputStream) {
        this.input = new SimpleDataInput(Marshalling.createByteInput(inputStream));
    }
View Full Code Here

    }

    @Override
    protected void doHandle(final MessageInputStream message) {
        ROOT_LOGGER.tracef("%s handling incoming data", this);
        final SimpleDataInput input = new SimpleDataInput(Marshalling.createByteInput(message));
        Exception error = null;
        ManagementRequestHeader requestHeader = null;
        ManagementRequestHandler requestHandler = null;
        boolean wasPing = false;
        try {
            ManagementProtocolHeader header;
            header = ManagementProtocolHeader.parse(input);

            switch (header.getType()) {
            case ManagementProtocol.TYPE_REQUEST:
                requestHeader = (ManagementRequestHeader)header;
                requestHandler = requestReceiver.readRequest(requestHeader, input);
                break;
            case ManagementProtocol.TYPE_RESPONSE:
                gotIncomingResponse();
                responseReceiver.handleResponse((ManagementResponseHeader)header, input);
                break;
            case ManagementProtocol.TYPE_BYE_BYE:
                ROOT_LOGGER.tracef("Received bye bye on %s, closing", this);
                close();
                break;
            case ManagementProtocol.TYPE_PING:
                wasPing = true;
                ROOT_LOGGER.tracef("Received ping on %s", this);
                break;
            case ManagementProtocol.TYPE_PONG:
                ROOT_LOGGER.tracef("Received pong on %s", this);
                gotIncomingResponse();
                break;
            }
        } catch (Exception e) {
            error = e;
            ROOT_LOGGER.tracef(e, "%s error handling incoming data", this);
        } finally {
            ROOT_LOGGER.tracef("%s done handling incoming data", this);
            try {
                //Consume the rest of the output if any
                while (input.read() != -1) {
                }

            } catch (IOException ignore) {
            }
            IoUtils.safeClose(input);
View Full Code Here

        log.tracef("Loading state from %s", file);
        try {
            FileInputStream inputStream = null;
            try {
                inputStream = FISAction.open(file);
                SimpleDataInput input = new SimpleDataInput(Marshalling.createByteInput(inputStream));
                int version = input.readInt();
                MarshallingConfiguration config = this.passivationManager.getMarshallingConfiguration(version);
                Unmarshaller unmarshaller = this.marshallerFactory.createUnmarshaller(config);
                unmarshaller.start(input);
                try {
                    V value = (V) unmarshaller.readObject();
View Full Code Here

    public synchronized T get(MarshallingContext context) throws IOException, ClassNotFoundException {
        if (this.object == null) {
            this.context = context;
            if (this.bytes != null) {
                ByteArrayInputStream input = new ByteArrayInputStream(this.bytes);
                SimpleDataInput data = new SimpleDataInput(Marshalling.createByteInput(input));
                int version = data.readInt();
                Unmarshaller unmarshaller = context.createUnmarshaller(version);
                try {
                    unmarshaller.start(data);
                    // Workaround for AS7-2496
                    ClassLoader currentLoader = null;
View Full Code Here

    }

    @Override
    protected void doHandle(final MessageInputStream message) {
        ROOT_LOGGER.tracef("%s handling incoming data", this);
        final SimpleDataInput input = new SimpleDataInput(Marshalling.createByteInput(message));
        Exception error = null;
        ManagementRequestHeader requestHeader = null;
        ManagementRequestHandler requestHandler = null;
        boolean wasPing = false;
        try {
            ManagementProtocolHeader header;
            header = ManagementProtocolHeader.parse(input);

            switch (header.getType()) {
            case ManagementProtocol.TYPE_REQUEST:
                requestHeader = (ManagementRequestHeader)header;
                requestHandler = requestReceiver.readRequest(requestHeader, input);
                break;
            case ManagementProtocol.TYPE_RESPONSE:
                gotIncomingResponse();
                responseReceiver.handleResponse((ManagementResponseHeader)header, input);
                break;
            case ManagementProtocol.TYPE_BYE_BYE:
                ROOT_LOGGER.tracef("Received bye bye on %s, closing", this);
                receivedByeBye = true;
                close();
                break;
            case ManagementProtocol.TYPE_PING:
                wasPing = true;
                ROOT_LOGGER.tracef("Received ping on %s", this);
                break;
            case ManagementProtocol.TYPE_PONG:
                ROOT_LOGGER.tracef("Received pong on %s", this);
                gotIncomingResponse();
                break;
            }
        } catch (Exception e) {
            error = e;
            ROOT_LOGGER.tracef(e, "%s error handling incoming data", this);
        } finally {
            ROOT_LOGGER.tracef("%s done handling incoming data", this);
            try {
                //Consume the rest of the output if any
                while (input.read() != -1) {
                }

            } catch (IOException ignore) {
            }
            IoUtils.safeClose(input);
View Full Code Here

TOP

Related Classes of org.jboss.marshalling.SimpleDataInput

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.