FileDocCategorySizeDatePackage
ReplyMessage_1_0.javaAPI DocJava SE 5 API5827Fri Aug 26 14:54:32 BST 2005com.sun.corba.se.impl.protocol.giopmsgheaders

ReplyMessage_1_0

public final class ReplyMessage_1_0 extends Message_1_0 implements ReplyMessage
This implements the GIOP 1.0 Reply header.
author
Ram Jeyaraman 05/14/2000
version
1.0

Fields Summary
private ORB
orb
private ORBUtilSystemException
wrapper
private ServiceContexts
service_contexts
private int
request_id
private int
reply_status
private IOR
ior
private String
exClassName
private int
minorCode
private CompletionStatus
completionStatus
Constructors Summary
ReplyMessage_1_0(ORB orb)


    // Constructors

      
        this.orb = orb;
	this.wrapper = ORBUtilSystemException.get( orb,
	    CORBALogDomains.RPC_PROTOCOL ) ;
    
ReplyMessage_1_0(ORB orb, ServiceContexts _service_contexts, int _request_id, int _reply_status, IOR _ior)

        super(Message.GIOPBigMagic, false, Message.GIOPReply, 0);
        this.orb = orb;
	this.wrapper = ORBUtilSystemException.get( orb,
	    CORBALogDomains.RPC_PROTOCOL ) ;
        service_contexts = _service_contexts;
        request_id = _request_id;
        reply_status = _reply_status;
        ior = _ior;
    
Methods Summary
public voidcallback(com.sun.corba.se.impl.protocol.giopmsgheaders.MessageHandler handler)

        handler.handleInput(this);
    
public shortgetAddrDisposition()

        return KeyAddr.value;
    
public com.sun.corba.se.spi.ior.IORgetIOR()

        return this.ior;
    
public intgetReplyStatus()

        return this.reply_status;
    
public intgetRequestId()

        return this.request_id;
    
public com.sun.corba.se.spi.servicecontext.ServiceContextsgetServiceContexts()

        return this.service_contexts;
    
public org.omg.CORBA.SystemExceptiongetSystemException(java.lang.String message)

	return MessageBase.getSystemException(
            exClassName, minorCode, completionStatus, message, wrapper);
    
public static voidisValidReplyStatus(int replyStatus)

        switch (replyStatus) {
        case NO_EXCEPTION :
        case USER_EXCEPTION :
        case SYSTEM_EXCEPTION :
        case LOCATION_FORWARD :
            break;
        default :
	    ORBUtilSystemException localWrapper = ORBUtilSystemException.get( 
		CORBALogDomains.RPC_PROTOCOL ) ;
	    throw localWrapper.illegalReplyStatus( CompletionStatus.COMPLETED_MAYBE);
        }
    
public voidread(org.omg.CORBA.portable.InputStream istream)

        super.read(istream);
        this.service_contexts 
            = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
        this.request_id = istream.read_ulong();
        this.reply_status = istream.read_long();
        isValidReplyStatus(this.reply_status); // raises exception on error

        // The code below reads the reply body in some cases
        // SYSTEM_EXCEPTION & LOCATION_FORWARD
        if (this.reply_status == SYSTEM_EXCEPTION) {

            String reposId = istream.read_string();
            this.exClassName = ORBUtility.classNameOf(reposId);
            this.minorCode = istream.read_long();
            int status = istream.read_long();

            switch (status) {
            case CompletionStatus._COMPLETED_YES:
                this.completionStatus = CompletionStatus.COMPLETED_YES;
                break;
            case CompletionStatus._COMPLETED_NO:
                this.completionStatus = CompletionStatus.COMPLETED_NO;
                break;
            case CompletionStatus._COMPLETED_MAYBE:
                this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
                break;
            default:
		throw wrapper.badCompletionStatusInReply( 
		    CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
            }

        } else if (this.reply_status == USER_EXCEPTION) {
            // do nothing. The client stub will read the exception from body.
        } else if (this.reply_status == LOCATION_FORWARD) {
            CDRInputStream cdr = (CDRInputStream) istream;
	    this.ior = IORFactories.makeIOR( cdr ) ;
        }
    
public voidsetIOR(com.sun.corba.se.spi.ior.IOR ior)

	this.ior = ior;
    
public voidsetServiceContexts(com.sun.corba.se.spi.servicecontext.ServiceContexts sc)

	this.service_contexts = sc;
    
public voidwrite(org.omg.CORBA.portable.OutputStream ostream)

        super.write(ostream);
    	if (this.service_contexts != null) {
	        service_contexts.write(
                (org.omg.CORBA_2_3.portable.OutputStream) ostream,
                GIOPVersion.V1_0);
	    } else {
	        ServiceContexts.writeNullServiceContext(
                (org.omg.CORBA_2_3.portable.OutputStream) ostream);
        }
        ostream.write_ulong(this.request_id);
        ostream.write_long(this.reply_status);