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)

 

ExpiringClassFactory(Type serviceClass, IServiceActivator activator, Boolean enforceSessionCheck)

 

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

Parameters:

  • serviceClass:
  • activator:
  • enforceSessionCheck:

AcquireInstance    (declared in ClassFactory)

Acquires a new service instance that can be used to execute a remote service call, based on the logic of the class factory implementation.

 

method AcquireInstance(clientId: Guid): IROService

 

IROService AcquireInstance(Guid clientId)

 

Function AcquireInstance(clientId As Guid) As IROService

Parameters:

  • clientId:

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: