Class StatelessClient

  • All Implemented Interfaces:
    UsesPort
    Direct Known Subclasses:
    Client

    public class StatelessClient
    extends Node
    A client node for stateless communication. Its (optional) application ID is that of the application which hosts the client.
    Since:
    1.0.0
    Version:
    $Id: StatelessClient.java 17757 2018-11-13 20:41:13Z colin $
    Author:
    tlerios@marketcetera.com
    • Field Detail

      • mAppId

        private final AppId mAppId
      • contextClassProvider

        private final ContextClassProvider contextClassProvider
        context classes to add to the client context, if any
    • Constructor Detail

      • StatelessClient

        public StatelessClient​(String inHost,
                               int inPort,
                               AppId inAppId,
                               ContextClassProvider inContextClasses)
        Create a new StatelessClient instance.
        Parameters:
        inHost - a String value
        inPort - an int value
        inAppId - an AppId value
        inContextClasses - a ContextClassProvider value
      • StatelessClient

        public StatelessClient​(String host,
                               int port,
                               AppId appId)
        Creates a new client node with the given server host name, port, and client application ID.
        Parameters:
        host - The host name.
        port - The port.
        appId - The application ID, which may be null.
      • StatelessClient

        public StatelessClient​(AppId appId)
        Creates a new client node with the default server host name and port, and the given client application ID.
        Parameters:
        appId - The application ID, which may be null.
      • StatelessClient

        public StatelessClient()
        Creates a new client node with the default server host name and port, and no client application ID.
    • Method Detail

      • getAppId

        public AppId getAppId()
        Returns the receiver's application ID.
        Returns:
        The application ID, which may be null.
      • fillContext

        protected void fillContext​(StatelessClientContext context)
        Sets the properties of the given client context, so that it may be used for remote calls made via proxies obtained from the receiver.
        Parameters:
        context - The context.
      • getContext

        public StatelessClientContext getContext()
        Returns a client context which the client must supply as an argument to every remote call made via proxies obtained from the receiver.
        Returns:
        The context.
      • getService

        public <T extends StatelessServiceBase> T getService​(Class<T> inInterface)
        Retrieves the client-side proxy for the given service interface.
        Type Parameters:
        T - a T extends StatelessServiceBase value
        Parameters:
        inInterface - The interface class.