ObjectPoolingAttribute クラス
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)

<ComVisibleAttribute(False)> _ <AttributeUsageAttribute(AttributeTargets.Class, Inherited:=True)> _ Public NotInheritable Class ObjectPoolingAttribute Inherits Attribute
[ComVisibleAttribute(false)] [AttributeUsageAttribute(AttributeTargets.Class, Inherited=true)] public sealed class ObjectPoolingAttribute : Attribute
[ComVisibleAttribute(false)] [AttributeUsageAttribute(AttributeTargets::Class, Inherited=true)] public ref class ObjectPoolingAttribute sealed : public Attribute

オブジェクト プーリングを指定した場合、COM+ カタログでは無効にしないでください。オブジェクト プーリングを COM+ カタログで有効にした場合はコンポーネントで指定する必要があります。
ObjectPoolingAttribute のインスタンスの初期プロパティ値の一覧については、ObjectPoolingAttribute コンストラクタのトピックを参照してください。

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.Attribute
System.EnterpriseServices.ObjectPoolingAttribute


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ObjectPoolingAttribute コンストラクタ ()
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)



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


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ObjectPoolingAttribute コンストラクタ (Boolean)
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)


新しい ObjectPoolingAttribute を作成するコード例を次に示します。
<ObjectPooling(True)> _ Public Class ObjectPoolingAttribute_Ctor_Bool Inherits ServicedComponent End Class 'ObjectPoolingAttribute_Ctor_Bool


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ObjectPoolingAttribute コンストラクタ (Int32, Int32)
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)

Dim minPoolSize As Integer Dim maxPoolSize As Integer Dim instance As New ObjectPoolingAttribute(minPoolSize, maxPoolSize)

新しい ObjectPoolingAttribute を作成するコード例を次に示します。
<ObjectPooling(1, 10)> _ Public Class ObjectPoolingAttribute_Ctor_Int_Int Inherits ServicedComponent End Class 'ObjectPoolingAttribute_Ctor_Int_Int


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ObjectPoolingAttribute コンストラクタ

名前 | 説明 |
---|---|
ObjectPoolingAttribute () | ObjectPoolingAttribute クラスの新しいインスタンスを初期化し、Enabled、MaxPoolSize、MinPoolSize、CreationTimeout の各プロパティを既定値に設定します。 |
ObjectPoolingAttribute (Boolean) | ObjectPoolingAttribute クラスの新しいインスタンスを初期化し、Enabled プロパティを設定します。 |
ObjectPoolingAttribute (Int32, Int32) | ObjectPoolingAttribute クラスの新しいインスタンスを初期化し、MaxPoolSize プロパティと MinPoolSize プロパティを設定します。 |
ObjectPoolingAttribute (Boolean, Int32, Int32) | ObjectPoolingAttribute クラスの新しいインスタンスを初期化し、Enabled、MaxPoolSize、MinPoolSize の各プロパティを設定します。 |

ObjectPoolingAttribute コンストラクタ (Boolean, Int32, Int32)
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)

Dim enable As Boolean Dim minPoolSize As Integer Dim maxPoolSize As Integer Dim instance As New ObjectPoolingAttribute(enable, minPoolSize, maxPoolSize)

新しい ObjectPoolingAttribute を作成するコード例を次に示します。
<ObjectPooling(True, 1, 10)> _ Public Class ObjectPoolingAttribute_Ctor_Bool_Int_Int Inherits ServicedComponent End Class 'ObjectPoolingAttribute_Ctor_Bool_Int_Int
[ObjectPooling(true, 1, 10)] public class ObjectPoolingAttribute_Ctor_Bool_Int_Int : ServicedComponent { }


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ObjectPoolingAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() | CreationTimeout | オブジェクトがプール内で使用できるようになり、例外をスローするまでの待機時間の長さを取得または設定します。この値の単位はミリ秒です。 |
![]() | Enabled | オブジェクト プーリングが有効かどうかを示す値を取得または設定します。 |
![]() | MaxPoolSize | プールの最大サイズの値を取得または設定します。 |
![]() | MinPoolSize | プールの最小サイズの値を取得または設定します。 |
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。) |

ObjectPoolingAttribute メソッド


名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

ObjectPoolingAttribute メンバ
コンポーネントのオブジェクト プーリングを有効にして構成します。このクラスは継承できません。
ObjectPoolingAttribute データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | CreationTimeout | オブジェクトがプール内で使用できるようになり、例外をスローするまでの待機時間の長さを取得または設定します。この値の単位はミリ秒です。 |
![]() | Enabled | オブジェクト プーリングが有効かどうかを示す値を取得または設定します。 |
![]() | MaxPoolSize | プールの最大サイズの値を取得または設定します。 |
![]() | MinPoolSize | プールの最小サイズの値を取得または設定します。 |
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。) |


名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

Weblioに収録されているすべての辞書からObjectPoolingAttributeを検索する場合は、下記のリンクをクリックしてください。

- ObjectPoolingAttributeのページへのリンク