org.peace_tools.core.session
Class SessionFactory

java.lang.Object
  extended by org.peace_tools.core.session.SessionFactory

public class SessionFactory
extends java.lang.Object

A helper factory class to create a suitable session depending on server. This is a helper factory class that is used to create a local or a remote server session to interact with the server. The objective of this class is to provide a single point for instantiating suitable server session.

Note: This class is not meant to be instantiated. Instead directly use the static methods in this class.


Constructor Summary
private SessionFactory()
          Default constructor.
 
Method Summary
static ServerSession createSession(java.awt.Component parent, Server server)
          Factory method to create suitable server session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionFactory

private SessionFactory()
Default constructor. The default constructor has been made private to ensure this class is never directly instantaited.

Method Detail

createSession

public static ServerSession createSession(java.awt.Component parent,
                                          Server server)
Factory method to create suitable server session. This method must be used to create a suitable server session to interact with a remote server. This method performs no special operations (such as connecting etc.) on the session.

Parameters:
parent - The parent component that should be used to create GUI elements that may be needed for any interactive operations.
server - The server data-object that provides the necessary information to connect to the server.
Returns:
Returns a suitable (local or remote) session for interacting with the server.