com.sun.corba.se.spi.servicecontext.ServiceContexts Java Examples

The following examples show how to use com.sun.corba.se.spi.servicecontext.ServiceContexts. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CorbaMessageMediatorImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * If the RMI-IIOP maximum stream format version service context
 * is present, it indicates the maximum stream format version we
 * could use for the reply.  If it isn't present, the default is
 * 2 for GIOP 1.3 or greater, 1 for lower.
 *
 * This is only sent on requests.  Clients can find out the
 * server's maximum by looking for a tagged component in the IOR.
 */
public byte getStreamFormatVersionForReply() {

    // NOTE: The request service contexts may indicate the max.
    ServiceContexts svc = getRequestServiceContexts();

    MaxStreamFormatVersionServiceContext msfvsc
        = (MaxStreamFormatVersionServiceContext)svc.get(
            MaxStreamFormatVersionServiceContext.SERVICE_CONTEXT_ID);

    if (msfvsc != null) {
        byte localMaxVersion = ORBUtility.getMaxStreamFormatVersion();
        byte remoteMaxVersion = msfvsc.getMaximumStreamFormatVersion();

        return (byte)Math.min(localMaxVersion, remoteMaxVersion);
    } else {
        // Defaults to 1 for GIOP 1.2 or less, 2 for
        // GIOP 1.3 or higher.
        if (getGIOPVersion().lessThan(GIOPVersion.V1_3))
            return ORBConstants.STREAM_FORMAT_VERSION_1;
        else
            return ORBConstants.STREAM_FORMAT_VERSION_2;
    }
}
 
Example #2
Source File: RequestMessage_1_1.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void read(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.response_expected = istream.read_boolean();
    this.reserved = new byte[3];
    for (int _o0 = 0;_o0 < (3); ++_o0) {
        this.reserved[_o0] = istream.read_octet();
    }
    int _len1 = istream.read_long();
    this.object_key = new byte[_len1];
    istream.read_octet_array(this.object_key, 0, _len1);
    this.operation = istream.read_string();
    this.requesting_principal = istream.read_Principal();
}
 
Example #3
Source File: MessageBase.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public static ReplyMessage createReply(
        ORB orb, GIOPVersion gv, byte encodingVersion, int request_id,
        int reply_status, ServiceContexts service_contexts, IOR ior) {

    if (gv.equals(GIOPVersion.V1_0)) { // 1.0
        return new ReplyMessage_1_0(orb, service_contexts, request_id,
                                    reply_status, ior);
    } else if (gv.equals(GIOPVersion.V1_1)) { // 1.1
        return new ReplyMessage_1_1(orb, service_contexts, request_id,
                                    reply_status, ior);
    } else if (gv.equals(GIOPVersion.V1_2)) { // 1.2
        ReplyMessage msg =
            new ReplyMessage_1_2(orb, request_id, reply_status,
                                 service_contexts, ior);
        msg.setEncodingVersion(encodingVersion);
        return msg;
    } else {
        throw wrapper.giopVersionError(
            CompletionStatus.COMPLETED_MAYBE);
    }
}
 
Example #4
Source File: RequestMessage_1_1.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
RequestMessage_1_1(ORB orb, ServiceContexts _service_contexts,
        int _request_id, boolean _response_expected, byte[] _reserved,
        byte[] _object_key, String _operation,
        Principal _requesting_principal) {
    super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN,
        Message.GIOPRequest, 0);
    this.orb = orb;
    this.wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    service_contexts = _service_contexts;
    request_id = _request_id;
    response_expected = _response_expected;
    reserved = _reserved;
    object_key = _object_key;
    operation = _operation;
    requesting_principal = _requesting_principal;
}
 
Example #5
Source File: RequestMessage_1_1.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void read(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.response_expected = istream.read_boolean();
    this.reserved = new byte[3];
    for (int _o0 = 0;_o0 < (3); ++_o0) {
        this.reserved[_o0] = istream.read_octet();
    }
    int _len1 = istream.read_long();
    this.object_key = new byte[_len1];
    istream.read_octet_array(this.object_key, 0, _len1);
    this.operation = istream.read_string();
    this.requesting_principal = istream.read_Principal();
}
 
Example #6
Source File: CorbaMessageMediatorImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
private void addExceptionDetailMessage(CorbaMessageMediator mediator,
                                       SystemException ex,
                                       ServiceContexts serviceContexts)
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos);
    ex.printStackTrace(pw);
    pw.flush(); // NOTE: you must flush or baos will be empty.
    EncapsOutputStream encapsOutputStream =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)mediator.getBroker());
    encapsOutputStream.putEndian();
    encapsOutputStream.write_wstring(baos.toString());
    UnknownServiceContext serviceContext =
        new UnknownServiceContext(ExceptionDetailMessage.value,
                                  encapsOutputStream.toByteArray());
    serviceContexts.put(serviceContext);
}
 
Example #7
Source File: MessageBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public static ReplyMessage createReply(
        ORB orb, GIOPVersion gv, byte encodingVersion, int request_id,
        int reply_status, ServiceContexts service_contexts, IOR ior) {

    if (gv.equals(GIOPVersion.V1_0)) { // 1.0
        return new ReplyMessage_1_0(orb, service_contexts, request_id,
                                    reply_status, ior);
    } else if (gv.equals(GIOPVersion.V1_1)) { // 1.1
        return new ReplyMessage_1_1(orb, service_contexts, request_id,
                                    reply_status, ior);
    } else if (gv.equals(GIOPVersion.V1_2)) { // 1.2
        ReplyMessage msg =
            new ReplyMessage_1_2(orb, request_id, reply_status,
                                 service_contexts, ior);
        msg.setEncodingVersion(encodingVersion);
        return msg;
    } else {
        throw wrapper.giopVersionError(
            CompletionStatus.COMPLETED_MAYBE);
    }
}
 
Example #8
Source File: ReplyMessage_1_2.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void write(org.omg.CORBA.portable.OutputStream ostream) {
    super.write(ostream);
    ostream.write_ulong(this.request_id);
    ostream.write_long(this.reply_status);
    if (this.service_contexts != null) {
            service_contexts.write(
            (org.omg.CORBA_2_3.portable.OutputStream) ostream,
            GIOPVersion.V1_2);
        } else {
            ServiceContexts.writeNullServiceContext(
            (org.omg.CORBA_2_3.portable.OutputStream) ostream);
    }

    // CORBA formal 00-11-0 15.4.2.2 GIOP 1.2 body must be
    // aligned on an 8 octet boundary.
    // Ensures that the first write operation called from the stub code,
    // during body construction, would insert a header padding, such that
    // the body is aligned on an 8-octet boundary.
    ((CDROutputStream)ostream).setHeaderPadding(true);

}
 
Example #9
Source File: MessageBase.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public static ReplyMessage createReply(
        ORB orb, GIOPVersion gv, byte encodingVersion, int request_id,
        int reply_status, ServiceContexts service_contexts, IOR ior) {

    if (gv.equals(GIOPVersion.V1_0)) { // 1.0
        return new ReplyMessage_1_0(orb, service_contexts, request_id,
                                    reply_status, ior);
    } else if (gv.equals(GIOPVersion.V1_1)) { // 1.1
        return new ReplyMessage_1_1(orb, service_contexts, request_id,
                                    reply_status, ior);
    } else if (gv.equals(GIOPVersion.V1_2)) { // 1.2
        ReplyMessage msg =
            new ReplyMessage_1_2(orb, request_id, reply_status,
                                 service_contexts, ior);
        msg.setEncodingVersion(encodingVersion);
        return msg;
    } else {
        throw wrapper.giopVersionError(
            CompletionStatus.COMPLETED_MAYBE);
    }
}
 
Example #10
Source File: RequestMessage_1_0.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void write(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_boolean(this.response_expected);
    nullCheck(this.object_key);
    ostream.write_long(this.object_key.length);
    ostream.write_octet_array(this.object_key, 0, this.object_key.length);
    ostream.write_string(this.operation);
    if (this.requesting_principal != null) {
        ostream.write_Principal(this.requesting_principal);
    } else {
        ostream.write_long(0);
    }
}
 
Example #11
Source File: RequestMessage_1_1.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void read(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.response_expected = istream.read_boolean();
    this.reserved = new byte[3];
    for (int _o0 = 0;_o0 < (3); ++_o0) {
        this.reserved[_o0] = istream.read_octet();
    }
    int _len1 = istream.read_long();
    this.object_key = new byte[_len1];
    istream.read_octet_array(this.object_key, 0, _len1);
    this.operation = istream.read_string();
    this.requesting_principal = istream.read_Principal();
}
 
Example #12
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * If the RMI-IIOP maximum stream format version service context
 * is present, it indicates the maximum stream format version we
 * could use for the reply.  If it isn't present, the default is
 * 2 for GIOP 1.3 or greater, 1 for lower.
 *
 * This is only sent on requests.  Clients can find out the
 * server's maximum by looking for a tagged component in the IOR.
 */
public byte getStreamFormatVersionForReply() {

    // NOTE: The request service contexts may indicate the max.
    ServiceContexts svc = getRequestServiceContexts();

    MaxStreamFormatVersionServiceContext msfvsc
        = (MaxStreamFormatVersionServiceContext)svc.get(
            MaxStreamFormatVersionServiceContext.SERVICE_CONTEXT_ID);

    if (msfvsc != null) {
        byte localMaxVersion = ORBUtility.getMaxStreamFormatVersion();
        byte remoteMaxVersion = msfvsc.getMaximumStreamFormatVersion();

        return (byte)Math.min(localMaxVersion, remoteMaxVersion);
    } else {
        // Defaults to 1 for GIOP 1.2 or less, 2 for
        // GIOP 1.3 or higher.
        if (getGIOPVersion().lessThan(GIOPVersion.V1_3))
            return ORBConstants.STREAM_FORMAT_VERSION_1;
        else
            return ORBConstants.STREAM_FORMAT_VERSION_2;
    }
}
 
Example #13
Source File: RequestMessage_1_2.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.request_id = istream.read_ulong();
    this.response_flags = istream.read_octet();
    this.reserved = new byte[3];
    for (int _o0 = 0;_o0 < (3); ++_o0) {
        this.reserved[_o0] = istream.read_octet();
    }
    this.target = TargetAddressHelper.read(istream);
    getObjectKey(); // this does AddressingDisposition check
    this.operation = istream.read_string();
    this.service_contexts
        = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);

    // CORBA formal 00-11-0 15.4.2.2 GIOP 1.2 body must be
    // aligned on an 8 octet boundary.
    // Ensures that the first read operation called from the stub code,
    // during body deconstruction, would skip the header padding, that was
    // inserted to ensure that the body was aligned on an 8-octet boundary.
    ((CDRInputStream)istream).setHeaderPadding(true);

}
 
Example #14
Source File: RequestMessage_1_1.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
RequestMessage_1_1(ORB orb, ServiceContexts _service_contexts,
        int _request_id, boolean _response_expected, byte[] _reserved,
        byte[] _object_key, String _operation,
        Principal _requesting_principal) {
    super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN,
        Message.GIOPRequest, 0);
    this.orb = orb;
    this.wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    service_contexts = _service_contexts;
    request_id = _request_id;
    response_expected = _response_expected;
    reserved = _reserved;
    object_key = _object_key;
    operation = _operation;
    requesting_principal = _requesting_principal;
}
 
Example #15
Source File: ReplyMessage_1_2.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
ReplyMessage_1_2(ORB orb, int _request_id, int _reply_status,
        ServiceContexts _service_contexts, IOR _ior) {
    super(Message.GIOPBigMagic, GIOPVersion.V1_2, FLAG_NO_FRAG_BIG_ENDIAN,
        Message.GIOPReply, 0);
    this.orb = orb;
    this.wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    request_id = _request_id;
    reply_status = _reply_status;
    service_contexts = _service_contexts;
    ior = _ior;
}
 
Example #16
Source File: ReplyMessage_1_1.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void read(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) ;
    }
}
 
Example #17
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public CorbaMessageMediatorImpl(ORB orb,
                                ContactInfo contactInfo,
                                Connection connection,
                                GIOPVersion giopVersion,
                                IOR ior,
                                int requestId,
                                short addrDisposition,
                                String operationName,
                                boolean isOneWay)
{
    this( orb, connection ) ;

    this.contactInfo = (CorbaContactInfo) contactInfo;
    this.addrDisposition = addrDisposition;

    streamFormatVersion =
        getStreamFormatVersionForThisRequest(
            ((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR(),
            giopVersion);
    streamFormatVersionSet = true;

    requestHeader = (RequestMessage) MessageBase.createRequest(
        this.orb,
        giopVersion,
        ORBUtility.getEncodingVersion(orb, ior),
        requestId,
        !isOneWay,
        ((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR(),
        this.addrDisposition,
        operationName,
        new ServiceContexts(orb),
        null);
}
 
Example #18
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public CorbaMessageMediator createLocationForward(
    CorbaMessageMediator messageMediator, IOR ior, ServiceContexts svc)
{
    ReplyMessage reply
        = MessageBase.createReply(
              (ORB)messageMediator.getBroker(),
              messageMediator.getGIOPVersion(),
              messageMediator.getEncodingVersion(),
              messageMediator.getRequestId(),
              ReplyMessage.LOCATION_FORWARD,
              getServiceContextsForReply(messageMediator, svc),
              ior);

    return createResponseHelper(messageMediator, reply, ior);
}
 
Example #19
Source File: CorbaMessageMediatorImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ServiceContexts svc)
{
    ReplyMessage message =
        MessageBase.createReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            ReplyMessage.NO_EXCEPTION,
            svc,
            null);
    return createResponseHelper(messageMediator, message, null);
}
 
Example #20
Source File: ReplyMessage_1_0.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #21
Source File: CorbaClientRequestDispatcherImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void addServiceContexts(CorbaMessageMediator messageMediator)
{
    ORB orb = (ORB)messageMediator.getBroker();
    CorbaConnection c = (CorbaConnection) messageMediator.getConnection();
    GIOPVersion giopVersion = messageMediator.getGIOPVersion();

    ServiceContexts contexts = messageMediator.getRequestServiceContexts();

    addCodeSetServiceContext(c, contexts, giopVersion);

    // Add the RMI-IIOP max stream format version
    // service context to every request.  Once we have GIOP 1.3,
    // we could skip it since we now support version 2, but
    // probably safer to always send it.
    contexts.put(MaxStreamFormatVersionServiceContext.singleton);

    // ORBVersion servicecontext needs to be sent
    ORBVersionServiceContext ovsc = new ORBVersionServiceContext(
                    ORBVersionFactory.getORBVersion() ) ;
    contexts.put( ovsc ) ;

    // NOTE : We only want to send the runtime context the first time
    if ((c != null) && !c.isPostInitialContexts()) {
        // Do not do c.setPostInitialContexts() here.
        // If a client interceptor send_request does a ForwardRequest
        // which ends up using the same connection then the service
        // context would not be sent.
        SendingContextServiceContext scsc =
            new SendingContextServiceContext( orb.getFVDCodeBaseIOR() ) ; //d11638
        contexts.put( scsc ) ;
    }
}
 
Example #22
Source File: RequestMessage_1_2.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void write(org.omg.CORBA.portable.OutputStream ostream) {
    super.write(ostream);
    ostream.write_ulong(this.request_id);
    ostream.write_octet(this.response_flags);
    nullCheck(this.reserved);
    if (this.reserved.length != (3)) {
        throw wrapper.badReservedLength(
            org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    for (int _i0 = 0;_i0 < (3); ++_i0) {
        ostream.write_octet(this.reserved[_i0]);
    }
    nullCheck(this.target);
    TargetAddressHelper.write(ostream, this.target);
    ostream.write_string(this.operation);
    if (this.service_contexts != null) {
            service_contexts.write(
            (org.omg.CORBA_2_3.portable.OutputStream) ostream,
            GIOPVersion.V1_2);
        } else {
            ServiceContexts.writeNullServiceContext(
            (org.omg.CORBA_2_3.portable.OutputStream) ostream);
    }

    // CORBA formal 00-11-0 15.4.2.2 GIOP 1.2 body must be
    // aligned on an 8 octet boundary.
    // Ensures that the first write operation called from the stub code,
    // during body construction, would insert a header padding, such that
    // the body is aligned on an 8-octet boundary.
    ((CDROutputStream)ostream).setHeaderPadding(true);
}
 
Example #23
Source File: CorbaClientRequestDispatcherImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected void addServiceContexts(CorbaMessageMediator messageMediator)
{
    ORB orb = (ORB)messageMediator.getBroker();
    CorbaConnection c = (CorbaConnection) messageMediator.getConnection();
    GIOPVersion giopVersion = messageMediator.getGIOPVersion();

    ServiceContexts contexts = messageMediator.getRequestServiceContexts();

    addCodeSetServiceContext(c, contexts, giopVersion);

    // Add the RMI-IIOP max stream format version
    // service context to every request.  Once we have GIOP 1.3,
    // we could skip it since we now support version 2, but
    // probably safer to always send it.
    contexts.put(MaxStreamFormatVersionServiceContext.singleton);

    // ORBVersion servicecontext needs to be sent
    ORBVersionServiceContext ovsc = new ORBVersionServiceContext(
                    ORBVersionFactory.getORBVersion() ) ;
    contexts.put( ovsc ) ;

    // NOTE : We only want to send the runtime context the first time
    if ((c != null) && !c.isPostInitialContexts()) {
        // Do not do c.setPostInitialContexts() here.
        // If a client interceptor send_request does a ForwardRequest
        // which ends up using the same connection then the service
        // context would not be sent.
        SendingContextServiceContext scsc =
            new SendingContextServiceContext( orb.getFVDCodeBaseIOR() ) ; //d11638
        contexts.put( scsc ) ;
    }
}
 
Example #24
Source File: RequestMessage_1_1.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void write(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_1);
        } else {
            ServiceContexts.writeNullServiceContext(
            (org.omg.CORBA_2_3.portable.OutputStream) ostream);
    }
    ostream.write_ulong(this.request_id);
    ostream.write_boolean(this.response_expected);
    nullCheck(this.reserved);
    if (this.reserved.length != (3)) {
        throw wrapper.badReservedLength(
            org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    for (int _i0 = 0;_i0 < (3); ++_i0) {
        ostream.write_octet(this.reserved[_i0]);
    }
    nullCheck(this.object_key);
    ostream.write_long(this.object_key.length);
    ostream.write_octet_array(this.object_key, 0, this.object_key.length);
    ostream.write_string(this.operation);
    if (this.requesting_principal != null) {
        ostream.write_Principal(this.requesting_principal);
    } else {
        ostream.write_long(0);
    }
}
 
Example #25
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ServiceContexts svc)
{
    ReplyMessage message =
        MessageBase.createReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            ReplyMessage.NO_EXCEPTION,
            svc,
            null);
    return createResponseHelper(messageMediator, message, null);
}
 
Example #26
Source File: RequestMessage_1_2.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
RequestMessage_1_2(ORB orb, int _request_id, byte _response_flags,
        byte[] _reserved, TargetAddress _target,
        String _operation, ServiceContexts _service_contexts) {
    super(Message.GIOPBigMagic, GIOPVersion.V1_2, FLAG_NO_FRAG_BIG_ENDIAN,
        Message.GIOPRequest, 0);
    this.orb = orb;
    this.wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    request_id = _request_id;
    response_flags = _response_flags;
    reserved = _reserved;
    target = _target;
    operation = _operation;
    service_contexts = _service_contexts;
}
 
Example #27
Source File: RequestMessage_1_0.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
RequestMessage_1_0(ORB orb, ServiceContexts _service_contexts,
        int _request_id, boolean _response_expected, byte[] _object_key,
        String _operation, Principal _requesting_principal) {
    super(Message.GIOPBigMagic, false, Message.GIOPRequest, 0);
    this.orb = orb;
    service_contexts = _service_contexts;
    request_id = _request_id;
    response_expected = _response_expected;
    object_key = _object_key;
    operation = _operation;
    requesting_principal = _requesting_principal;
}
 
Example #28
Source File: CorbaMessageMediatorImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public CorbaMessageMediatorImpl(ORB orb,
                                ContactInfo contactInfo,
                                Connection connection,
                                GIOPVersion giopVersion,
                                IOR ior,
                                int requestId,
                                short addrDisposition,
                                String operationName,
                                boolean isOneWay)
{
    this( orb, connection ) ;

    this.contactInfo = (CorbaContactInfo) contactInfo;
    this.addrDisposition = addrDisposition;

    streamFormatVersion =
        getStreamFormatVersionForThisRequest(
            ((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR(),
            giopVersion);
    streamFormatVersionSet = true;

    requestHeader = (RequestMessage) MessageBase.createRequest(
        this.orb,
        giopVersion,
        ORBUtility.getEncodingVersion(orb, ior),
        requestId,
        !isOneWay,
        ((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR(),
        this.addrDisposition,
        operationName,
        new ServiceContexts(orb),
        null);
}
 
Example #29
Source File: RequestMessage_1_0.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void read(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.response_expected = istream.read_boolean();
    int _len0 = istream.read_long();
    this.object_key = new byte[_len0];
    istream.read_octet_array(this.object_key, 0, _len0);
    this.operation = istream.read_string();
    this.requesting_principal = istream.read_Principal();
}
 
Example #30
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public CorbaMessageMediator createResponse(
    CorbaMessageMediator messageMediator,
    ServiceContexts svc)
{
    // REVISIT: ignore service contexts during framework transition.
    // They are set in SubcontractResponseHandler to the wrong connection.
    // Then they would be set again here and a duplicate contexts
    // exception occurs.
    return createResponseHelper(
        messageMediator,
        getServiceContextsForReply(messageMediator, null));
}