All Downloads are FREE. Search and download functionalities are using the official Maven repository.

at.spardat.xma.rpc.RemoteReplyData Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
/*******************************************************************************
 * Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH .
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     s IT Solutions AT Spardat GmbH - initial API and implementation
 *******************************************************************************/

// @(#) $Id: RemoteReplyData.java 2089 2007-11-28 13:56:13Z s3460 $
package at.spardat.xma.rpc;

import java.io.IOException;

import at.spardat.enterprise.exc.BaseException;
import at.spardat.xma.serializer.XmaInput;
import at.spardat.xma.serializer.XmaOutput;

/**
 * Value object that holds the data transferred from server to client
 * in an XMA RPC.
 * 
 * @author YSD, 26.05.2003 11:08:55
 */
public class RemoteReplyData extends RemoteData {

    /**
     * An exception occured in the course of executing the request
     */
    protected BaseException          exception_;
    
    
    
    /**
     * Writes this to the provided ObjectOutput
     */
    protected void externalize (XmaOutput o) throws IOException {
        // important: start with the number of the runtime version, as 
        // this might be required
        super.externalizeExclParameter (o);
        // the user supplied parameters
        super.externalizeParameters (o);
        // the information contained in this
        // first a boolean that indicates if an exception occured
        o.writeBoolean ("ynExc", exception_ != null);
        if (exception_ != null) o.writeObject ("exception", exception_);
    }

    /**
     * Reads the stuff written by externalize
     */
    protected void internalize (XmaInput in) throws IOException, ClassNotFoundException {
        super.internalizeExclParameter(in);
        super.internalizeParameters(in);
        // is there an exception?
        if (in.readBoolean()) {
            exception_ = (BaseException) in.readObject();
        }
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy