Examples of CorbaMessageMediator


Examples of com.sun.corba.se.spi.protocol.CorbaMessageMediator

        // 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();
        }
    }
View Full Code Here

Examples of com.sun.corba.se.spi.protocol.CorbaMessageMediator

            call = (OutCallDesc) e.nextElement();

            synchronized(call.done){
                // 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);
                }
                call.inputObject = null;
                call.exception = systemException;
                call.done.notify();
View Full Code Here

Examples of com.sun.corba.se.spi.protocol.CorbaMessageMediator

    }

    public InputObject createInputObject(Broker broker,
                                         MessageMediator messageMediator)
    {
        CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
            messageMediator;
        return new CDRInputObject((ORB)broker,
                                  (CorbaConnection)messageMediator.getConnection(),
                                  corbaMessageMediator.getDispatchBuffer(),
                                  corbaMessageMediator.getDispatchHeader());
    }
View Full Code Here

Examples of com.sun.corba.se.spi.protocol.CorbaMessageMediator

    }

    public OutputObject createOutputObject(Broker broker,
                                           MessageMediator messageMediator)
    {
        CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
            messageMediator;
        return new CDROutputObject((ORB) broker, corbaMessageMediator,
                                   corbaMessageMediator.getReplyHeader(),
                                   corbaMessageMediator.getStreamFormatVersion());
    }
View Full Code Here

Examples of com.sun.corba.se.spi.protocol.CorbaMessageMediator

        if (connection != null) {
            /// XXX LOGGING
            throw new RuntimeException("connection is not null");
        }

        CorbaMessageMediator messageMediator =
            new CorbaMessageMediatorImpl(
                (ORB) broker,
                contactInfo,
                null, // Connection;
                GIOPVersion.chooseRequestVersion( (ORB)broker,
View Full Code Here

Examples of com.sun.corba.se.spi.protocol.CorbaMessageMediator

        return messageMediator;
    }

    public OutputObject createOutputObject(MessageMediator messageMediator)
    {
        CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
            messageMediator;
        // NOTE: GROW.
        OutputObject outputObject =
            new CDROutputObject(orb, messageMediator,
                                corbaMessageMediator.getRequestHeader(),
                                corbaMessageMediator.getStreamFormatVersion(),
                                BufferManagerFactory.GROW);
        messageMediator.setOutputObject(outputObject);
        return outputObject;
    }
View Full Code Here

Examples of com.sun.corba.se.spi.protocol.CorbaMessageMediator

        return getINSReference( insKey );
    }

    public void dispatch(MessageMediator mediator)
    {
        CorbaMessageMediator request = (CorbaMessageMediator) mediator;
        // send a locate forward with the right IOR. If the insKey is not
        // registered then it will throw OBJECT_NOT_EXIST Exception
        String insKey = new String( request.getObjectKey().getBytes(orb) );
        request.getProtocolHandler()
            .createLocationForward(request, getINSReference( insKey ), null);
        return;
    }
View Full Code Here

Examples of com.sun.corba.se.spi.protocol.CorbaMessageMediator

        }
    }

    public void dispatch(MessageMediator messageMediator)
    {
        CorbaMessageMediator request = (CorbaMessageMediator) messageMediator;
        try {
            if (orb.subcontractDebugFlag) {
                dprint(".dispatch->: " + opAndId(request));
            }

            // to set the codebase information, if any transmitted; and also
            // appropriate ORB Version.
            consumeServiceContexts(request);

            // Now that we have the service contexts processed and the
            // correct ORBVersion set, we must finish initializing the
            // stream.
            ((MarshalInputStream)request.getInputObject())
                .performORBVersionSpecificInit();

            ObjectKey okey = request.getObjectKey();

            // Check that this server is the right server
            try {
                checkServerId(okey);
            } catch (ForwardException fex) {
                if (orb.subcontractDebugFlag) {
                    dprint(".dispatch: " + opAndId(request)
                           + ": bad server id");
                }

                request.getProtocolHandler()
                    .createLocationForward(request, fex.getIOR(), null);
                return;
            }

            String operation = request.getOperationName();
            ObjectAdapter objectAdapter = null ;

            try {
                byte[] objectId = okey.getId().getId() ;
                ObjectKeyTemplate oktemp = okey.getTemplate() ;
                objectAdapter = findObjectAdapter(oktemp);

                java.lang.Object servant = getServantWithPI(request, objectAdapter,
                    objectId, oktemp, operation);

                dispatchToServant(servant, request, objectId, objectAdapter);
            } catch (ForwardException ex) {
                if (orb.subcontractDebugFlag) {
                    dprint(".dispatch: " + opAndId(request)
                           + ": ForwardException caught");
                }

                // Thrown by Portable Interceptors from InterceptorInvoker,
                // through Response constructor.
                request.getProtocolHandler()
                    .createLocationForward(request, ex.getIOR(), null);
            } catch (OADestroyed ex) {
                if (orb.subcontractDebugFlag) {
                    dprint(".dispatch: " + opAndId(request)
                           + ": OADestroyed exception caught");
                }

                // DO NOT CALL THIS HERE:
                // releaseServant(objectAdapter);
                // The problem is that OADestroyed is only thrown by oa.enter, in
                // which case oa.exit should NOT be called, and neither should
                // the invocationInfo stack be popped.

                // Destroyed POAs can be recreated by normal adapter activation.
                // So just restart the dispatch.
                dispatch(request);
            } catch (RequestCanceledException ex) {
                if (orb.subcontractDebugFlag) {
                    dprint(".dispatch: " + opAndId(request)
                           + ": RequestCanceledException caught");
                }

                // IDLJ generated non-tie based skeletons do not catch the
                // RequestCanceledException. Rethrow the exception, which will
                // cause the worker thread to unwind the dispatch and wait for
                // other requests.
                throw ex;
            } catch (UnknownException ex) {
                if (orb.subcontractDebugFlag) {
                    dprint(".dispatch: " + opAndId(request)
                           + ": UnknownException caught " + ex);
                }

                // RMIC generated tie skeletons convert all Throwable exception
                // types (including RequestCanceledException, ThreadDeath)
                // thrown during reading fragments into UnknownException.
                // If RequestCanceledException was indeed raised,
                // then rethrow it, which will eventually cause the worker
                // thread to unstack the dispatch and wait for other requests.
                if (ex.originalEx instanceof RequestCanceledException) {
                    throw (RequestCanceledException) ex.originalEx;
                }

                ServiceContexts contexts = new ServiceContexts(orb);
                UEInfoServiceContext usc = new UEInfoServiceContext(
                    ex.originalEx);

                contexts.put( usc ) ;

                SystemException sysex = wrapper.unknownExceptionInDispatch(
                        CompletionStatus.COMPLETED_MAYBE, ex ) ;
                request.getProtocolHandler()
                    .createSystemExceptionResponse(request, sysex,
                        contexts);
            } catch (Throwable ex) {
                if (orb.subcontractDebugFlag) {
                    dprint(".dispatch: " + opAndId(request)
                           + ": other exception " + ex);
                }
                request.getProtocolHandler()
                    .handleThrowableDuringServerDispatch(
                        request, ex, CompletionStatus.COMPLETED_MAYBE);
            }
            return;
        } finally {
View Full Code Here

Examples of com.sun.corba.se.spi.protocol.CorbaMessageMediator

        try {
            if (orb.subcontractDebugFlag) {
                dprint(".dispatchToServant->: " + opAndId(req));
            }

            CorbaMessageMediator response = null ;

            String operation = req.getOperationName() ;

            SpecialMethod method = SpecialMethod.getSpecialMethod(operation) ;
            if (method != null) {
View Full Code Here

Examples of com.sun.corba.se.spi.protocol.CorbaMessageMediator

        try {
            if (orb.subcontractDebugFlag) {
                dprint(".handleDynamicResult->: " + opAndId(req));
            }

            CorbaMessageMediator response = null ;

            // Check if ServerRequestImpl.result() has been called
            Any excany = sreq.checkResultCalled();

            if (excany == null) { // normal return
                if (orb.subcontractDebugFlag) {
                    dprint(".handleDynamicResult: " + opAndId(req)
                           + ": handling normal result");
                }

                // Marshal out/inout/return parameters into the ReplyMessage
                response = sendingReply(req);
                OutputStream os = (OutputStream) response.getOutputObject();
                sreq.marshalReplyParams(os);
            else {
                if (orb.subcontractDebugFlag) {
                    dprint(".handleDynamicResult: " + opAndId(req)
                           + ": handling error");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.