com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage Java Examples

The following examples show how to use com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage. 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 openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void handleInput(ReplyMessage_1_0 header) throws IOException
{
    try {
        try {
            if (transportDebug()) dprint(".REPLY 1.0->: " + header);
            messageHeader = replyHeader = (ReplyMessage) header;
            setInputObject();

            // REVISIT: this should be done by waiting thread.
            inputObject.unmarshalHeader();

            signalResponseReceived();
        } finally{
            setWorkThenReadOrResumeSelect(header);
        }
    } catch (Throwable t) {
        if (transportDebug())dprint(".REPLY 1.0: !!ERROR!!: " + header, t);
        // Mask the exception from thread.;
    } finally {
        if (transportDebug()) dprint(".REPLY 1.0<-: " + header);
    }
}
 
Example #2
Source File: CorbaMessageMediatorImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void handleInput(ReplyMessage_1_0 header) throws IOException
{
    try {
        try {
            if (transportDebug()) dprint(".REPLY 1.0->: " + header);
            messageHeader = replyHeader = (ReplyMessage) header;
            setInputObject();

            // REVISIT: this should be done by waiting thread.
            inputObject.unmarshalHeader();

            signalResponseReceived();
        } finally{
            setWorkThenReadOrResumeSelect(header);
        }
    } catch (Throwable t) {
        if (transportDebug())dprint(".REPLY 1.0: !!ERROR!!: " + header, t);
        // Mask the exception from thread.;
    } finally {
        if (transportDebug()) dprint(".REPLY 1.0<-: " + header);
    }
}
 
Example #3
Source File: CorbaMessageMediatorImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
protected void runInterceptors(CorbaMessageMediator messageMediator,
                               ReplyMessage reply)
{
    if( messageMediator.executePIInResponseConstructor() ) {
        // Invoke server request ending interception points (send_*):
        // Note: this may end up with a SystemException or an internal
        // Runtime ForwardRequest
        ((ORB)messageMediator.getBroker()).getPIHandler().
            invokeServerPIEndingPoint( reply );

        // Note this will be executed even if a ForwardRequest or
        // SystemException is thrown by a Portable Interceptors ending
        // point since we end up in this constructor again anyway.
        ((ORB)messageMediator.getBroker()).getPIHandler().
            cleanupServerPIRequest();

        // See createSystemExceptionResponse for why this is necesary.
        messageMediator.setExecutePIInResponseConstructor(false);
    }
}
 
Example #4
Source File: CorbaMessageMediatorImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
protected void runInterceptors(CorbaMessageMediator messageMediator,
                               ReplyMessage reply)
{
    if( messageMediator.executePIInResponseConstructor() ) {
        // Invoke server request ending interception points (send_*):
        // Note: this may end up with a SystemException or an internal
        // Runtime ForwardRequest
        ((ORB)messageMediator.getBroker()).getPIHandler().
            invokeServerPIEndingPoint( reply );

        // Note this will be executed even if a ForwardRequest or
        // SystemException is thrown by a Portable Interceptors ending
        // point since we end up in this constructor again anyway.
        ((ORB)messageMediator.getBroker()).getPIHandler().
            cleanupServerPIRequest();

        // See createSystemExceptionResponse for why this is necesary.
        messageMediator.setExecutePIInResponseConstructor(false);
    }
}
 
Example #5
Source File: BufferManagerWriteStream.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void overflow (ByteBufferWithInfo bbwi)
{
    // Set the fragment's moreFragments field to true
    MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT);

    try {
       sendFragment(false);
    } catch(SystemException se){
            orb.getPIHandler().invokeClientPIEndingPoint(
                    ReplyMessage.SYSTEM_EXCEPTION, se);
            throw se;
    }

    // Reuse the old buffer

    // REVISIT - need to account for case when needed > available
    // even after fragmenting.  This is the large array case, so
    // the caller should retry when it runs out of space.
    bbwi.position(0);
    bbwi.buflen = bbwi.byteBuffer.limit();
    bbwi.fragmented = true;

    // Now we must marshal in the fragment header/GIOP header

    // REVISIT - we can optimize this by not creating the fragment message
    // each time.

    FragmentMessage header = ((CDROutputObject)outputObject).getMessageHeader().createFragmentMessage();

    header.write(((CDROutputObject)outputObject));
}
 
Example #6
Source File: PIHandlerImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void cleanupClientPIRequest() {
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    RetryType rt = info.getRetryRequest() ;

    // fix for 6763340
    if (!rt.equals( RetryType.BEFORE_RESPONSE )) {

        // If the replyStatus has not yet been set, this is an indication
        // that the ORB threw an exception before we had a chance to
        // invoke the client interceptor ending points.
        //
        // _REVISIT_ We cannot handle any exceptions or ForwardRequests
        // flagged by the ending points here because there is no way
        // to gracefully handle this in any of the calling code.
        // This is a rare corner case, so we will ignore this for now.
        short replyStatus = info.getReplyStatus();
        if (replyStatus == info.UNINITIALIZED ) {
            invokeClientPIEndingPoint( ReplyMessage.SYSTEM_EXCEPTION,
                wrapper.unknownRequestInvoke(
                    CompletionStatus.COMPLETED_MAYBE ) ) ;
        }
    }

    // Decrement entry count, and if it is zero, pop it from the stack.
    info.decrementEntryCount();

    // fix for 6763340, and probably other cases (non-recursive retry)
    if (info.getEntryCount() == 0 && !info.getRetryRequest().isRetry()) {
        // RequestInfoStack<ClientRequestInfoImpl> infoStack =
        //     threadLocalClientRequestInfoStack.get();
        RequestInfoStack infoStack =
            (RequestInfoStack)threadLocalClientRequestInfoStack.get();
        infoStack.pop();
        printPop();
    }
}
 
Example #7
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 #8
Source File: BufferManagerWriteStream.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void overflow (ByteBufferWithInfo bbwi)
{
    // Set the fragment's moreFragments field to true
    MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT);

    try {
       sendFragment(false);
    } catch(SystemException se){
            orb.getPIHandler().invokeClientPIEndingPoint(
                    ReplyMessage.SYSTEM_EXCEPTION, se);
            throw se;
    }

    // Reuse the old buffer

    // REVISIT - need to account for case when needed > available
    // even after fragmenting.  This is the large array case, so
    // the caller should retry when it runs out of space.
    bbwi.position(0);
    bbwi.buflen = bbwi.byteBuffer.limit();
    bbwi.fragmented = true;

    // Now we must marshal in the fragment header/GIOP header

    // REVISIT - we can optimize this by not creating the fragment message
    // each time.

    FragmentMessage header = ((CDROutputObject)outputObject).getMessageHeader().createFragmentMessage();

    header.write(((CDROutputObject)outputObject));
}
 
Example #9
Source File: CorbaMessageMediatorImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void handleInput(ReplyMessage_1_2 header) throws IOException
{
    try {
        try {
            messageHeader = replyHeader = (ReplyMessage) header;

            // We know that the request ID is in the first fragment
            header.unmarshalRequestID(dispatchByteBuffer);

            if (transportDebug()) {
                dprint(".REPLY 1.2->: id/"
                       + + header.getRequestId()
                       + ": more?: " + header.moreFragmentsToFollow()
                       + ": " + header);
            }

            setInputObject();

            signalResponseReceived();
        } finally {
            setWorkThenReadOrResumeSelect(header);
        }
    } catch (Throwable t) {
        if (transportDebug()) dprint(".REPLY 1.2: id/"
                                     + header.getRequestId()
                                     + ": !!ERROR!!: "
                                     + header, t);
        // Mask the exception from thread.;
    } finally {
        if (transportDebug()) dprint(".REPLY 1.2<-: id/"
                                     + header.getRequestId()
                                     + ": "
                                     + header);
    }
}
 
Example #10
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u-backup 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 #11
Source File: PIHandlerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void cleanupClientPIRequest() {
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    RetryType rt = info.getRetryRequest() ;

    // fix for 6763340
    if (!rt.equals( RetryType.BEFORE_RESPONSE )) {

        // If the replyStatus has not yet been set, this is an indication
        // that the ORB threw an exception before we had a chance to
        // invoke the client interceptor ending points.
        //
        // _REVISIT_ We cannot handle any exceptions or ForwardRequests
        // flagged by the ending points here because there is no way
        // to gracefully handle this in any of the calling code.
        // This is a rare corner case, so we will ignore this for now.
        short replyStatus = info.getReplyStatus();
        if (replyStatus == info.UNINITIALIZED ) {
            invokeClientPIEndingPoint( ReplyMessage.SYSTEM_EXCEPTION,
                wrapper.unknownRequestInvoke(
                    CompletionStatus.COMPLETED_MAYBE ) ) ;
        }
    }

    // Decrement entry count, and if it is zero, pop it from the stack.
    info.decrementEntryCount();

    // fix for 6763340, and probably other cases (non-recursive retry)
    if (info.getEntryCount() == 0 && !info.getRetryRequest().isRetry()) {
        // RequestInfoStack<ClientRequestInfoImpl> infoStack =
        //     threadLocalClientRequestInfoStack.get();
        RequestInfoStack infoStack =
            (RequestInfoStack)threadLocalClientRequestInfoStack.get();
        infoStack.pop();
        printPop();
    }
}
 
Example #12
Source File: CorbaMessageMediatorImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ServiceContexts svc,boolean user)
{
    ReplyMessage message =
        MessageBase.createReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            user ? ReplyMessage.USER_EXCEPTION :
                   ReplyMessage.SYSTEM_EXCEPTION,
            svc,
            null);
    return createResponseHelper(messageMediator, message, null);
}
 
Example #13
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 #14
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,boolean user)
{
    ReplyMessage message =
        MessageBase.createReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            user ? ReplyMessage.USER_EXCEPTION :
                   ReplyMessage.SYSTEM_EXCEPTION,
            svc,
            null);
    return createResponseHelper(messageMediator, message, null);
}
 
Example #15
Source File: BufferManagerWriteStream.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void overflow (ByteBufferWithInfo bbwi)
{
    // Set the fragment's moreFragments field to true
    MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT);

    try {
       sendFragment(false);
    } catch(SystemException se){
            orb.getPIHandler().invokeClientPIEndingPoint(
                    ReplyMessage.SYSTEM_EXCEPTION, se);
            throw se;
    }

    // Reuse the old buffer

    // REVISIT - need to account for case when needed > available
    // even after fragmenting.  This is the large array case, so
    // the caller should retry when it runs out of space.
    bbwi.position(0);
    bbwi.buflen = bbwi.byteBuffer.limit();
    bbwi.fragmented = true;

    // Now we must marshal in the fragment header/GIOP header

    // REVISIT - we can optimize this by not creating the fragment message
    // each time.

    FragmentMessage header = ((CDROutputObject)outputObject).getMessageHeader().createFragmentMessage();

    header.write(((CDROutputObject)outputObject));
}
 
Example #16
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ServiceContexts svc,boolean user)
{
    ReplyMessage message =
        MessageBase.createReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            user ? ReplyMessage.USER_EXCEPTION :
                   ReplyMessage.SYSTEM_EXCEPTION,
            svc,
            null);
    return createResponseHelper(messageMediator, message, null);
}
 
Example #17
Source File: BufferManagerWriteStream.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void overflow (ByteBufferWithInfo bbwi)
{
    // Set the fragment's moreFragments field to true
    MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT);

    try {
       sendFragment(false);
    } catch(SystemException se){
            orb.getPIHandler().invokeClientPIEndingPoint(
                    ReplyMessage.SYSTEM_EXCEPTION, se);
            throw se;
    }

    // Reuse the old buffer

    // REVISIT - need to account for case when needed > available
    // even after fragmenting.  This is the large array case, so
    // the caller should retry when it runs out of space.
    bbwi.position(0);
    bbwi.buflen = bbwi.byteBuffer.limit();
    bbwi.fragmented = true;

    // Now we must marshal in the fragment header/GIOP header

    // REVISIT - we can optimize this by not creating the fragment message
    // each time.

    FragmentMessage header = ((CDROutputObject)outputObject).getMessageHeader().createFragmentMessage();

    header.write(((CDROutputObject)outputObject));
}
 
Example #18
Source File: CorbaMessageMediatorImpl.java    From hottub 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 #19
Source File: BufferManagerWriteStream.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void overflow (ByteBufferWithInfo bbwi)
{
    // Set the fragment's moreFragments field to true
    MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT);

    try {
       sendFragment(false);
    } catch(SystemException se){
            orb.getPIHandler().invokeClientPIEndingPoint(
                    ReplyMessage.SYSTEM_EXCEPTION, se);
            throw se;
    }

    // Reuse the old buffer

    // REVISIT - need to account for case when needed > available
    // even after fragmenting.  This is the large array case, so
    // the caller should retry when it runs out of space.
    bbwi.position(0);
    bbwi.buflen = bbwi.byteBuffer.limit();
    bbwi.fragmented = true;

    // Now we must marshal in the fragment header/GIOP header

    // REVISIT - we can optimize this by not creating the fragment message
    // each time.

    FragmentMessage header = ((CDROutputObject)outputObject).getMessageHeader().createFragmentMessage();

    header.write(((CDROutputObject)outputObject));
}
 
Example #20
Source File: CorbaMessageMediatorImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void handleInput(ReplyMessage_1_2 header) throws IOException
{
    try {
        try {
            messageHeader = replyHeader = (ReplyMessage) header;

            // We know that the request ID is in the first fragment
            header.unmarshalRequestID(dispatchByteBuffer);

            if (transportDebug()) {
                dprint(".REPLY 1.2->: id/"
                       + + header.getRequestId()
                       + ": more?: " + header.moreFragmentsToFollow()
                       + ": " + header);
            }

            setInputObject();

            signalResponseReceived();
        } finally {
            setWorkThenReadOrResumeSelect(header);
        }
    } catch (Throwable t) {
        if (transportDebug()) dprint(".REPLY 1.2: id/"
                                     + header.getRequestId()
                                     + ": !!ERROR!!: "
                                     + header, t);
        // Mask the exception from thread.;
    } finally {
        if (transportDebug()) dprint(".REPLY 1.2<-: id/"
                                     + header.getRequestId()
                                     + ": "
                                     + header);
    }
}
 
Example #21
Source File: CorbaMessageMediatorImpl.java    From jdk8u60 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 #22
Source File: PIHandlerImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void cleanupClientPIRequest() {
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    RetryType rt = info.getRetryRequest() ;

    // fix for 6763340
    if (!rt.equals( RetryType.BEFORE_RESPONSE )) {

        // If the replyStatus has not yet been set, this is an indication
        // that the ORB threw an exception before we had a chance to
        // invoke the client interceptor ending points.
        //
        // _REVISIT_ We cannot handle any exceptions or ForwardRequests
        // flagged by the ending points here because there is no way
        // to gracefully handle this in any of the calling code.
        // This is a rare corner case, so we will ignore this for now.
        short replyStatus = info.getReplyStatus();
        if (replyStatus == info.UNINITIALIZED ) {
            invokeClientPIEndingPoint( ReplyMessage.SYSTEM_EXCEPTION,
                wrapper.unknownRequestInvoke(
                    CompletionStatus.COMPLETED_MAYBE ) ) ;
        }
    }

    // Decrement entry count, and if it is zero, pop it from the stack.
    info.decrementEntryCount();

    // fix for 6763340, and probably other cases (non-recursive retry)
    if (info.getEntryCount() == 0 && !info.getRetryRequest().isRetry()) {
        // RequestInfoStack<ClientRequestInfoImpl> infoStack =
        //     threadLocalClientRequestInfoStack.get();
        RequestInfoStack infoStack =
            (RequestInfoStack)threadLocalClientRequestInfoStack.get();
        infoStack.pop();
        printPop();
    }
}
 
Example #23
Source File: PIHandlerImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void cleanupClientPIRequest() {
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    RetryType rt = info.getRetryRequest() ;

    // fix for 6763340
    if (!rt.equals( RetryType.BEFORE_RESPONSE )) {

        // If the replyStatus has not yet been set, this is an indication
        // that the ORB threw an exception before we had a chance to
        // invoke the client interceptor ending points.
        //
        // _REVISIT_ We cannot handle any exceptions or ForwardRequests
        // flagged by the ending points here because there is no way
        // to gracefully handle this in any of the calling code.
        // This is a rare corner case, so we will ignore this for now.
        short replyStatus = info.getReplyStatus();
        if (replyStatus == info.UNINITIALIZED ) {
            invokeClientPIEndingPoint( ReplyMessage.SYSTEM_EXCEPTION,
                wrapper.unknownRequestInvoke(
                    CompletionStatus.COMPLETED_MAYBE ) ) ;
        }
    }

    // Decrement entry count, and if it is zero, pop it from the stack.
    info.decrementEntryCount();

    // fix for 6763340, and probably other cases (non-recursive retry)
    if (info.getEntryCount() == 0 && !info.getRetryRequest().isRetry()) {
        // RequestInfoStack<ClientRequestInfoImpl> infoStack =
        //     threadLocalClientRequestInfoStack.get();
        RequestInfoStack infoStack =
            (RequestInfoStack)threadLocalClientRequestInfoStack.get();
        infoStack.pop();
        printPop();
    }
}
 
Example #24
Source File: PIHandlerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void cleanupClientPIRequest() {
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    RetryType rt = info.getRetryRequest() ;

    // fix for 6763340
    if (!rt.equals( RetryType.BEFORE_RESPONSE )) {

        // If the replyStatus has not yet been set, this is an indication
        // that the ORB threw an exception before we had a chance to
        // invoke the client interceptor ending points.
        //
        // _REVISIT_ We cannot handle any exceptions or ForwardRequests
        // flagged by the ending points here because there is no way
        // to gracefully handle this in any of the calling code.
        // This is a rare corner case, so we will ignore this for now.
        short replyStatus = info.getReplyStatus();
        if (replyStatus == info.UNINITIALIZED ) {
            invokeClientPIEndingPoint( ReplyMessage.SYSTEM_EXCEPTION,
                wrapper.unknownRequestInvoke(
                    CompletionStatus.COMPLETED_MAYBE ) ) ;
        }
    }

    // Decrement entry count, and if it is zero, pop it from the stack.
    info.decrementEntryCount();

    // fix for 6763340, and probably other cases (non-recursive retry)
    if (info.getEntryCount() == 0 && !info.getRetryRequest().isRetry()) {
        // RequestInfoStack<ClientRequestInfoImpl> infoStack =
        //     threadLocalClientRequestInfoStack.get();
        RequestInfoStack infoStack =
            (RequestInfoStack)threadLocalClientRequestInfoStack.get();
        infoStack.pop();
        printPop();
    }
}
 
Example #25
Source File: CorbaMessageMediatorImpl.java    From openjdk-8-source 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: CorbaMessageMediatorImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public boolean isDifferentAddrDispositionRequestedReply()
{
    return replyHeader.getReplyStatus() == ReplyMessage.NEEDS_ADDRESSING_MODE;
}
 
Example #27
Source File: CorbaMessageMediatorImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected void handleAddressingDisposition(
    CorbaMessageMediator messageMediator,
    AddressingDispositionException ex)
{

    short addrDisp = -1;

    // from iiop.RequestProcessor.

    // Respond with expected target addressing disposition.

    switch (messageMediator.getRequestHeader().getType()) {
    case Message.GIOPRequest :
        ReplyMessage replyHeader = MessageBase.createReply(
                      (ORB)messageMediator.getBroker(),
                      messageMediator.getGIOPVersion(),
                      messageMediator.getEncodingVersion(),
                      messageMediator.getRequestId(),
                      ReplyMessage.NEEDS_ADDRESSING_MODE,
                      null, null);
        // REVISIT: via acceptor factory.
        CDROutputObject outputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(
            (ORB)messageMediator.getBroker(),
            this,
            messageMediator.getGIOPVersion(),
            (CorbaConnection)messageMediator.getConnection(),
            replyHeader,
            ORBConstants.STREAM_FORMAT_VERSION_1);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        replyHeader.write(outputObject);
        AddressingDispositionHelper.write(outputObject,
                                          ex.expectedAddrDisp());
        return;

    case Message.GIOPLocateRequest :
        LocateReplyMessage locateReplyHeader = MessageBase.createLocateReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE,
            null);

        addrDisp = ex.expectedAddrDisp();

        // REVISIT: via acceptor factory.
        outputObject =
            createAppropriateOutputObject(messageMediator,
                                          messageMediator.getRequestHeader(),
                                          locateReplyHeader);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        locateReplyHeader.write(outputObject);
        IOR ior = null;
        if (ior != null) {
            ior.write(outputObject);
        }
        if (addrDisp != -1) {
            AddressingDispositionHelper.write(outputObject, addrDisp);
        }
        return;
    }
}
 
Example #28
Source File: ServerRequestInfoImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Set reply message
 */
void setReplyMessage( ReplyMessage replyMessage ) {
    this.replyMessage = replyMessage;
}
 
Example #29
Source File: CorbaMessageMediatorImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior)
{
    // REVISIT - these should be invoked from subcontract.
    runServantPostInvoke(messageMediator);
    runInterceptors(messageMediator, reply);
    runRemoveThreadInfo(messageMediator);

    if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) {
        dprint(".createResponseHelper: "
               + opAndId(messageMediator) + ": "
               + reply);
    }

    messageMediator.setReplyHeader(reply);

    OutputObject replyOutputObject;
    // REVISIT = do not use null.
    //
    if (messageMediator.getConnection() == null) {
        replyOutputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(orb,
                        messageMediator, messageMediator.getReplyHeader(),
                        messageMediator.getStreamFormatVersion(),
                        BufferManagerFactory.GROW);
    } else {
        replyOutputObject = messageMediator.getConnection().getAcceptor()
         .createOutputObject(messageMediator.getBroker(), messageMediator);
    }
    messageMediator.setOutputObject(replyOutputObject);
    messageMediator.getOutputObject().setMessageMediator(messageMediator);

    reply.write((OutputStream) messageMediator.getOutputObject());
    if (reply.getIOR() != null) {
        reply.getIOR().write((OutputStream) messageMediator.getOutputObject());
    }
    // REVISIT - not necessary?
    //messageMediator.this.replyIOR = reply.getIOR();

    // NOTE: The mediator holds onto output object so return value
    // not really necessary.
    return messageMediator;
}
 
Example #30
Source File: ServerRequestInfoImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Set reply message
 */
void setReplyMessage( ReplyMessage replyMessage ) {
    this.replyMessage = replyMessage;
}