Class Service

    • Method Detail

      • close

        public boolean close()
        Closes the rendering service. If renderAreas still exist, this method will dispose them and close the rendering service.

        Returns:
        true if successful, otherwise returns false.

      • getNumClients

        public int getNumClients()
        Gets the number of clients.

        Returns:
        the number clients attached to the service.

      • isRunning

        public boolean isRunning()
        This method is used to know if the rendering service is running.

        Returns:
        true if running; otherwise returns false.

      • getClient

        public Client getClient​(int index)
        Gets a Client from index. Range is [0..getNumClients - 1].

        Parameters:
        index - : index identifying the client

        Returns:
        the client object if the index exists, otherwise returns null.

      • instance

        public static Service instance()
        Renderering service instance (Singleton)

        Returns:
        the service instance

      • getSettings

        public ServiceSettings getSettings()
        Gets the settings of the service.

        Returns:
        the service settings object

      • open

        public boolean open​(ServiceSettings settings)
        Opens the rendering service.

        Parameters:
        settings - : the settings of the instance. This object cannot be null.
        Returns:
        true if successful, otherwise returns false.

        See Also:
        Service.getSettings
      • removeListener

        public void removeListener​(ServiceListener listener)
        Removes a ServiceListener.

        Parameters:
        listener - : object that listens to the service events
      • getRenderArea

        public RenderArea getRenderArea​(int index)
        Gets a RenderArea from index. Range is [0..getNumRenderAreas - 1].

        Parameters:
        index - : index identifying the renderArea

        Returns:
        the renderArea object if the index exists, otherwise returns null.

      • addListener

        public void addListener​(ServiceListener listener)
        Parameters:
        listener - : object that listens to the service events
      • getNumRenderAreas

        public int getNumRenderAreas()
        Gets the number of renderAreas.

        Returns:
        the renderArea number of the Instance.

      • removeAllListeners

        public void removeAllListeners()
        Removes all ServiceListeners.
      • createRenderArea

        public void createRenderArea​(java.lang.String id,
                                     int width,
                                     int height,
                                     RenderAreaHardware renderAreaHardware)
        Forces the creation of a renderArea.
        This method is optional. The other way to create a renderArea is to return true to the callback ServiceListener.onPendingCreateRenderArea when a connection requests it.
        If the renderArea already exists, the call will be ignored.

        Parameters:
        id - : ID identifying the RenderArea

        width - : renderArea width

        height - : renderArea height

        renderAreaHardware - : renderArea hardware settings.
      • getClient

        public Client getClient​(java.lang.String id)
        Gets a Client from id. Range is [0..getNumClients - 1].

        Parameters:
        id - : ID identifying the client

        Returns:
        the client object if the id exists, otherwise returns null.

      • getRenderArea

        public RenderArea getRenderArea​(java.lang.String id)
        Gets a RenderArea from id. Range is [0..getNumRenderAreas - 1].

        Parameters:
        id - : ID identifying the RenderArea

        Returns:
        the renderArea object if the id exists, otherwise returns null.