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, array of String)  protected    (declared in ClassFactory)

 

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

 

SingletonClassFactory(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:

constructor (Type, IServiceActivator, Boolean, array of String, SingletonBehavior, Int32)

 

constructor(serviceClass: Type; activator: IServiceActivator; enforceSessionCheck: Boolean; roles: array of String; singletonBehavior: SingletonBehavior; timeout: Int32)

 

SingletonClassFactory(Type serviceClass, IServiceActivator activator, Boolean enforceSessionCheck, String[] roles, SingletonBehavior singletonBehavior, Int32 timeout)

 

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

Parameters:

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

AcquireInstance

 

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:

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: