com.sun.corba.se.pept.encoding.InputObject Java Examples

The following examples show how to use com.sun.corba.se.pept.encoding.InputObject. 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: SocketOrChannelAcceptorImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #2
Source File: SocketOrChannelAcceptorImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #3
Source File: CorbaMessageMediatorImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
private void endRequest(CorbaMessageMediator messageMediator)
{
    ORB orb = (ORB) messageMediator.getBroker();
    if (orb.subcontractDebugFlag) {
        dprint(".handleRequest<-: " + opAndId(messageMediator));
    }

    // release NIO ByteBuffers to ByteBufferPool

    try {
        OutputObject outputObj = messageMediator.getOutputObject();
        if (outputObj != null) {
            outputObj.close();
        }
        InputObject inputObj = messageMediator.getInputObject();
        if (inputObj != null) {
            inputObj.close();
        }
    } catch (IOException ex) {
        // Given what close() does, this catch shouldn't ever happen.
        // See CDRInput/OutputObject.close() for more info.
        // It also won't result in a Corba error if an IOException happens.
        if (orb.subcontractDebugFlag) {
            dprint(".endRequest: IOException:" + ex.getMessage(), ex);
        }
    } finally {
        ((CorbaConnection)messageMediator.getConnection()).serverRequestProcessingEnds();
    }
}
 
Example #4
Source File: CorbaMessageMediatorImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
private void signalResponseReceived()
{
    // This will end up using the MessageMediator associated with
    // the original request instead of the current mediator (which
    // need to be constructed to hold the dispatchBuffer and connection).
    connection.getResponseWaitingRoom()
        .responseReceived((InputObject)inputObject);
}
 
Example #5
Source File: CorbaMessageMediatorImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void signalResponseReceived()
{
    // This will end up using the MessageMediator associated with
    // the original request instead of the current mediator (which
    // need to be constructed to hold the dispatchBuffer and connection).
    connection.getResponseWaitingRoom()
        .responseReceived((InputObject)inputObject);
}
 
Example #6
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public InputObject waitForResponse()
{
    if (getRequestHeader().isResponseExpected()) {
        return connection.waitForResponse(this);
    }
    return null;
}
 
Example #7
Source File: CorbaClientDelegateImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void releaseReply(org.omg.CORBA.Object self, InputStream input)
{
    // NOTE: InputStream may be null (e.g., exception request from PI).
    ClientRequestDispatcher subcontract = getClientRequestDispatcher();
    subcontract.endRequest(orb, self, (InputObject)input);
    orb.releaseOrDecrementInvocationInfo();
}
 
Example #8
Source File: CorbaContactInfoBase.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    // REVISIT: Duplicate of acceptor code.
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #9
Source File: CorbaClientDelegateImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void releaseReply(org.omg.CORBA.Object self, InputStream input)
{
    // NOTE: InputStream may be null (e.g., exception request from PI).
    ClientRequestDispatcher subcontract = getClientRequestDispatcher();
    subcontract.endRequest(orb, self, (InputObject)input);
    orb.releaseOrDecrementInvocationInfo();
}
 
Example #10
Source File: CorbaClientDelegateImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void releaseReply(org.omg.CORBA.Object self, InputStream input)
{
    // NOTE: InputStream may be null (e.g., exception request from PI).
    ClientRequestDispatcher subcontract = getClientRequestDispatcher();
    subcontract.endRequest(orb, self, (InputObject)input);
    orb.releaseOrDecrementInvocationInfo();
}
 
Example #11
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public InputObject waitForResponse()
{
    if (getRequestHeader().isResponseExpected()) {
        return connection.waitForResponse(this);
    }
    return null;
}
 
Example #12
Source File: CorbaClientRequestDispatcherImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected String peekUserExceptionId(InputObject inputObject)
{
    CDRInputObject cdrInputObject = (CDRInputObject) inputObject;
    // REVISIT - need interface for mark/reset
    cdrInputObject.mark(Integer.MAX_VALUE);
    String result = cdrInputObject.read_string();
    cdrInputObject.reset();
    return result;
}
 
Example #13
Source File: CorbaMessageMediatorImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void endRequest(CorbaMessageMediator messageMediator)
{
    ORB orb = (ORB) messageMediator.getBroker();
    if (orb.subcontractDebugFlag) {
        dprint(".handleRequest<-: " + opAndId(messageMediator));
    }

    // release NIO ByteBuffers to ByteBufferPool

    try {
        OutputObject outputObj = messageMediator.getOutputObject();
        if (outputObj != null) {
            outputObj.close();
        }
        InputObject inputObj = messageMediator.getInputObject();
        if (inputObj != null) {
            inputObj.close();
        }
    } catch (IOException ex) {
        // Given what close() does, this catch shouldn't ever happen.
        // See CDRInput/OutputObject.close() for more info.
        // It also won't result in a Corba error if an IOException happens.
        if (orb.subcontractDebugFlag) {
            dprint(".endRequest: IOException:" + ex.getMessage(), ex);
        }
    } finally {
        ((CorbaConnection)messageMediator.getConnection()).serverRequestProcessingEnds();
    }
}
 
Example #14
Source File: CorbaContactInfoBase.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    // REVISIT: Duplicate of acceptor code.
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #15
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void endRequest(CorbaMessageMediator messageMediator)
{
    ORB orb = (ORB) messageMediator.getBroker();
    if (orb.subcontractDebugFlag) {
        dprint(".handleRequest<-: " + opAndId(messageMediator));
    }

    // release NIO ByteBuffers to ByteBufferPool

    try {
        OutputObject outputObj = messageMediator.getOutputObject();
        if (outputObj != null) {
            outputObj.close();
        }
        InputObject inputObj = messageMediator.getInputObject();
        if (inputObj != null) {
            inputObj.close();
        }
    } catch (IOException ex) {
        // Given what close() does, this catch shouldn't ever happen.
        // See CDRInput/OutputObject.close() for more info.
        // It also won't result in a Corba error if an IOException happens.
        if (orb.subcontractDebugFlag) {
            dprint(".endRequest: IOException:" + ex.getMessage(), ex);
        }
    } finally {
        ((CorbaConnection)messageMediator.getConnection()).serverRequestProcessingEnds();
    }
}
 
Example #16
Source File: SocketOrChannelAcceptorImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #17
Source File: CorbaContactInfoBase.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    // REVISIT: Duplicate of acceptor code.
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #18
Source File: CorbaMessageMediatorImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public InputObject waitForResponse()
{
    if (getRequestHeader().isResponseExpected()) {
        return connection.waitForResponse(this);
    }
    return null;
}
 
Example #19
Source File: CorbaContactInfoBase.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    // REVISIT: Duplicate of acceptor code.
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #20
Source File: CorbaClientDelegateImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void releaseReply(org.omg.CORBA.Object self, InputStream input)
{
    // NOTE: InputStream may be null (e.g., exception request from PI).
    ClientRequestDispatcher subcontract = getClientRequestDispatcher();
    subcontract.endRequest(orb, self, (InputObject)input);
    orb.releaseOrDecrementInvocationInfo();
}
 
Example #21
Source File: CorbaContactInfoBase.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    // REVISIT: Duplicate of acceptor code.
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #22
Source File: CorbaClientRequestDispatcherImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected String peekUserExceptionId(InputObject inputObject)
{
    CDRInputObject cdrInputObject = (CDRInputObject) inputObject;
    // REVISIT - need interface for mark/reset
    cdrInputObject.mark(Integer.MAX_VALUE);
    String result = cdrInputObject.read_string();
    cdrInputObject.reset();
    return result;
}
 
Example #23
Source File: CorbaContactInfoBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public InputObject createInputObject(Broker broker,
                                     MessageMediator messageMediator)
{
    // REVISIT: Duplicate of acceptor code.
    CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
        messageMediator;
    return new CDRInputObject((ORB)broker,
                              (CorbaConnection)messageMediator.getConnection(),
                              corbaMessageMediator.getDispatchBuffer(),
                              corbaMessageMediator.getDispatchHeader());
}
 
Example #24
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void signalResponseReceived()
{
    // This will end up using the MessageMediator associated with
    // the original request instead of the current mediator (which
    // need to be constructed to hold the dispatchBuffer and connection).
    connection.getResponseWaitingRoom()
        .responseReceived((InputObject)inputObject);
}
 
Example #25
Source File: CorbaClientDelegateImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void releaseReply(org.omg.CORBA.Object self, InputStream input)
{
    // NOTE: InputStream may be null (e.g., exception request from PI).
    ClientRequestDispatcher subcontract = getClientRequestDispatcher();
    subcontract.endRequest(orb, self, (InputObject)input);
    orb.releaseOrDecrementInvocationInfo();
}
 
Example #26
Source File: CorbaResponseWaitingRoomImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void responseReceived(InputObject is)
{
    CDRInputObject inputObject = (CDRInputObject) is;
    LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
        inputObject.getMessageHeader();
    Integer requestId = new Integer(header.getRequestId());
    OutCallDesc call = out_calls.get(requestId);

    if (orb.transportDebugFlag) {
        dprint(".responseReceived: id/"
               + requestId  + ": "
               + header);
    }

    // This is an interesting case.  It could mean that someone sent us a
    // reply message, but we don't know what request it was for.  That
    // would probably call for an error.  However, there's another case
    // that's normal and we should think about --
    //
    // If the unmarshaling thread does all of its work inbetween the time
    // the ReaderThread gives it the last fragment and gets to the
    // out_calls.get line, then it will also be null, so just return;
    if (call == null) {
        if (orb.transportDebugFlag) {
            dprint(".responseReceived: id/"
                   + requestId
                   + ": no waiter: "
                   + header);
        }
        return;
    }

    // Set the reply InputObject and signal the client thread
    // that the reply has been received.
    // The thread signalled will remove outcall descriptor if appropriate.
    // Otherwise, it'll be removed when last fragment for it has been put on
    // BufferManagerRead's queue.
    synchronized (call.done) {
        CorbaMessageMediator messageMediator = (CorbaMessageMediator)
            call.messageMediator;

        if (orb.transportDebugFlag) {
            dprint(".responseReceived: "
                   + opAndId(messageMediator)
                   + ": notifying waiters");
        }

        messageMediator.setReplyHeader(header);
        messageMediator.setInputObject(is);
        inputObject.setMessageMediator(messageMediator);
        call.inputObject = is;
        call.done.notify();
    }
}
 
Example #27
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void handleInput(FragmentMessage_1_2 header) throws IOException
{
    try {
        try {
            messageHeader = header;

            // Note:  We know it's a 1.2 fragment, we have the data, but
            // we need the IIOPInputStream instance to unmarshal the
            // request ID... but we need the request ID to get the
            // IIOPInputStream instance. So we peek at the raw bytes.

            header.unmarshalRequestID(dispatchByteBuffer);

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

            MessageMediator mediator = null;
            InputObject inputObject = null;

            if (connection.isServer()) {
                mediator =
                    connection.serverRequestMapGet(header.getRequestId());
            } else {
                mediator =
                    connection.clientRequestMapGet(header.getRequestId());
            }
            if (mediator != null) {
                inputObject = mediator.getInputObject();
            }
            // See 1.1 comments.
            if (inputObject == null) {
                if (transportDebug()) {
                    dprint(".FRAGMENT 1.2: id/"
                           + header.getRequestId()
                           + ": ++++DISCARDING++++: "
                           + header);
                }
                // need to release dispatchByteBuffer to pool if
                // we are discarding
                releaseByteBufferToPool();
                return;
            }
            ((CDRInputObject)inputObject)
                .getBufferManager().processFragment(
                                 dispatchByteBuffer, header);

            // REVISIT: but if it is a server don't you have to remove the
            // stream from the map?
            if (! connection.isServer()) {
                /* REVISIT
                 * No need to do anything.
                 * Should we mark that last was received?
                 if (! header.moreFragmentsToFollow()) {
                 // Last fragment.
                 }
                */
            }
        } finally {
            // NOTE: This *must* come after queing the fragment
            // when using the selector to ensure fragments stay in order.
            setWorkThenReadOrResumeSelect(header);
        }
    } catch (Throwable t) {
        if (transportDebug())
            dprint(".FRAGMENT 1.2: id/"
                   + header.getRequestId()
                   + ": !!ERROR!!: "
                   + header, t);
        // Mask the exception from thread.;
    } finally {
        if (transportDebug()) dprint(".FRAGMENT 1.2<-: id/"
                                     + header.getRequestId()
                                     + ": "
                                     + header);
    }
}
 
Example #28
Source File: CorbaMessageMediatorImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void handleInput(FragmentMessage_1_2 header) throws IOException
{
    try {
        try {
            messageHeader = header;

            // Note:  We know it's a 1.2 fragment, we have the data, but
            // we need the IIOPInputStream instance to unmarshal the
            // request ID... but we need the request ID to get the
            // IIOPInputStream instance. So we peek at the raw bytes.

            header.unmarshalRequestID(dispatchByteBuffer);

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

            MessageMediator mediator = null;
            InputObject inputObject = null;

            if (connection.isServer()) {
                mediator =
                    connection.serverRequestMapGet(header.getRequestId());
            } else {
                mediator =
                    connection.clientRequestMapGet(header.getRequestId());
            }
            if (mediator != null) {
                inputObject = mediator.getInputObject();
            }
            // See 1.1 comments.
            if (inputObject == null) {
                if (transportDebug()) {
                    dprint(".FRAGMENT 1.2: id/"
                           + header.getRequestId()
                           + ": ++++DISCARDING++++: "
                           + header);
                }
                // need to release dispatchByteBuffer to pool if
                // we are discarding
                releaseByteBufferToPool();
                return;
            }
            ((CDRInputObject)inputObject)
                .getBufferManager().processFragment(
                                 dispatchByteBuffer, header);

            // REVISIT: but if it is a server don't you have to remove the
            // stream from the map?
            if (! connection.isServer()) {
                /* REVISIT
                 * No need to do anything.
                 * Should we mark that last was received?
                 if (! header.moreFragmentsToFollow()) {
                 // Last fragment.
                 }
                */
            }
        } finally {
            // NOTE: This *must* come after queing the fragment
            // when using the selector to ensure fragments stay in order.
            setWorkThenReadOrResumeSelect(header);
        }
    } catch (Throwable t) {
        if (transportDebug())
            dprint(".FRAGMENT 1.2: id/"
                   + header.getRequestId()
                   + ": !!ERROR!!: "
                   + header, t);
        // Mask the exception from thread.;
    } finally {
        if (transportDebug()) dprint(".FRAGMENT 1.2<-: id/"
                                     + header.getRequestId()
                                     + ": "
                                     + header);
    }
}
 
Example #29
Source File: SocketOrChannelConnectionImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public InputObject waitForResponse(MessageMediator messageMediator)
{
    return responseWaitingRoom.waitForResponse(messageMediator);
}
 
Example #30
Source File: SocketOrChannelConnectionImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public InputObject waitForResponse(MessageMediator messageMediator)
{
    return responseWaitingRoom.waitForResponse(messageMediator);
}