IMethodMessage.LogicalCallContext プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > IMethodMessage.LogicalCallContext プロパティの意味・解説 

IMethodMessage.LogicalCallContext プロパティ

現在のメソッド呼び出しの LogicalCallContext を取得します

名前空間: System.Runtime.Remoting.Messaging
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

ReadOnly Property LogicalCallContext As
 LogicalCallContext
Dim instance As IMethodMessage
Dim value As LogicalCallContext

value = instance.LogicalCallContext
LogicalCallContext LogicalCallContext { get; }
property LogicalCallContext^ LogicalCallContext {
    LogicalCallContext^ get ();
}
/** @property */
LogicalCallContext get_LogicalCallContext ()
function get LogicalCallContext () : LogicalCallContext

プロパティ
現在のメソッド呼び出しLogicalCallContext取得します

例外例外
使用例使用例

何らかの値が論理スレッド結び付けられているかどうか確認する LogicalCallContext プロパティ使用方法については、次のコード例参照してください

Public Class MyProxy
   Inherits RealProxy

   Private stringUri As String
   Private targetObject As MarshalByRefObject

   <SecurityPermission(SecurityAction.LinkDemand)> _
   Public Sub New(type As
 Type)
      MyBase.New(type)
      targetObject = CType(Activator.CreateInstance(type), MarshalByRefObject)
      Dim myObject As ObjRef = RemotingServices.Marshal(targetObject)
      stringUri = myObject.URI
   End Sub 'New

<SecurityPermission(SecurityAction.LinkDemand)> _
   Public Sub New(type As
 Type, targetObject As MarshalByRefObject)
      MyBase.New(type)
      Me.targetObject = targetObject
   End Sub 'New


<SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags:=SecurityPermissionFlag.Infrastructure)>
 _
   Public Overrides Function
 Invoke(message As IMessage) As IMessage
      message.Properties("__Uri") = stringUri
      Dim myMethodMessage As IMethodMessage
 = _
            CType(ChannelServices.SyncDispatchMessage(message), IMethodMessage)
      Console.WriteLine("---------IMethodMessage example-------")
      Console.WriteLine("Method name : " + myMethodMessage.MethodName)
      Console.WriteLine("LogicalCallContext has information :
 " + _
            myMethodMessage.LogicalCallContext.HasInfo.ToString())
      Console.WriteLine("Uri : " + myMethodMessage.Uri)
      Return myMethodMessage
   End Function 'Invoke

End Class 'MyProxy
   public class MyProxy : RealProxy
   {

   String stringUri;
   MarshalByRefObject targetObject;

[SecurityPermission(SecurityAction.LinkDemand)]
public MyProxy(Type type) : base(type)
{
      targetObject = (MarshalByRefObject)Activator.CreateInstance(type);
      ObjRef myObject = RemotingServices.Marshal(targetObject);
      stringUri = myObject.URI;
   }

   [SecurityPermission(SecurityAction.LinkDemand)]
   public MyProxy(Type type, MarshalByRefObject targetObject)
 : base(type)
   {
      this.targetObject = targetObject;
   }


[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.Infrastructure)]
   public override IMessage Invoke(IMessage message)
   {
      message.Properties["__Uri"] = stringUri;
      IMethodMessage myMethodMessage = 
         (IMethodMessage)ChannelServices.SyncDispatchMessage(message);

      Console.WriteLine("---------IMethodMessage example-------");
      Console.WriteLine("Method name : " + myMethodMessage.MethodName);
      Console.WriteLine("LogicalCallContext has information : " +
         myMethodMessage.LogicalCallContext.HasInfo);
      Console.WriteLine("Uri : " + myMethodMessage.Uri);

      return myMethodMessage;
   }
}

//This sample requires full trust
[PermissionSetAttribute(SecurityAction::Demand, Name = "FullTrust")]
public ref class MyProxy: public
 RealProxy
{
private:
   String^ stringUri;
   MarshalByRefObject^ targetObject;

public:
   MyProxy( Type^ type )
      : RealProxy( type )
   {
      targetObject = dynamic_cast<MarshalByRefObject^>(Activator::CreateInstance(
 type ));
      ObjRef^ myObject = RemotingServices::Marshal( targetObject );
      stringUri = myObject->URI;
   }

   MyProxy( Type^ type, MarshalByRefObject^ targetObject )
      : RealProxy( type )
   {
      this->targetObject = targetObject;
   }

   virtual IMessage^ Invoke( IMessage^ message ) override
   {
      message->Properties[ "__Uri" ] = stringUri;
      IMethodMessage^ myMethodMessage = dynamic_cast<IMethodMessage^>(ChannelServices::SyncDispatchMessage(
 message ));
      Console::WriteLine( "---------IMethodMessage* example-------" );
      Console::WriteLine( "Method name : {0}", myMethodMessage->MethodName
 );
      Console::WriteLine( "LogicalCallContext has information : {0}", myMethodMessage->LogicalCallContext->HasInfo
 );
      Console::WriteLine( "Uri : {0}", myMethodMessage->Uri );
      return myMethodMessage;
   }
};
/** @attribute SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.Infrastructure)public
 class MyProxyAttribute extends ProxyAttribute
 */
public class MyProxy extends RealProxy
{
    private String stringUri;
    private MarshalByRefObject targetObject;
   
    public MyProxy(Type type)
    {
        super(type);
        targetObject =(MarshalByRefObject)Activator.CreateInstance(type);
        ObjRef myObject = RemotingServices.Marshal(targetObject);
        stringUri = myObject.get_URI();
    } //MyProxy
      
    public MyProxy(Type type, MarshalByRefObject targetObject)
    {
        super(type);
        this.targetObject = targetObject;
    } //MyProxy
      
    public IMessage Invoke(IMessage message) 
    {
        message.get_Properties() .set_Item( "__Uri" , stringUri );
        IMethodMessage myMethodMessage
            = (IMethodMessage)ChannelServices.SyncDispatchMessage(message);
      
        Console.WriteLine("---------IMethodMessage example-------");
        Console.WriteLine("Method name : " + myMethodMessage.get_MethodName());
        Console.WriteLine("LogicalCallContext has information : " 
            + myMethodMessage.get_LogicalCallContext().get_HasInfo());
        Console.WriteLine("Uri : " + myMethodMessage.get_Uri());
      
        return myMethodMessage ;
    } //Invoke
} //MyProxy

.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
IMethodMessage インターフェイス
IMethodMessage メンバ
System.Runtime.Remoting.Messaging 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

IMethodMessage.LogicalCallContext プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



IMethodMessage.LogicalCallContext プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS