Пример #1
0
        /// <summary>
        /// Resolve the target type for this request.
        /// </summary>
        internal void ResolveTargetType()
        {
            if (m_requestCallMessage != null)   // is fixed
            {
                throw new BAD_OPERATION(300, CompletionStatus.Completed_MayBe);
            }

            Type   serverType;
            bool   regularOp;
            string calledUri = RequestUri;

            if (!StandardCorbaOps.CheckIfStandardOp(RequestMethodName))
            {
                regularOp  = true; // non-pseude op
                serverType = RemotingServices.GetServerTypeForUri(calledUri);
                if (serverType == null)
                {
                    throw new OBJECT_NOT_EXIST(0, CompletionStatus.Completed_No);
                }
            }
            else
            {
                regularOp  = false;                          // pseude-object op
                calledUri  = StandardCorbaOps.WELLKNOWN_URI; // change object-uri
                serverType = StandardCorbaOps.s_type;
            }
            IsStandardCorbaOperation = !regularOp;
            ServerTypeName           = serverType.FullName;
            ServerTypeType           = serverType;
            CalledUri = calledUri;
        }
Пример #2
0
        /// <summary>
        /// resolve the call to a .net method according to the properties already set.
        /// As a result, update the request message.
        /// </summary>
        /// <remarks>ResolveTargetType must have been called before</remarks>
        internal void ResolveCalledMethod(MethodInfo forRequestMethodName)
        {
            if (ServerTypeType == null)
            {
                // ResolveTargetType not called before
                throw new BAD_OPERATION(305, CompletionStatus.Completed_MayBe);
            }
            MethodInfo callForMethod = forRequestMethodName;
            string     internalMethodName; // the implementation method name

            if (!IsStandardCorbaOperation)
            {
                // The called might be on an explicitely implemented interface, it is this
                // interface type that must be presented to RemotingServices for method call
                // to work:
                ServerTypeName = callForMethod.DeclaringType.FullName;
                ServerTypeType = callForMethod.DeclaringType;

                // handle object specific-ops
                internalMethodName = callForMethod.Name;
                // to handle overloads correctly, add signature info:
                CalledMethodSignature = ReflectionHelper.GenerateSigForMethod(callForMethod);
            }
            else
            {
                // handle standard corba-ops like _is_a
                callForMethod = DecodeStandardOperation(RequestMethodName);
                MethodInfo internalCall =
                    StandardCorbaOps.GetMethodToCallForStandardMethod(callForMethod.Name);
                if (internalCall == null)
                {
                    throw new INTERNAL(2802, CompletionStatus.Completed_MayBe);
                }
                internalMethodName = internalCall.Name;
            }
            CalledMethodName = internalMethodName;
            CalledMethod     = callForMethod;
        }