コード例 #1
0
ファイル: example.cs プロジェクト: cornell-cup/cs-r2-bot
        public string end_toUpper(Ice.AsyncResult r__)
        {
            IceInternal.OutgoingAsync outAsync__ = (IceInternal.OutgoingAsync)r__;
            IceInternal.OutgoingAsync.check__(outAsync__, this, __toUpper_name);
            bool ok__ = outAsync__.wait__();

            try
            {
                if (!ok__)
                {
                    try
                    {
                        outAsync__.throwUserException__();
                    }
                    catch (Ice.UserException ex__)
                    {
                        throw new Ice.UnknownUserException(ex__.ice_name(), ex__);
                    }
                }
                string ret__;
                IceInternal.BasicStream is__ = outAsync__.startReadParams__();
                ret__ = is__.readString();
                outAsync__.endReadParams__();
                return(ret__);
            }
            catch (Ice.LocalException ex)
            {
                Ice.Instrumentation.InvocationObserver obsv__ = outAsync__.getObserver__();
                if (obsv__ != null)
                {
                    obsv__.failed(ex.ice_name());
                }
                throw ex;
            }
        }
コード例 #2
0
 public void attachCollocatedObserver(Ice.ObjectAdapter adapter, int requestId)
 {
     Ice.Instrumentation.InvocationObserver observer = getObserver();
     if (observer != null)
     {
         int size = os_.size() - Protocol.headerSize - 4;
         childObserver_ = observer.getCollocatedObserver(adapter, requestId, size);
         if (childObserver_ != null)
         {
             childObserver_.attach();
         }
     }
 }
コード例 #3
0
 public void attachRemoteObserver(Ice.ConnectionInfo info, Ice.Endpoint endpt, int requestId)
 {
     Ice.Instrumentation.InvocationObserver observer = getObserver();
     if (observer != null)
     {
         int size = os_.size() - Protocol.headerSize - 4;
         childObserver_ = observer.getRemoteObserver(info, endpt, requestId, size);
         if (childObserver_ != null)
         {
             childObserver_.attach();
         }
     }
 }
コード例 #4
0
ファイル: InstrumentationI.cs プロジェクト: stick/zeroc-ice
 public Ice.Instrumentation.InvocationObserver getInvocationObserver(Ice.ObjectPrx prx, string operation,
                                                                     Dictionary <string, string> ctx)
 {
     if (_invocations.isEnabled())
     {
         try
         {
             Ice.Instrumentation.InvocationObserver del = null;
             if (_delegate != null)
             {
                 del = _delegate.getInvocationObserver(prx, operation, ctx);
             }
             return(_invocations.getObserver(new InvocationHelper(prx, operation, ctx), del));
         }
         catch (Exception ex)
         {
             _metrics.getLogger().error("unexpected exception trying to obtain observer:\n" + ex);
         }
     }
     return(null);
 }
コード例 #5
0
            private NProgDistributed.TheIce.MessageDto Send(NProgDistributed.TheIce.MessageDto message, _System.Collections.Generic.Dictionary <string, string> context__, bool explicitContext__)
            {
                if (explicitContext__ && context__ == null)
                {
                    context__ = emptyContext_;
                }
                Ice.Instrumentation.InvocationObserver observer__ = IceInternal.ObserverHelper.get(this, __Send_name, context__);
                int cnt__ = 0;

                try
                {
                    while (true)
                    {
                        Ice.ObjectDel_ delBase__ = null;
                        try
                        {
                            checkTwowayOnly__(__Send_name);
                            delBase__ = getDelegate__(false);
                            IMessageServiceDel_ del__ = (IMessageServiceDel_)delBase__;
                            return(del__.Send(message, context__, observer__));
                        }
                        catch (IceInternal.LocalExceptionWrapper ex__)
                        {
                            handleExceptionWrapper__(delBase__, ex__, observer__);
                        }
                        catch (Ice.LocalException ex__)
                        {
                            handleException__(delBase__, ex__, true, ref cnt__, observer__);
                        }
                    }
                }
                finally
                {
                    if (observer__ != null)
                    {
                        observer__.detach();
                    }
                }
            }
コード例 #6
0
ファイル: example.cs プロジェクト: cornell-cup/cs-r2-bot
        private string toUpper(string s, _System.Collections.Generic.Dictionary <string, string> context__, bool explicitContext__)
        {
            if (explicitContext__ && context__ == null)
            {
                context__ = emptyContext_;
            }
            Ice.Instrumentation.InvocationObserver observer__ = IceInternal.ObserverHelper.get(this, __toUpper_name, context__);
            int cnt__ = 0;

            try
            {
                while (true)
                {
                    Ice.ObjectDel_ delBase__ = null;
                    try
                    {
                        checkTwowayOnly__(__toUpper_name);
                        delBase__ = getDelegate__(false);
                        ConverterDel_ del__ = (ConverterDel_)delBase__;
                        return(del__.toUpper(s, context__, observer__));
                    }
                    catch (IceInternal.LocalExceptionWrapper ex__)
                    {
                        handleExceptionWrapper__(delBase__, ex__, observer__);
                    }
                    catch (Ice.LocalException ex__)
                    {
                        handleException__(delBase__, ex__, true, ref cnt__, observer__);
                    }
                }
            }
            finally
            {
                if (observer__ != null)
                {
                    observer__.detach();
                }
            }
        }
コード例 #7
0
        private void log(string name, string time, string msg, _System.Collections.Generic.Dictionary <string, string> context__, bool explicitContext__)
        {
            if (explicitContext__ && context__ == null)
            {
                context__ = emptyContext_;
            }
            Ice.Instrumentation.InvocationObserver observer__ = IceInternal.ObserverHelper.get(this, __log_name, context__);
            int cnt__ = 0;

            try
            {
                while (true)
                {
                    Ice.ObjectDel_ delBase__ = null;
                    try
                    {
                        delBase__ = getDelegate__(false);
                        RemoteLogDel_ del__ = (RemoteLogDel_)delBase__;
                        del__.log(name, time, msg, context__, observer__);
                        return;
                    }
                    catch (IceInternal.LocalExceptionWrapper ex__)
                    {
                        handleExceptionWrapper__(delBase__, ex__, observer__);
                    }
                    catch (Ice.LocalException ex__)
                    {
                        handleException__(delBase__, ex__, true, ref cnt__, observer__);
                    }
                }
            }
            finally
            {
                if (observer__ != null)
                {
                    observer__.detach();
                }
            }
        }
コード例 #8
0
            public NProgDistributed.TheIce.MessageDto end_Send(Ice.AsyncResult r__)
            {
                IceInternal.OutgoingAsync outAsync__ = (IceInternal.OutgoingAsync)r__;
                IceInternal.OutgoingAsync.check__(outAsync__, this, __Send_name);
                bool ok__ = outAsync__.wait__();

                try
                {
                    if (!ok__)
                    {
                        try
                        {
                            outAsync__.throwUserException__();
                        }
                        catch (Ice.UserException ex__)
                        {
                            throw new Ice.UnknownUserException(ex__.ice_name(), ex__);
                        }
                    }
                    NProgDistributed.TheIce.MessageDto ret__;
                    IceInternal.BasicStream            is__ = outAsync__.startReadParams__();
                    IceInternal.ParamPatcher <NProgDistributed.TheIce.MessageDto> ret__PP = new IceInternal.ParamPatcher <NProgDistributed.TheIce.MessageDto>(NProgDistributed.TheIce.MessageDto.ice_staticId());
                    is__.readObject(ret__PP);
                    is__.readPendingObjects();
                    outAsync__.endReadParams__();
                    ret__ = ret__PP.value;
                    return(ret__);
                }
                catch (Ice.LocalException ex)
                {
                    Ice.Instrumentation.InvocationObserver obsv__ = outAsync__.getObserver__();
                    if (obsv__ != null)
                    {
                        obsv__.failed(ex.ice_name());
                    }
                    throw ex;
                }
            }
コード例 #9
0
 public NProgDistributed.TheIce.MessageDto Send(NProgDistributed.TheIce.MessageDto message, _System.Collections.Generic.Dictionary <string, string> context__, Ice.Instrumentation.InvocationObserver observer__)
 {
     Ice.Current current__ = new Ice.Current();
     initCurrent__(ref current__, "Send", Ice.OperationMode.Normal, context__);
     NProgDistributed.TheIce.MessageDto result__ = null;
     IceInternal.Direct.RunDelegate run__ = delegate(Ice.Object obj__)
     {
         IMessageService servant__ = null;
         try
         {
             servant__ = (IMessageService)obj__;
         }
         catch (_System.InvalidCastException)
         {
             throw new Ice.OperationNotExistException(current__.id, current__.facet, current__.operation);
         }
         result__ = servant__.Send(message, current__);
         return(Ice.DispatchStatus.DispatchOK);
     };
     IceInternal.Direct direct__ = null;
     try
     {
         direct__ = new IceInternal.Direct(current__, run__);
         try
         {
             Ice.DispatchStatus status__ = direct__.getServant().collocDispatch__(direct__);
             _System.Diagnostics.Debug.Assert(status__ == Ice.DispatchStatus.DispatchOK);
         }
         finally
         {
             direct__.destroy();
         }
     }
     catch (Ice.SystemException)
     {
         throw;
     }
     catch (_System.Exception ex__)
     {
         IceInternal.LocalExceptionWrapper.throwWrapper(ex__);
     }
     return(result__);
 }
コード例 #10
0
 public NProgDistributed.TheIce.MessageDto Send(NProgDistributed.TheIce.MessageDto message, _System.Collections.Generic.Dictionary <string, string> context__, Ice.Instrumentation.InvocationObserver observer__)
 {
     IceInternal.Outgoing og__ = handler__.getOutgoing("Send", Ice.OperationMode.Normal, context__, observer__);
     try
     {
         try
         {
             IceInternal.BasicStream os__ = og__.startWriteParams(Ice.FormatType.DefaultFormat);
             os__.writeObject(message);
             os__.writePendingObjects();
             og__.endWriteParams();
         }
         catch (Ice.LocalException ex__)
         {
             og__.abort(ex__);
         }
         bool ok__ = og__.invoke();
         try
         {
             if (!ok__)
             {
                 try
                 {
                     og__.throwUserException();
                 }
                 catch (Ice.UserException ex__)
                 {
                     throw new Ice.UnknownUserException(ex__.ice_name(), ex__);
                 }
             }
             IceInternal.BasicStream            is__ = og__.startReadParams();
             NProgDistributed.TheIce.MessageDto ret__;
             IceInternal.ParamPatcher <NProgDistributed.TheIce.MessageDto> ret__PP = new IceInternal.ParamPatcher <NProgDistributed.TheIce.MessageDto>(NProgDistributed.TheIce.MessageDto.ice_staticId());
             is__.readObject(ret__PP);
             is__.readPendingObjects();
             og__.endReadParams();
             ret__ = ret__PP.value;
             return(ret__);
         }
         catch (Ice.LocalException ex__)
         {
             throw new IceInternal.LocalExceptionWrapper(ex__, false);
         }
     }
     finally
     {
         handler__.reclaimOutgoing(og__);
     }
 }
コード例 #11
0
ファイル: example.cs プロジェクト: cornell-cup/cs-r2-bot
 public string toUpper(string s, _System.Collections.Generic.Dictionary <string, string> context__, Ice.Instrumentation.InvocationObserver observer__)
 {
     IceInternal.Outgoing og__ = handler__.getOutgoing("toUpper", Ice.OperationMode.Normal, context__, observer__);
     try
     {
         try
         {
             IceInternal.BasicStream os__ = og__.startWriteParams(Ice.FormatType.DefaultFormat);
             os__.writeString(s);
             og__.endWriteParams();
         }
         catch (Ice.LocalException ex__)
         {
             og__.abort(ex__);
         }
         bool ok__ = og__.invoke();
         try
         {
             if (!ok__)
             {
                 try
                 {
                     og__.throwUserException();
                 }
                 catch (Ice.UserException ex__)
                 {
                     throw new Ice.UnknownUserException(ex__.ice_name(), ex__);
                 }
             }
             IceInternal.BasicStream is__ = og__.startReadParams();
             string ret__;
             ret__ = is__.readString();
             og__.endReadParams();
             return(ret__);
         }
         catch (Ice.LocalException ex__)
         {
             throw new IceInternal.LocalExceptionWrapper(ex__, false);
         }
     }
     finally
     {
         handler__.reclaimOutgoing(og__);
     }
 }
コード例 #12
0
 public void log(string name, string time, string msg, _System.Collections.Generic.Dictionary <string, string> context__, Ice.Instrumentation.InvocationObserver observer__)
 {
     Ice.Current current__ = new Ice.Current();
     initCurrent__(ref current__, "log", Ice.OperationMode.Normal, context__);
     IceInternal.Direct.RunDelegate run__ = delegate(Ice.Object obj__)
     {
         RemoteLog servant__ = null;
         try
         {
             servant__ = (RemoteLog)obj__;
         }
         catch (_System.InvalidCastException)
         {
             throw new Ice.OperationNotExistException(current__.id, current__.facet, current__.operation);
         }
         servant__.log(name, time, msg, current__);
         return(Ice.DispatchStatus.DispatchOK);
     };
     IceInternal.Direct direct__ = null;
     try
     {
         direct__ = new IceInternal.Direct(current__, run__);
         try
         {
             Ice.DispatchStatus status__ = direct__.getServant().collocDispatch__(direct__);
             _System.Diagnostics.Debug.Assert(status__ == Ice.DispatchStatus.DispatchOK);
         }
         finally
         {
             direct__.destroy();
         }
     }
     catch (Ice.SystemException)
     {
         throw;
     }
     catch (_System.Exception ex__)
     {
         IceInternal.LocalExceptionWrapper.throwWrapper(ex__);
     }
 }
コード例 #13
0
 public void log(string name, string time, string msg, _System.Collections.Generic.Dictionary <string, string> context__, Ice.Instrumentation.InvocationObserver observer__)
 {
     IceInternal.Outgoing og__ = handler__.getOutgoing("log", Ice.OperationMode.Normal, context__, observer__);
     try
     {
         try
         {
             IceInternal.BasicStream os__ = og__.startWriteParams(Ice.FormatType.DefaultFormat);
             os__.writeString(name);
             os__.writeString(time);
             os__.writeString(msg);
             og__.endWriteParams();
         }
         catch (Ice.LocalException ex__)
         {
             og__.abort(ex__);
         }
         bool ok__ = og__.invoke();
         if (og__.hasResponse())
         {
             try
             {
                 if (!ok__)
                 {
                     try
                     {
                         og__.throwUserException();
                     }
                     catch (Ice.UserException ex__)
                     {
                         throw new Ice.UnknownUserException(ex__.ice_name(), ex__);
                     }
                 }
                 og__.readEmptyParams();
             }
             catch (Ice.LocalException ex__)
             {
                 throw new IceInternal.LocalExceptionWrapper(ex__, false);
             }
         }
     }
     finally
     {
         handler__.reclaimOutgoing(og__);
     }
 }