Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SessionService

A service for managing connections to other ArgonSystem instances

Hierarchy

  • SessionService

Index

Constructors

constructor

Properties

Private _connectEvent

_connectEvent: Event<SessionPort> = new Event<SessionPort>()

Private _managedSessions

_managedSessions: SessionPort[] = []

configuration

configuration: Configuration

The configuration of this ArgonSystem

Private connectService

connectService: ConnectService

errorEvent

errorEvent: Event<Error> = new Event<Error>()

An event that is raised when an error occurs.

manager

manager: SessionPort = this.createSessionPort('argon:manager')

The port which handles communication between this session and the manager session.

Private messageChannelFactory

messageChannelFactory: MessageChannelFactory

Private sessionPortFactory

sessionPortFactory: SessionPortFactory

Accessors

connectEvent

  • An event that is raised when a managed session is opened.

    Returns Event<SessionPort>

Private isApplication

  • get isApplication(): boolean
  • Returns boolean

Private isManager

  • get isManager(): boolean
  • Returns boolean

isRealityAugmenter

  • get isRealityAugmenter(): boolean
  • Returns true if this system represents a [[REALITY_AUGMENTER]], meaning, it is running within a [[REALITY_MANAGER]]

    Returns boolean

isRealityManager

  • get isRealityManager(): boolean
  • Returns true if this system represents a [[REALITY_MANAGER]]

    Returns boolean

Private isRealityView

  • get isRealityView(): boolean
  • Returns boolean

isRealityViewer

  • get isRealityViewer(): boolean
  • Returns true if this system is a [[REALITY_VIEWER]]

    Returns boolean

managedSessions

  • Manager-only. A collection of ports for each managed session.

    Returns Array<SessionPort>

Methods

addManagedSessionPort

  • Manager-only. Creates a SessionPort that is managed by the current ArgonSystem. Session ports that are managed will automatically forward open events to [[SessionService#sessionConnectEvent]] and error events to [[SessionService#errorEvent]]. Other services that are part of the current ArgonSystem are likely to add message handlers to a newly connected SessionPort.

    Parameters

    • uri: string

    Returns SessionPort

    a new SessionPort instance

connect

  • connect(): void
  • Establishes a connection with the [[REALITY_MANAGER]]. Called internally by the composition root (ArgonSystem).

    Returns void

createMessageChannel

  • Creates a message channel which asyncrhonously sends and receives messages.

    Returns MessageChannelLike

createSessionPort

  • Creates a SessionPort that is not managed by the current ArgonSystem. Unmanaged session ports will not forward open events or error events to this ArgonSystem.

    Parameters

    • uri: string

    Returns SessionPort

    a new SessionPort instance

createSynchronousMessageChannel

  • Creates a message channel which syncrhonously sends and receives messages.

    Returns SynchronousMessageChannel

ensureConnected

  • ensureConnected(): void
  • Throws an error if the connection to the manager is closed

    Returns void

ensureIsRealityManager

  • ensureIsRealityManager(): void
  • Throws an error if this system is not a [[REALITY_MANAGER]]

    Returns void

ensureIsRealityViewer

  • ensureIsRealityViewer(): void
  • Throws an error if this session is not a [[REALITY_VIEWER]]

    Returns void

ensureNotRealityAugmenter

  • ensureNotRealityAugmenter(): void
  • Throws an error if this session is a [[REALITY_AUGMENTER]]

    Returns void

ensureNotRealityViewer

  • ensureNotRealityViewer(): void
  • Throws an error if this session is a [[REALITY_VIEWER]]

    Returns void

Generated using TypeDoc