internal void SetCurrentConnection(Connection conn, ServerRequestInfo ri)
        {
            Object guid;

            SetCurrentConnection(conn, out guid);
            if (conn != null && guid != null)
            {
                ri.set_slot(_connectionIdSlotId, guid);
            }
        }
Exemple #2
0
        /// <inheritdoc />
        public void receive_request_service_contexts(ServerRequestInfo ri)
        {
            string interceptedOperation = ri.operation;

            Logger.Info(String.Format(
                            "A operação '{0}' foi interceptada no servidor.", interceptedOperation));

            bool           legacyContext;
            ServiceContext serviceContext = GetContextFromRequestInfo(ri, true,
                                                                      out legacyContext);
            AnyCredential anyCredential = new AnyCredential(serviceContext,
                                                            legacyContext);

            Logger.Debug(
                String.Format("A operação '{0}' possui credencial. É legada? {1}.",
                              interceptedOperation, anyCredential.Legacy));

            ConnectionImpl conn = null;

            try {
                conn = GetDispatcherForRequest(ri, anyCredential) as ConnectionImpl;
                if (conn == null)
                {
                    Logger.Error(
                        "Sem conexão ao barramento, impossível receber a chamada remota.");
                    throw new NO_PERMISSION(UnknownBusCode.ConstVal,
                                            CompletionStatus.Completed_No);
                }
                if ((!conn.Legacy) && (anyCredential.Legacy))
                {
                    Logger.Error(
                        String.Format(
                            "Chamada negada devido a suporte legado inativo: login {0} operação {1} requestId {2}",
                            anyCredential.Login, interceptedOperation,
                            ri.request_id));
                    throw new NO_PERMISSION(NoCredentialCode.ConstVal, CompletionStatus.Completed_No);
                }
                Context.SetCurrentConnection(conn, ri);
                conn.ReceiveRequest(ri, anyCredential);
            }
            catch (InvalidSlot e) {
                Logger.Fatal("Falha ao inserir a credencial em seu slot.", e);
                throw;
            }
            finally {
                if (conn != null)
                {
                    ri.set_slot(ReceivingConnectionSlotId, conn);
                }
            }
        }
Exemple #3
0
 public void receive_request(ServerRequestInfo ri)
 {
     // modify request scope after copy to the thread scope -> must not be propagated to the thread scope.
     if (ri.operation == "TestReceiveReqNotChangeThreadScope")
     {
         ri.set_slot(m_slotId, 2 * (int)ri.get_slot(m_slotId));
     }
     else if (ri.operation == "TestReceiveReqChangeThreadScope")
     {
         ORB orb = OrbServices.GetSingleton();
         omg.org.PortableInterceptor.Current current =
             (omg.org.PortableInterceptor.Current)orb.resolve_initial_references("PICurrent");
         current.set_slot(m_slotId, 3 * (int)current.get_slot(m_slotId));
     }
 }
Exemple #4
0
        public void receive_request_service_contexts(ServerRequestInfo ri)
        {
            object contextAsObject;

            try {
                contextAsObject = ri.get_request_service_context(1000);
            } catch (BAD_PARAM) {
                contextAsObject = null;
            }
            if (contextAsObject != null)
            {
                ServiceContext     context         = (ServiceContext)contextAsObject;
                TestServiceContext contextReceived = (TestServiceContext)m_codec.decode(context.context_data);
                ri.set_slot(m_slotId, contextReceived.TestEntry);
            }
        }
 public void receive_request(ServerRequestInfo ri) {
     // modify request scope after copy to the thread scope -> must not be propagated to the thread scope.
     if (ri.operation == "TestReceiveReqNotChangeThreadScope") {
         ri.set_slot(m_slotId, 2 * (int)ri.get_slot(m_slotId));
     } else if (ri.operation == "TestReceiveReqChangeThreadScope") {
         ORB orb = OrbServices.GetSingleton();
         omg.org.PortableInterceptor.Current current = 
             (omg.org.PortableInterceptor.Current)orb.resolve_initial_references("PICurrent");
         current.set_slot(m_slotId, 3 * (int)current.get_slot(m_slotId));
     }
 }
 public void receive_request_service_contexts(ServerRequestInfo ri) {
     object contextAsObject;
     try {
         contextAsObject = ri.get_request_service_context(1000);
     } catch (BAD_PARAM) {
         contextAsObject = null;
     }
     if (contextAsObject != null) {
         ServiceContext context = (ServiceContext)contextAsObject;
         TestServiceContext contextReceived = (TestServiceContext)m_codec.decode(context.context_data);
         ri.set_slot(m_slotId, contextReceived.TestEntry);
     }
 }