Class CallableClientServer

    • Field Detail

      • url_

        private final java.net.URL url_
      • serverMap_

        private static final java.util.Map serverMap_
    • Method Detail

      • getUrl

        public java.net.URL getUrl()
        Returns the XML-RPC endpoint for this server.
        Returns:
        endpoint url
      • addClient

        public void addClient​(HubConnection connection,
                              CallableClient callable)
        Adds a CallableClient object to this server.
        Parameters:
        connection - hub connection for the registered client on behalf of which the client will operate
        callable - callable client object
      • removeClient

        public void removeClient​(HubConnection connection)
        Removes a CallableClient object from this server.
        Parameters:
        privateKey - hub connection for which this client was added
      • close

        public void close()
        Tidies up resources. Following a call to this method, no further clients can be added.
      • hasClients

        boolean hasClients()
        Indicates whether this server currently has any clients.
        Returns:
        true iff there are clients
      • getInstance

        public static CallableClientServer getInstance​(SampXmlRpcServerFactory serverFact)
                                                throws java.io.IOException
        Returns an instance of CallableClientServer for use with a given XML-RPC server. Because of the implementation, only one CallableClientServer is permitted per XML-RPC server, so if one has already been installed for the given server, that one will be returned. Otherwise a new one will be constructed, installed and returned.

        To prevent memory leaks, once any clients added to the returned server have been removed (the client count drops to zero), the server will be closed and cannot be re-used.

        Parameters:
        server - XML-RPC server
        Returns:
        new or re-used CallableClientServer which is installed on server
        Throws:
        java.io.IOException