com.sun.corba.se.impl.encoding.CDRInputObject Java Examples

The following examples show how to use com.sun.corba.se.impl.encoding.CDRInputObject. 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: 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 #2
Source File: CorbaClientRequestDispatcherImpl.java    From openjdk-8-source 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 #3
Source File: CorbaContactInfoBase.java    From TencentKona-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 #4
Source File: CorbaClientRequestDispatcherImpl.java    From TencentKona-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 #5
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 #6
Source File: SocketOrChannelAcceptorImpl.java    From openjdk-jdk8u 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 #7
Source File: CorbaClientRequestDispatcherImpl.java    From openjdk-jdk8u-backup 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 #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: 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 #10
Source File: CorbaClientRequestDispatcherImpl.java    From jdk1.8-source-analysis with Apache License 2.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 #11
Source File: SocketOrChannelAcceptorImpl.java    From jdk1.8-source-analysis with Apache License 2.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 #12
Source File: SocketOrChannelAcceptorImpl.java    From openjdk-jdk8u-backup 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 #13
Source File: SocketOrChannelAcceptorImpl.java    From TencentKona-8 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 #14
Source File: CorbaClientRequestDispatcherImpl.java    From openjdk-jdk9 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 #15
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 #16
Source File: CorbaContactInfoBase.java    From JDKSourceCode1.8 with MIT License 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 #17
Source File: SocketOrChannelAcceptorImpl.java    From JDKSourceCode1.8 with MIT License 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 #18
Source File: SocketOrChannelAcceptorImpl.java    From openjdk-jdk9 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 #19
Source File: CorbaClientRequestDispatcherImpl.java    From JDKSourceCode1.8 with MIT License 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 #20
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 #21
Source File: CorbaClientRequestDispatcherImpl.java    From hottub 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 #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-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 #24
Source File: CorbaContactInfoBase.java    From hottub 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 #25
Source File: CorbaClientRequestDispatcherImpl.java    From jdk8u60 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 #26
Source File: CorbaResponseWaitingRoomImpl.java    From openjdk-8 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-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected void handleRequestRequest(CorbaMessageMediator messageMediator)
{
    // Does nothing if already unmarshaled.
    ((CDRInputObject)messageMediator.getInputObject()).unmarshalHeader();

    ORB orb = (ORB)messageMediator.getBroker();
    synchronized (orb) {
        orb.checkShutdownState();
    }

    ObjectKey okey = messageMediator.getObjectKey();
    if (orb.subcontractDebugFlag) {
        ObjectKeyTemplate oktemp = okey.getTemplate() ;
        dprint( ".handleRequest: " + opAndId(messageMediator)
                + ": dispatching to scid: " + oktemp.getSubcontractId());
    }

    CorbaServerRequestDispatcher sc = okey.getServerRequestDispatcher(orb);

    if (orb.subcontractDebugFlag) {
        dprint(".handleRequest: " + opAndId(messageMediator)
               + ": dispatching to sc: " + sc);
    }

    if (sc == null) {
        throw wrapper.noServerScInDispatch() ;
    }

    // NOTE:
    // This is necessary so mediator can act as ResponseHandler
    // and pass necessary info to response constructors located
    // in the subcontract.
    // REVISIT - same class right now.
    //messageMediator.setProtocolHandler(this);

    try {
        orb.startingDispatch();
        sc.dispatch(messageMediator);
    } finally {
        orb.finishedDispatch();
    }
}
 
Example #29
Source File: CorbaResponseWaitingRoomImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void signalExceptionToAllWaiters(SystemException systemException)
{

    if (orb.transportDebugFlag) {
        dprint(".signalExceptionToAllWaiters: " + systemException);
    }

    synchronized (out_calls) {
        if (orb.transportDebugFlag) {
            dprint(".signalExceptionToAllWaiters: out_calls size :" +
                   out_calls.size());
        }

        for (OutCallDesc call : out_calls.values()) {
            if (orb.transportDebugFlag) {
                dprint(".signalExceptionToAllWaiters: signaling " +
                        call);
            }
            synchronized(call.done) {
                try {
                    // anything waiting for BufferManagerRead's fragment queue
                    // needs to be cancelled
                    CorbaMessageMediator corbaMsgMediator =
                                 (CorbaMessageMediator)call.messageMediator;
                    CDRInputObject inputObject =
                               (CDRInputObject)corbaMsgMediator.getInputObject();
                    // IMPORTANT: If inputObject is null, then no need to tell
                    //            BufferManagerRead to cancel request processing.
                    if (inputObject != null) {
                        BufferManagerReadStream bufferManager =
                            (BufferManagerReadStream)inputObject.getBufferManager();
                        int requestId = corbaMsgMediator.getRequestId();
                        bufferManager.cancelProcessing(requestId);
                    }
                } catch (Exception e) {
                } finally {
                    // attempt to wake up waiting threads in all cases
                    call.inputObject = null;
                    call.exception = systemException;
                    call.done.notifyAll();
                }
            }
        }
    }
}
 
Example #30
Source File: CorbaResponseWaitingRoomImpl.java    From openjdk-jdk8u-backup 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();
    }
}