Class ServerUpdateUtilities

java.lang.Object
org.tentackle.update.ServerUpdateUtilities

@Service(ServerUpdateUtilities.class) public class ServerUpdateUtilities extends Object
Utility methods to implement the application update.
  • Constructor Details

    • ServerUpdateUtilities

      public ServerUpdateUtilities()
      Creates a server update utilities instance.
  • Method Details

    • getInstance

      public static ServerUpdateUtilities getInstance()
      The singleton.
      Returns:
      the singleton
    • exportUpdateService

      public void exportUpdateService(String serviceUrlName, String updateUrlName, Class<? extends UpdateService> updateServiceImplClass, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
      Creates a registry and exports the update service.

      Notice: either both csf and ssf must be given or none.

      Parameters:
      serviceUrlName - the rmi service url, ex. "rmi://localhost/Update:33002"
      updateUrlName - the URL base holding the downloads, ex. "http://localhost/myapp/downloads"
      updateServiceImplClass - the class implementing the remote UpdateService
      csf - the client socket factory, null if system default
      ssf - the server socket factory, null if system default
    • exportUpdateService

      public void exportUpdateService(String serviceUrlName, String updateUrlName, Class<? extends UpdateService> updateServiceImplClass)
      Creates a registry and exports the update service using default socket factories.
      Parameters:
      serviceUrlName - the rmi service url, ex. "rmi://localhost/Update:33002"
      updateUrlName - the URL base holding the downloads, ex. "http://localhost/myapp/downloads"
      updateServiceImplClass - the class implementing the remote UpdateService
    • createUpdateServiceImpl

      protected UpdateService createUpdateServiceImpl(Class<? extends UpdateService> updateServiceImplClass, int port, String updateUrlName, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
      Parameters:
      updateServiceImplClass - the class implementing the remote UpdateService
      port - the ip port
      updateUrlName - the download base URL
      csf - the client socket factory, null if system default
      ssf - the server socket factory, null if system default
      Returns:
      the service implementation