Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Ruft die Zeitdauer ab, die gewartet werden soll, bis ein Objekt im Pool verfügbar wird, bevor eine Ausnahme ausgelöst wird, oder legt diese fest. Dieser Wert wird in Millisekunden angegeben.
Namespace: System.EnterpriseServices
Assembly: System.EnterpriseServices (in system.enterpriseservices.dll)
Syntax
'Declaration
Public Property CreationTimeout As Integer
'Usage
Dim instance As ObjectPoolingAttribute
Dim value As Integer
value = instance.CreationTimeout
instance.CreationTimeout = value
public int CreationTimeout { get; set; }
public:
property int CreationTimeout {
int get ();
void set (int value);
}
/** @property */
public int get_CreationTimeout ()
/** @property */
public void set_CreationTimeout (int value)
public function get CreationTimeout () : int
public function set CreationTimeout (value : int)
Eigenschaftenwert
Der Timeoutwert in Millisekunden.
Hinweise
Gibt in Millisekunden an, wie lange ein Client auf die Rückgabe eines Objekts aus dem Pool wartet.
Beispiel
Im folgenden Codebeispiel wird die Verwendung dieser Eigenschaft veranschaulicht.
<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
[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);
}
}
[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);
}
};
/** @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
.NET Framework-Sicherheit
- Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter .
Plattformen
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 unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
ObjectPoolingAttribute-Klasse
ObjectPoolingAttribute-Member
System.EnterpriseServices-Namespace