Class SessionFactoryImpl

    • Field Summary

      • Fields inherited from class java.rmi.server.RemoteObject

        ref
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static SessionFactoryImpl createInstance()
      Creates new instance of this class.
      Session createSession()
      Creates a session object.
      Session createSession​(java.lang.String aUserName, java.lang.String aPassword)
      Creates a session object with the specified username and password.
      • Methods inherited from class java.rmi.server.UnicastRemoteObject

        clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
      • Methods inherited from class java.rmi.server.RemoteServer

        getClientHost, getLog, setLog
      • Methods inherited from class java.rmi.server.RemoteObject

        equals, getRef, hashCode, toString, toStub
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • createSession

        public Session createSession()
                              throws DIException,
                                     java.rmi.RemoteException
        Creates a session object.

        Example:

         var sf = java.rmi.Naming.lookup("rmi://127.0.0.1:1099/SessionFactory");
         var session = sf.createSession();
         task.logmsg("OS: " + session.getServerInfo().getOperatingSystem());
         
        Specified by:
        createSession in interface SessionFactory
        Returns:
        The Session object.
        Throws:
        DIException - if an error occurs while creating Session.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • createSession

        public Session createSession​(java.lang.String aUserName,
                                     java.lang.String aPassword)
                              throws DIException,
                                     java.rmi.RemoteException
        Creates a session object with the specified username and password.

        Example:

         var nick = "Username";
         var pass = "Difficult password";
         var sf = java.rmi.Naming.lookup("rmi://127.0.0.1:1099/SessionFactory");
         var session = sf.createSession();
         task.logmsg("OS: " + session.getServerInfo().getOperatingSystem());
         
        Specified by:
        createSession in interface SessionFactory
        Parameters:
        aUserName - the username for authentication.
        aPassword - the password for authentication.
        Returns:
        The Session object.
        Throws:
        DIException - if an error occurs while creating Session.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • createInstance

        public static SessionFactoryImpl createInstance()
                                                 throws DIException,
                                                        java.rmi.RemoteException
        Creates new instance of this class.
        Returns:
        SessionFactoryImpl object
        Throws:
        DIException - if Runtime or Security exception occurs.
        java.rmi.RemoteException - if a communication-related exception occurs.