SingletonClassFactory

Overview

This class factory allows you to publish a service that follows the Singleton pattern, meaning, that exactly one instance of the service class will be created at a given time and used to serve all requests.

Using the SingletonBehavior option, you can control how concurrent access to the service will be handled, by allowing simultaneous concurrent access (SingletonBehavior.Multiple), by synchronizing all requests so only one of them will be executed at a given time (SingletonBehavior.Wait) or by causing concurrent calls to fail (SingletonBehavior.Fail).

Location

Instance Methods


constructor (Type, IServiceActivator, Boolean)  protected    (declared in ClassFactory)

 

constructor(serviceClass: Type; activator: IServiceActivator; enforceSessionCheck: Boolean)

 

SingletonClassFactory(Type serviceClass, IServiceActivator activator, Boolean enforceSessionCheck)

 

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

Parameters:

  • serviceClass:
  • activator:
  • enforceSessionCheck:

constructor (Type, IServiceActivator, Boolean, SingletonBehavior, Int32)

 

constructor(serviceClass: Type; activator: IServiceActivator; enforceSessionCheck: Boolean; singletonBehavior: SingletonBehavior; timeout: Int32)

 

SingletonClassFactory(Type serviceClass, IServiceActivator activator, Boolean enforceSessionCheck, SingletonBehavior singletonBehavior, Int32 timeout)

 

Sub New(serviceClass As Type, activator As IServiceActivator, enforceSessionCheck As Boolean, singletonBehavior As SingletonBehavior, timeout As Int32)

Parameters:

  • serviceClass:
  • activator:
  • enforceSessionCheck:
  • singletonBehavior:
  • timeout:

AcquireInstance

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:

ReleaseInstance

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: