JustInTimeActivationAttributeとは? わかりやすく解説

JustInTimeActivationAttribute クラス

ジャスト イン タイム (JIT: Just-In-Time) のアクティベーションオンまたはオフにします。このクラス継承できません。

名前空間: System.EnterpriseServices
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)
構文構文

<AttributeUsageAttribute(AttributeTargets.Class, Inherited:=True)> _
<ComVisibleAttribute(False)> _
Public NotInheritable Class
 JustInTimeActivationAttribute
    Inherits Attribute
Dim instance As JustInTimeActivationAttribute
[AttributeUsageAttribute(AttributeTargets.Class, Inherited=true)]
 
[ComVisibleAttribute(false)] 
public sealed class JustInTimeActivationAttribute
 : Attribute
[AttributeUsageAttribute(AttributeTargets::Class, Inherited=true)]
 
[ComVisibleAttribute(false)] 
public ref class JustInTimeActivationAttribute
 sealed : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class, Inherited=true)
 */ 
/** @attribute ComVisibleAttribute(false) */ 
public final class JustInTimeActivationAttribute
 extends Attribute
AttributeUsageAttribute(AttributeTargets.Class, Inherited=true)
 
ComVisibleAttribute(false) 
public final class JustInTimeActivationAttribute
 extends Attribute
解説解説
使用例使用例

この属性使用方法コード例次に示します

Imports System
Imports System.EnterpriseServices
Imports System.Windows.Forms



<Assembly: ApplicationName("ObjectInspector")>
 
<Assembly: ApplicationActivation(ActivationOption.Server)> 
<Assembly: System.Reflection.AssemblyKeyFile("Inspector.snk")>
 
 
<JustInTimeActivation(), ObjectPooling(MinPoolSize := 2, MaxPoolSize := 100, CreationTimeout
 := 1000)>  _
Public Class ObjectInspector
    Inherits ServicedComponent
    
    
    Public Function IdentifyObject(ByVal
 obj As [Object]) As String
 
        ' Return this object to the pool after use.
        ContextUtil.DeactivateOnReturn = True
        
        ' Get the supplied object's type.        
        Dim objType As Type = obj.GetType()
        
        ' Return its name.
        Return objType.FullName
    
    End Function 'IdentifyObject

    Protected Overrides Sub
 Activate() 
        MessageBox.Show(String.Format("Now
 entering..." + vbLf + "Application: {0}"
 + vbLf + "Instance: {1}" + vbLf + "Context: {2}" + vbLf, ContextUtil.ApplicationId.ToString(), ContextUtil.ApplicationInstanceId.ToString(),
 ContextUtil.ContextId.ToString()))
    
    End Sub 'Activate

    Protected Overrides Sub
 Deactivate() 
        MessageBox.Show("Bye Bye!")
    
    End Sub 'Deactivate

    ' This object can be pooled.
    Protected Overrides Function
 CanBePooled() As Boolean 
        Return True
    
    End Function 'CanBePooled

End Class 'ObjectInspector
using System;
using System.EnterpriseServices;
using System.Windows.Forms;

[assembly: ApplicationName("ObjectInspector")]
[assembly: ApplicationActivation(ActivationOption.Server)]
[assembly: System.Reflection.AssemblyKeyFile("Inspector.snk")]

[JustInTimeActivation]
[ObjectPooling(MinPoolSize=2, MaxPoolSize=100, CreationTimeout=1000)]
public class ObjectInspector : ServicedComponent
{

    public string IdentifyObject (Object obj)
    {
        // Return this object to the pool after use.
        ContextUtil.DeactivateOnReturn = true;

        // Get the supplied object's type.        
        Type objType = obj.GetType();
        
        // Return its name.
        return(objType.FullName);

    }

    protected override void Activate()
    {
        MessageBox.Show( String.Format("Now entering...\nApplication: {0}\nInstance:
 {1}\nContext: {2}\n",
                                       ContextUtil.ApplicationId.ToString(), ContextUtil.ApplicationInstanceId.ToString()
,
                                       ContextUtil.ContextId.ToString() ) );
    }

    protected override void Deactivate()
    {
        MessageBox.Show("Bye Bye!");
    }

    // This object can be pooled.
    protected override bool CanBePooled()
    {
        return(true);
    }

}
#using <System.Windows.Forms.dll>
#using <System.Transactions.dll>
#using <System.EnterpriseServices.dll>

using namespace System;
using namespace System::EnterpriseServices;
using namespace System::Windows::Forms;


[assembly:ApplicationName("ObjectInspector")];
[assembly:ApplicationActivation(ActivationOption::Server)];
[assembly:System::Reflection::AssemblyKeyFile("Inspector.snk")];
[JustInTimeActivation]
[ObjectPooling(MinPoolSize=2,MaxPoolSize=100,CreationTimeout=1000)]
public ref class ObjectInspector: public
 ServicedComponent
{
public:
   String^ IdentifyObject( Object^ obj )
   {
      // Return this object to the pool after use.
      ContextUtil::DeactivateOnReturn = true;

      // Get the supplied object's type.        
      Type^ objType = obj->GetType();

      // Return its name.
      return (objType->FullName);
   }

protected:
   virtual void Activate() override
   {
      MessageBox::Show( String::Format( "Now entering...\nApplication: {0}\nInstance:
 {1}\nContext: {2}\n", ContextUtil::ApplicationId.ToString(), ContextUtil::ApplicationInstanceId.ToString(),
 ContextUtil::ContextId.ToString() ) );
   }

   virtual void Deactivate() override
   {
      MessageBox::Show( "Bye Bye!" );
   }

   // This object can be pooled.
   virtual bool CanBePooled() override
   {
      return (true);
   }
};
import System.*;
import System.EnterpriseServices.*;
import System.Windows.Forms.*;

/** @assembly ApplicationName("ObjectInspector")
 */
/** @assembly ApplicationActivation(ActivationOption.Server)
 */
/** @assembly System.Reflection.AssemblyKeyFile("Inspector.snk")
 */

/** @attribute JustInTimeActivation()
 */
/** @attribute ObjectPooling(MinPoolSize = 2, MaxPoolSize = 100, 
    CreationTimeout = 1000)
 */
public class ObjectInspector extends ServicedComponent
{
    public String IdentifyObject(Object obj)
    {
        // Return this object to the pool after use.
        ContextUtil.set_DeactivateOnReturn(true);
        // Get the supplied object's type.        
        Type objType = obj.GetType();
        // Return its name.
        return objType.get_FullName();
    } //IdentifyObject

    protected void Activate()
    {
        MessageBox.Show(String.Format("Now entering...\nApplication: {0}\n"
            + "Instance: {1}\nContext: {2}\n",
            ContextUtil.get_ApplicationId().ToString(),
            ContextUtil.get_ApplicationInstanceId().ToString(),
            ContextUtil.get_ContextId().ToString()));
    } //Activate

    protected void Deactivate()
    {
        MessageBox.Show("Bye Bye!");
    } //Deactivate

    // This object can be pooled.
    protected boolean CanBePooled()
    {
        return true;
    } //CanBePooled
} //ObjectInspector 
継承階層継承階層
System.Object
   System.Attribute
    System.EnterpriseServices.JustInTimeActivationAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

JustInTimeActivationAttribute コンストラクタ ()

JustInTimeActivationAttribute クラス新しインスタンス初期化します。既定コンストラクタによってジャスト イン タイム (JIT: Just-In-Time) アクティベーション有効にされます

名前空間: System.EnterpriseServices
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)
構文構文

Dim instance As New JustInTimeActivationAttribute
public JustInTimeActivationAttribute ()
public:
JustInTimeActivationAttribute ()
public JustInTimeActivationAttribute ()
public function JustInTimeActivationAttribute
 ()
使用例使用例

新しJustInTimeActivationAttribute作成するコード例次に示します

<JustInTimeActivation()>  _
Public Class JITAAttribute_Ctor
    Inherits ServicedComponent
End Class 'JITAAttribute_Ctor
[JustInTimeActivation]
public class JITAAttribute_Ctor : ServicedComponent
{
}
/** @attribute JustInTimeActivation()
 */
public class JITAAttribute_Ctor extends ServicedComponent
{
} //JITAAttribute_Ctor
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
JustInTimeActivationAttribute クラス
JustInTimeActivationAttribute メンバ
System.EnterpriseServices 名前空間

JustInTimeActivationAttribute コンストラクタ

JustInTimeActivationAttribute クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
JustInTimeActivationAttribute () JustInTimeActivationAttribute クラス新しインスタンス初期化します。既定コンストラクタによってジャスト イン タイム (JIT: Just-In-Time) アクティベーション有効にされます
JustInTimeActivationAttribute (Boolean) JustInTimeActivationAttribute クラス新しインスタンス初期化してfalseパラメータとして渡すことにより、オプションジャスト イン タイム (JIT) アクティベーション無効にできるようにします。
参照参照

関連項目

JustInTimeActivationAttribute クラス
JustInTimeActivationAttribute メンバ
System.EnterpriseServices 名前空間

JustInTimeActivationAttribute コンストラクタ (Boolean)

JustInTimeActivationAttribute クラス新しインスタンス初期化してfalseパラメータとして渡すことにより、オプションジャスト イン タイム (JIT) アクティベーション無効にできるようにします。

名前空間: System.EnterpriseServices
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)
構文構文

Dim val As Boolean

Dim instance As New JustInTimeActivationAttribute(val)
public JustInTimeActivationAttribute (
    bool val
)
public:
JustInTimeActivationAttribute (
    bool val
)
public JustInTimeActivationAttribute (
    boolean val
)
public function JustInTimeActivationAttribute
 (
    val : boolean
)

パラメータ

val

JIT アクティベーション有効にする場合trueそれ以外場合false

解説解説

トランザクションの TransactionOption 値が SupportedRequiredRequiresNewいずれかである場合JIT アクティベーションが必要であり、valfalse設定できません。

使用例使用例

新しJustInTimeActivationAttribute作成するコード例次に示します

<JustInTimeActivation(False)>  _
Public Class JITAAttribute_Ctor_Bool
    Inherits ServicedComponent
End Class 'JITAAttribute_Ctor_Bool
[JustInTimeActivation(false)]
public class JITAAttribute_Ctor_Bool : ServicedComponent
{
}
/** @attribute JustInTimeActivation(false)
 */
public class JITAAttribute_Ctor_Bool extends
 ServicedComponent
{
} //JITAAttribute_Ctor_Bool
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
JustInTimeActivationAttribute クラス
JustInTimeActivationAttribute メンバ
System.EnterpriseServices 名前空間

JustInTimeActivationAttribute プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ TypeId  派生クラス実装されている場合は、この Attribute一意識別子取得します。 ( Attribute から継承されます。)
パブリック プロパティ Value JustInTimeActivationAttribute 設定の値を取得します
参照参照

関連項目

JustInTimeActivationAttribute クラス
System.EnterpriseServices 名前空間

JustInTimeActivationAttribute メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスハッシュ コード返します。 ( Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 ( Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

JustInTimeActivationAttribute クラス
System.EnterpriseServices 名前空間

JustInTimeActivationAttribute メンバ

ジャスト イン タイム (JIT: Just-In-Time) のアクティベーションオンまたはオフにします。このクラス継承できません。

JustInTimeActivationAttribute データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド JustInTimeActivationAttribute オーバーロードされます。 JustInTimeActivationAttribute クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ TypeId  派生クラス実装されている場合は、この Attribute一意識別子取得します。(Attribute から継承されます。)
パブリック プロパティ Value JustInTimeActivationAttribute 設定の値を取得します
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスハッシュ コード返します。 (Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 (Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

JustInTimeActivationAttribute クラス
System.EnterpriseServices 名前空間



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

辞書ショートカット

すべての辞書の索引

「JustInTimeActivationAttribute」の関連用語

JustInTimeActivationAttributeのお隣キーワード
検索ランキング

   

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



JustInTimeActivationAttributeのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS