Service

Overview

The Service base class provides a base implementation that can (but need not) be used as the ancestor for your custom service implementations. This class implements the Interface IActivatableService, Interface IChannelAwareService, Interface IDisposableService and Interface IRolesAwareService interfaces and provides access to the session and event sink management architecture.

Note: While this class is not marked as abstract it cannot be instantiated and used directly.

Location

Implements

 

constructor  protected

Creates a new instance of the Service class.

 

constructor

 

Service()

 

Sub New

constructor (ISessionManager)  protected

Creates a new instance of the Service class and sets the session manager and event sink manager instances that will be used later by the service methods.

 

constructor(sessionManager: ISessionManager)

 

Service(ISessionManager sessionManager)

 

Sub New (sessionManager As ISessionManager)

Parameters:

  • sessionManager: Session manager instance

constructor (ISessionManager, IEventSinkManager)  protected

Creates a new instance of the Service class and sets the session manager and event sink manager instances that will be used later by the service methods.

 

constructor(sessionManager: ISessionManager; eventManager: IEventSinkManager)

 

Service(ISessionManager sessionManager, IEventSinkManager eventManager)

 

Sub New (sessionManager As ISessionManager, eventManager As IEventSinkManager)

Parameters:

  • sessionManager: Session manager instance
  • eventManager: Event sink manager instance

Activate

Activates the service instance.

This method raises the BeforeActivate and AfterActivate events and acquires the session from the ServiceManager in case the RequireSession flag is set to true.

 

method Activate(clientId: Guid; enforceSessionCheck: Boolean)

 

void Activate(Guid clientId, Boolean enforceSessionCheck)

 

Sub Activate(clientId As Guid, enforceSessionCheck As Boolean)

Parameters:

  • clientId: Session Id
  • enforceSessionCheck:

add_AfterActivate

 

method add_AfterActivate(value: EventHandler<ServiceActivationEventArgs>)

 

void add_AfterActivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub add_AfterActivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

add_AfterDeactivate

 

method add_AfterDeactivate(value: EventHandler<ServiceActivationEventArgs>)

 

void add_AfterDeactivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub add_AfterDeactivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

add_BeforeActivate

 

method add_BeforeActivate(value: EventHandler<ServiceActivationEventArgs>)

 

void add_BeforeActivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub add_BeforeActivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

add_BeforeDeactivate

 

method add_BeforeDeactivate(value: EventHandler<ServiceActivationEventArgs>)

 

void add_BeforeDeactivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub add_BeforeDeactivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

add_ServiceMethodException

 

method add_ServiceMethodException(value: EventHandler<ServiceMethodExceptionEventArgs>)

 

void add_ServiceMethodException(EventHandler<ServiceMethodExceptionEventArgs> value)

 

Sub add_ServiceMethodException(value As EventHandler<ServiceMethodExceptionEventArgs>)

Parameters:

  • value:

add_ValidateRoles

 

method add_ValidateRoles(value: EventHandler<ValidateRolesEventArgs>)

 

void add_ValidateRoles(EventHandler<ValidateRolesEventArgs> value)

 

Sub add_ValidateRoles(value As EventHandler<ValidateRolesEventArgs>)

Parameters:

  • value:

AfterActivate

This event is raised after the service instance has been activated. This event can be used to perform additional service initialization tasks.

 

event AfterActivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> AfterActivate()

 

Event AfterActivate As EventHandler<ServiceActivationEventArgs>

AfterDeactivate

This event is raised after the service instance has been deactivated. This event can be used to perform additional cleanup tasks.

 

event AfterDeactivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> AfterDeactivate()

 

Event AfterDeactivate As EventHandler<ServiceActivationEventArgs>

BeforeActivate

This event is raised before the service instance will be activated. This event can be used to check additional service activation conditions.

 

event BeforeActivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> BeforeActivate()

 

Event BeforeActivate As EventHandler<ServiceActivationEventArgs>

BeforeDeactivate

This event is raised before the service instance will be deactivated. This event can be used to perform additional cleanup tasks.

 

event BeforeDeactivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> BeforeDeactivate()

 

Event BeforeDeactivate As EventHandler<ServiceActivationEventArgs>

CanBeDisposed

Get a flag indicating whether the current service instance can be disposed after servicing the request.

 

property CanBeDisposed: Boolean read;

 

Boolean CanBeDisposed { get; }

 

Property ReadOnly CanBeDisposed As Boolean

Deactivate

Deactivates the service instance.

This method raises the BeforeDeactivate and AfterDeactivate events and releases the service session.

 

method Deactivate(clientId: Guid)

 

void Deactivate(Guid clientId)

 

Sub Deactivate(clientId As Guid)

Parameters:

  • clientId: Session Id

DestroySession  protected

Destroys and disposes the current session.

This method is widely used in the login services to destroy the user session after logout or in case the login attempt was not successful.

 

method DestroySession

 

void DestroySession()

 

Sub DestroySession

EventSinkManager  protected

Provides access to the event sink manager that should be used by the service methods.

 

property EventSinkManager: IEventSinkManager read;

 

IEventSinkManager EventSinkManager { get; }

 

Property ReadOnly EventSinkManager As IEventSinkManager

GetEventSink (Type): IROEventSink

Obtains an event sink proxy for the specified interface.

 

method GetEventSink(eventSink: Type): IROEventSink

 

IROEventSink GetEventSink(Type eventSink)

 

Function GetEventSink(eventSink As Type) As IROEventSink

Parameters:

  • eventSink: Event sink type

GetEventSink (Type, array of Guid): IROEventSink

Obtains an event sink proxy for the specified interface. This method allows to set the event recipients.

 

method GetEventSink(eventSink: Type; recipients: array of Guid): IROEventSink

 

IROEventSink GetEventSink(Type eventSink, Guid[] recipients)

 

Function GetEventSink(eventSink As Type, recipients As array of Guid) As IROEventSink

Parameters:

  • eventSink: Event sink type
  • recipients: Event recipients

GetEventSink (Type, IEventTargets): IROEventSink

Obtains an event sink proxy for the specified interface. This method allows to manage the event recipients.

 

method GetEventSink(eventSink: Type; eventTargets: IEventTargets): IROEventSink

 

IROEventSink GetEventSink(Type eventSink, IEventTargets eventTargets)

 

Function GetEventSink(eventSink As Type, eventTargets As IEventTargets) As IROEventSink

Parameters:

  • eventSink: Event sink type
  • eventTargets: Event recepients

GetEventSink<T>

 

method GetEventSink<T>: T

 

T GetEventSink<T>()

 

Function GetEventSink<T> As T

GetEventSink<T> (array of Guid): T

 

method GetEventSink<T>(recipients: array of Guid): T

 

T GetEventSink<T>(Guid[] recipients)

 

Function GetEventSink<T>(recipients As array of Guid) As T

Parameters:

  • recipients:

GetEventSink<T> (IEventTargets): T

 

method GetEventSink<T>(eventTargets: IEventTargets): T

 

T GetEventSink<T>(IEventTargets eventTargets)

 

Function GetEventSink<T>(eventTargets As IEventTargets) As T

Parameters:

  • eventTargets:

GetSession  protected

Gets the service session. Unlike the Session property this method returns null instead of throwing an exception in case the SessionManager is not set.

 

method GetSession: ISession

 

ISession GetSession()

 

Function GetSession As ISession

HasSession

Gets a flag indicating whether a session is accessible (ie SessionManager is set and the session itself exists for the current remote client)

 

property HasSession: Boolean read;

 

Boolean HasSession { get; }

 

Property ReadOnly HasSession As Boolean

IsActive

 

property IsActive: Boolean read;

 

Boolean IsActive { get; }

 

Property ReadOnly IsActive As Boolean

remove_AfterActivate

 

method remove_AfterActivate(value: EventHandler<ServiceActivationEventArgs>)

 

void remove_AfterActivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub remove_AfterActivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

remove_AfterDeactivate

 

method remove_AfterDeactivate(value: EventHandler<ServiceActivationEventArgs>)

 

void remove_AfterDeactivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub remove_AfterDeactivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

remove_BeforeActivate

 

method remove_BeforeActivate(value: EventHandler<ServiceActivationEventArgs>)

 

void remove_BeforeActivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub remove_BeforeActivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

remove_BeforeDeactivate

 

method remove_BeforeDeactivate(value: EventHandler<ServiceActivationEventArgs>)

 

void remove_BeforeDeactivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub remove_BeforeDeactivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

remove_ServiceMethodException

 

method remove_ServiceMethodException(value: EventHandler<ServiceMethodExceptionEventArgs>)

 

void remove_ServiceMethodException(EventHandler<ServiceMethodExceptionEventArgs> value)

 

Sub remove_ServiceMethodException(value As EventHandler<ServiceMethodExceptionEventArgs>)

Parameters:

  • value:

remove_ValidateRoles

 

method remove_ValidateRoles(value: EventHandler<ValidateRolesEventArgs>)

 

void remove_ValidateRoles(EventHandler<ValidateRolesEventArgs> value)

 

Sub remove_ValidateRoles(value As EventHandler<ValidateRolesEventArgs>)

Parameters:

  • value:

RequireSession

Gets or sets a flag ingicating wheter accessing this service methods remotely requres an existing session.

 

property RequireSession: Boolean read write;

 

Boolean RequireSession { get; set; }

 

Property RequireSession As Boolean

ServerChannel

Gets a Interface IServerChannelInfo instance providing information about the server channel used to call the service method remotely.

 

property ServerChannel: IServerChannelInfo read;

 

IServerChannelInfo ServerChannel { get; }

 

Property ReadOnly ServerChannel As IServerChannelInfo

ServiceMethodException

 

event ServiceMethodException: EventHandler<ServiceMethodExceptionEventArgs>;

 

delegate EventHandler<ServiceMethodExceptionEventArgs> ServiceMethodException()

 

Event ServiceMethodException As EventHandler<ServiceMethodExceptionEventArgs>

ServiceValidateRoles

Validates the service roles. This method is used by the service invoker methods to validate the server access roles.

See the Interface IRolesAwareService interface description for more details.

 

method ServiceValidateRoles(requiredRoles: array of String)

 

void ServiceValidateRoles(String[] requiredRoles)

 

Sub ServiceValidateRoles(requiredRoles As array of String)

Parameters:

  • requiredRoles: Required service roles

Session

Provides access to the Session for the current remote client. In case when session doesn't exist for the current client yet, a new session will be created when the Session property is accessed (but not before).

 

property Session: ISession read write;

 

ISession Session { get; set; }

 

Property Session As ISession

SessionID

Gets the Session ID (aka remote client Id) for the request that is currently being executed.

 

property SessionID: Guid read;

 

Guid SessionID { get; }

 

Property ReadOnly SessionID As Guid

SessionManager  protected

Provides access to the session manager that is used by the service.

 

property SessionManager: ISessionManager read;

 

ISessionManager SessionManager { get; }

 

Property ReadOnly SessionManager As ISessionManager

SubscribeClientEventSink

This method registers the current client as receiver of the provided events type.

 

method SubscribeClientEventSink(eventSink: Type)

 

void SubscribeClientEventSink(Type eventSink)

 

Sub SubscribeClientEventSink(eventSink As Type)

Parameters:

  • eventSink: Event sink type

TriggerAfterActivate  protected

Raises the AfterActivate event.

 

method TriggerAfterActivate(sessionId: Guid)

 

void TriggerAfterActivate(Guid sessionId)

 

Sub TriggerAfterActivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerAfterDeactivate  protected

Raises the AfterDeactivate event.

 

method TriggerAfterDeactivate(sessionId: Guid)

 

void TriggerAfterDeactivate(Guid sessionId)

 

Sub TriggerAfterDeactivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerBeforeActivate  protected

Raises the BeforeActivate event.

 

method TriggerBeforeActivate(sessionId: Guid)

 

void TriggerBeforeActivate(Guid sessionId)

 

Sub TriggerBeforeActivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerBeforeDeactivate  protected

Raises the BeforeDeactivate event.

 

method TriggerBeforeDeactivate(sessionId: Guid)

 

void TriggerBeforeDeactivate(Guid sessionId)

 

Sub TriggerBeforeDeactivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerValidateRoles  protected

Raises the ValidateRoles event and returns the roles check result.

 

method TriggerValidateRoles(roles: array of String; allowByDefault: Boolean): Boolean

 

Boolean TriggerValidateRoles(String[] roles, Boolean allowByDefault)

 

Function TriggerValidateRoles(roles As array of String, allowByDefault As Boolean) As Boolean

Parameters:

  • roles: Required servcie roles
  • allowByDefault: Default result returned when there are no event handlers for the ValidateRoles event

UnsubscribeClientEventSink

This method unregisters the current client as receiver of the any events.

 

method UnsubscribeClientEventSink

 

void UnsubscribeClientEventSink()

 

Sub UnsubscribeClientEventSink

UnsubscribeClientEventSink (Type)

This method unregisters the current client as receiver of the provided events type.

 

method UnsubscribeClientEventSink(eventSink: Type)

 

void UnsubscribeClientEventSink(Type eventSink)

 

Sub UnsubscribeClientEventSink(eventSink As Type)

Parameters:

  • eventSink: Event sink type

ValidateRoles

This event is triggered for methods that have roles set and can be used to override the default roles check procedure.

 

event ValidateRoles: EventHandler<ValidateRolesEventArgs>;

 

delegate EventHandler<ValidateRolesEventArgs> ValidateRoles()

 

Event ValidateRoles As EventHandler<ValidateRolesEventArgs>

 

CanBeDisposed

Get a flag indicating whether the current service instance can be disposed after servicing the request.

 

property CanBeDisposed: Boolean read;

 

Boolean CanBeDisposed { get; }

 

Property ReadOnly CanBeDisposed As Boolean

EventSinkManager  protected

Provides access to the event sink manager that should be used by the service methods.

 

property EventSinkManager: IEventSinkManager read;

 

IEventSinkManager EventSinkManager { get; }

 

Property ReadOnly EventSinkManager As IEventSinkManager

HasSession

Gets a flag indicating whether a session is accessible (ie SessionManager is set and the session itself exists for the current remote client)

 

property HasSession: Boolean read;

 

Boolean HasSession { get; }

 

Property ReadOnly HasSession As Boolean

IsActive

 

property IsActive: Boolean read;

 

Boolean IsActive { get; }

 

Property ReadOnly IsActive As Boolean

RequireSession

Gets or sets a flag ingicating wheter accessing this service methods remotely requres an existing session.

 

property RequireSession: Boolean read write;

 

Boolean RequireSession { get; set; }

 

Property RequireSession As Boolean

ServerChannel

Gets a Interface IServerChannelInfo instance providing information about the server channel used to call the service method remotely.

 

property ServerChannel: IServerChannelInfo read;

 

IServerChannelInfo ServerChannel { get; }

 

Property ReadOnly ServerChannel As IServerChannelInfo

Session

Provides access to the Session for the current remote client. In case when session doesn't exist for the current client yet, a new session will be created when the Session property is accessed (but not before).

 

property Session: ISession read write;

 

ISession Session { get; set; }

 

Property Session As ISession

SessionID

Gets the Session ID (aka remote client Id) for the request that is currently being executed.

 

property SessionID: Guid read;

 

Guid SessionID { get; }

 

Property ReadOnly SessionID As Guid

SessionManager  protected

Provides access to the session manager that is used by the service.

 

property SessionManager: ISessionManager read;

 

ISessionManager SessionManager { get; }

 

Property ReadOnly SessionManager As ISessionManager

 

constructor  protected

Creates a new instance of the Service class.

 

constructor

 

Service()

 

Sub New

constructor (ISessionManager)  protected

Creates a new instance of the Service class and sets the session manager and event sink manager instances that will be used later by the service methods.

 

constructor(sessionManager: ISessionManager)

 

Service(ISessionManager sessionManager)

 

Sub New (sessionManager As ISessionManager)

Parameters:

  • sessionManager: Session manager instance

constructor (ISessionManager, IEventSinkManager)  protected

Creates a new instance of the Service class and sets the session manager and event sink manager instances that will be used later by the service methods.

 

constructor(sessionManager: ISessionManager; eventManager: IEventSinkManager)

 

Service(ISessionManager sessionManager, IEventSinkManager eventManager)

 

Sub New (sessionManager As ISessionManager, eventManager As IEventSinkManager)

Parameters:

  • sessionManager: Session manager instance
  • eventManager: Event sink manager instance

Activate

Activates the service instance.

This method raises the BeforeActivate and AfterActivate events and acquires the session from the ServiceManager in case the RequireSession flag is set to true.

 

method Activate(clientId: Guid; enforceSessionCheck: Boolean)

 

void Activate(Guid clientId, Boolean enforceSessionCheck)

 

Sub Activate(clientId As Guid, enforceSessionCheck As Boolean)

Parameters:

  • clientId: Session Id
  • enforceSessionCheck:

add_AfterActivate

 

method add_AfterActivate(value: EventHandler<ServiceActivationEventArgs>)

 

void add_AfterActivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub add_AfterActivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

add_AfterDeactivate

 

method add_AfterDeactivate(value: EventHandler<ServiceActivationEventArgs>)

 

void add_AfterDeactivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub add_AfterDeactivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

add_BeforeActivate

 

method add_BeforeActivate(value: EventHandler<ServiceActivationEventArgs>)

 

void add_BeforeActivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub add_BeforeActivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

add_BeforeDeactivate

 

method add_BeforeDeactivate(value: EventHandler<ServiceActivationEventArgs>)

 

void add_BeforeDeactivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub add_BeforeDeactivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

add_ServiceMethodException

 

method add_ServiceMethodException(value: EventHandler<ServiceMethodExceptionEventArgs>)

 

void add_ServiceMethodException(EventHandler<ServiceMethodExceptionEventArgs> value)

 

Sub add_ServiceMethodException(value As EventHandler<ServiceMethodExceptionEventArgs>)

Parameters:

  • value:

add_ValidateRoles

 

method add_ValidateRoles(value: EventHandler<ValidateRolesEventArgs>)

 

void add_ValidateRoles(EventHandler<ValidateRolesEventArgs> value)

 

Sub add_ValidateRoles(value As EventHandler<ValidateRolesEventArgs>)

Parameters:

  • value:

Deactivate

Deactivates the service instance.

This method raises the BeforeDeactivate and AfterDeactivate events and releases the service session.

 

method Deactivate(clientId: Guid)

 

void Deactivate(Guid clientId)

 

Sub Deactivate(clientId As Guid)

Parameters:

  • clientId: Session Id

DestroySession  protected

Destroys and disposes the current session.

This method is widely used in the login services to destroy the user session after logout or in case the login attempt was not successful.

 

method DestroySession

 

void DestroySession()

 

Sub DestroySession

GetEventSink (Type): IROEventSink

Obtains an event sink proxy for the specified interface.

 

method GetEventSink(eventSink: Type): IROEventSink

 

IROEventSink GetEventSink(Type eventSink)

 

Function GetEventSink(eventSink As Type) As IROEventSink

Parameters:

  • eventSink: Event sink type

GetEventSink (Type, array of Guid): IROEventSink

Obtains an event sink proxy for the specified interface. This method allows to set the event recipients.

 

method GetEventSink(eventSink: Type; recipients: array of Guid): IROEventSink

 

IROEventSink GetEventSink(Type eventSink, Guid[] recipients)

 

Function GetEventSink(eventSink As Type, recipients As array of Guid) As IROEventSink

Parameters:

  • eventSink: Event sink type
  • recipients: Event recipients

GetEventSink (Type, IEventTargets): IROEventSink

Obtains an event sink proxy for the specified interface. This method allows to manage the event recipients.

 

method GetEventSink(eventSink: Type; eventTargets: IEventTargets): IROEventSink

 

IROEventSink GetEventSink(Type eventSink, IEventTargets eventTargets)

 

Function GetEventSink(eventSink As Type, eventTargets As IEventTargets) As IROEventSink

Parameters:

  • eventSink: Event sink type
  • eventTargets: Event recepients

GetEventSink<T>

 

method GetEventSink<T>: T

 

T GetEventSink<T>()

 

Function GetEventSink<T> As T

GetEventSink<T> (array of Guid): T

 

method GetEventSink<T>(recipients: array of Guid): T

 

T GetEventSink<T>(Guid[] recipients)

 

Function GetEventSink<T>(recipients As array of Guid) As T

Parameters:

  • recipients:

GetEventSink<T> (IEventTargets): T

 

method GetEventSink<T>(eventTargets: IEventTargets): T

 

T GetEventSink<T>(IEventTargets eventTargets)

 

Function GetEventSink<T>(eventTargets As IEventTargets) As T

Parameters:

  • eventTargets:

GetSession  protected

Gets the service session. Unlike the Session property this method returns null instead of throwing an exception in case the SessionManager is not set.

 

method GetSession: ISession

 

ISession GetSession()

 

Function GetSession As ISession

remove_AfterActivate

 

method remove_AfterActivate(value: EventHandler<ServiceActivationEventArgs>)

 

void remove_AfterActivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub remove_AfterActivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

remove_AfterDeactivate

 

method remove_AfterDeactivate(value: EventHandler<ServiceActivationEventArgs>)

 

void remove_AfterDeactivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub remove_AfterDeactivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

remove_BeforeActivate

 

method remove_BeforeActivate(value: EventHandler<ServiceActivationEventArgs>)

 

void remove_BeforeActivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub remove_BeforeActivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

remove_BeforeDeactivate

 

method remove_BeforeDeactivate(value: EventHandler<ServiceActivationEventArgs>)

 

void remove_BeforeDeactivate(EventHandler<ServiceActivationEventArgs> value)

 

Sub remove_BeforeDeactivate(value As EventHandler<ServiceActivationEventArgs>)

Parameters:

  • value:

remove_ServiceMethodException

 

method remove_ServiceMethodException(value: EventHandler<ServiceMethodExceptionEventArgs>)

 

void remove_ServiceMethodException(EventHandler<ServiceMethodExceptionEventArgs> value)

 

Sub remove_ServiceMethodException(value As EventHandler<ServiceMethodExceptionEventArgs>)

Parameters:

  • value:

remove_ValidateRoles

 

method remove_ValidateRoles(value: EventHandler<ValidateRolesEventArgs>)

 

void remove_ValidateRoles(EventHandler<ValidateRolesEventArgs> value)

 

Sub remove_ValidateRoles(value As EventHandler<ValidateRolesEventArgs>)

Parameters:

  • value:

ServiceValidateRoles

Validates the service roles. This method is used by the service invoker methods to validate the server access roles.

See the Interface IRolesAwareService interface description for more details.

 

method ServiceValidateRoles(requiredRoles: array of String)

 

void ServiceValidateRoles(String[] requiredRoles)

 

Sub ServiceValidateRoles(requiredRoles As array of String)

Parameters:

  • requiredRoles: Required service roles

SubscribeClientEventSink

This method registers the current client as receiver of the provided events type.

 

method SubscribeClientEventSink(eventSink: Type)

 

void SubscribeClientEventSink(Type eventSink)

 

Sub SubscribeClientEventSink(eventSink As Type)

Parameters:

  • eventSink: Event sink type

TriggerAfterActivate  protected

Raises the AfterActivate event.

 

method TriggerAfterActivate(sessionId: Guid)

 

void TriggerAfterActivate(Guid sessionId)

 

Sub TriggerAfterActivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerAfterDeactivate  protected

Raises the AfterDeactivate event.

 

method TriggerAfterDeactivate(sessionId: Guid)

 

void TriggerAfterDeactivate(Guid sessionId)

 

Sub TriggerAfterDeactivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerBeforeActivate  protected

Raises the BeforeActivate event.

 

method TriggerBeforeActivate(sessionId: Guid)

 

void TriggerBeforeActivate(Guid sessionId)

 

Sub TriggerBeforeActivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerBeforeDeactivate  protected

Raises the BeforeDeactivate event.

 

method TriggerBeforeDeactivate(sessionId: Guid)

 

void TriggerBeforeDeactivate(Guid sessionId)

 

Sub TriggerBeforeDeactivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerValidateRoles  protected

Raises the ValidateRoles event and returns the roles check result.

 

method TriggerValidateRoles(roles: array of String; allowByDefault: Boolean): Boolean

 

Boolean TriggerValidateRoles(String[] roles, Boolean allowByDefault)

 

Function TriggerValidateRoles(roles As array of String, allowByDefault As Boolean) As Boolean

Parameters:

  • roles: Required servcie roles
  • allowByDefault: Default result returned when there are no event handlers for the ValidateRoles event

UnsubscribeClientEventSink

This method unregisters the current client as receiver of the any events.

 

method UnsubscribeClientEventSink

 

void UnsubscribeClientEventSink()

 

Sub UnsubscribeClientEventSink

UnsubscribeClientEventSink (Type)

This method unregisters the current client as receiver of the provided events type.

 

method UnsubscribeClientEventSink(eventSink: Type)

 

void UnsubscribeClientEventSink(Type eventSink)

 

Sub UnsubscribeClientEventSink(eventSink As Type)

Parameters:

  • eventSink: Event sink type

 

AfterActivate

This event is raised after the service instance has been activated. This event can be used to perform additional service initialization tasks.

 

event AfterActivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> AfterActivate()

 

Event AfterActivate As EventHandler<ServiceActivationEventArgs>

AfterDeactivate

This event is raised after the service instance has been deactivated. This event can be used to perform additional cleanup tasks.

 

event AfterDeactivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> AfterDeactivate()

 

Event AfterDeactivate As EventHandler<ServiceActivationEventArgs>

BeforeActivate

This event is raised before the service instance will be activated. This event can be used to check additional service activation conditions.

 

event BeforeActivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> BeforeActivate()

 

Event BeforeActivate As EventHandler<ServiceActivationEventArgs>

BeforeDeactivate

This event is raised before the service instance will be deactivated. This event can be used to perform additional cleanup tasks.

 

event BeforeDeactivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> BeforeDeactivate()

 

Event BeforeDeactivate As EventHandler<ServiceActivationEventArgs>

ServiceMethodException

 

event ServiceMethodException: EventHandler<ServiceMethodExceptionEventArgs>;

 

delegate EventHandler<ServiceMethodExceptionEventArgs> ServiceMethodException()

 

Event ServiceMethodException As EventHandler<ServiceMethodExceptionEventArgs>

ValidateRoles

This event is triggered for methods that have roles set and can be used to override the default roles check procedure.

 

event ValidateRoles: EventHandler<ValidateRolesEventArgs>;

 

delegate EventHandler<ValidateRolesEventArgs> ValidateRoles()

 

Event ValidateRoles As EventHandler<ValidateRolesEventArgs>

See Also