ExpiringClassFactory

Overview

The ExpiringClassFactory abstract class provides privides methods needed by Class Factories that should periodically expire acquired service instances.

For example, PerClientClassFactory class disposes all service instances acquired by a client if there were no requests from this client for some time.

This class doesn't provide any service instance acquiring functionality, as it's main purpose is to provide common expiration timer handling routines.

Location


Instance Methods


constructor  protected

 

constructor(serviceClass: Type; activator: IServiceActivator; enforceSessionCheck: Boolean; roles: array of String)

 

ExpiringClassFactory(Type serviceClass, IServiceActivator activator, Boolean enforceSessionCheck, String[] roles)

 

Sub New(serviceClass As Type, activator As IServiceActivator, enforceSessionCheck As Boolean, roles As String())

Parameters:

  • serviceClass:
  • activator:
  • enforceSessionCheck:
  • roles:

AcquireInstance    (declared in ClassFactory)

 

method AcquireInstance(clientId: Guid; activate: Boolean): IROService

 

IROService AcquireInstance(Guid clientId, Boolean activate)

 

Function AcquireInstance(clientId As Guid, activate As Boolean) As IROService

Parameters:

  • clientId:
  • activate:

ActivateInstance  protected    (declared in ClassFactory)

 

method ActivateInstance(clientId: Guid; instance: IROService)

 

void ActivateInstance(Guid clientId, IROService instance)

 

Sub ActivateInstance(clientId As Guid, instance As IROService)

Parameters:

  • clientId:
  • instance:

CreateInstance    (declared in ClassFactory)

 

method CreateInstance: IROService

 

IROService CreateInstance()

 

Function CreateInstance() As IROService

DeactivateInstance  protected    (declared in ClassFactory)

 

method DeactivateInstance(clientId: Guid; instance: IROService)

 

void DeactivateInstance(Guid clientId, IROService instance)

 

Sub DeactivateInstance(clientId As Guid, instance As IROService)

Parameters:

  • clientId:
  • instance:

Dispose

Stops and disposes the internal timer.

 

method Dispose

 

void Dispose()

 

Sub Dispose()

DisposeManagedResources  protected

 

method DisposeManagedResources

 

void DisposeManagedResources()

 

Sub DisposeManagedResources()

DisposeNativeResources  protected

 

method DisposeNativeResources

 

void DisposeNativeResources()

 

Sub DisposeNativeResources()

ExpireInstances  protected

Abstract method that is periodically calld by the internal timer.

This method is intended to actually expire outdated service instances and should be redefined in the descendant classes.

 

method ExpireInstances

 

void ExpireInstances()

 

Sub ExpireInstances()

Finalize  protected

 

method Finalize

 

void Finalize()

 

Sub Finalize()

ReleaseInstance    (declared in ClassFactory)

Releases a previously acquired service instance, based on the logic of the class factory implementation.

 

method ReleaseInstance(clientId: Guid; instance: IROService)

 

void ReleaseInstance(Guid clientId, IROService instance)

 

Sub ReleaseInstance(clientId As Guid, instance As IROService)

Parameters:

  • clientId:
  • instance: