Back to index

wims  3.65+svn20090927
ConnectionFactory.java
Go to the documentation of this file.
00001 /*
00002 $Id: ConnectionFactory.java,v 1.2 2003/02/18 11:48:48 sander Exp $
00003 */
00004 
00005 
00006 package fr.ove.utils;
00007 
00008 import fr.ove.utils.Connection;
00009 
00013 public class ConnectionFactory implements ConnectionConfigurable {
00018     private String hostName = "localhost";
00019     
00024     private int portNumber = 6666;
00025     
00030     public void setHostName(String name) {
00031         hostName = name;
00032     }
00033     
00037     public String getHostName() {
00038         return hostName;
00039     }
00040     
00045     public void setPortNumber(int number) {
00046         portNumber = number;
00047     }
00048     
00052     public int getPortNumber() {
00053         return portNumber;
00054     }
00055     
00059     public Connection createConnection() {
00060         return new Connection(hostName, portNumber);
00061     }
00062     
00068     public static Connection createConnection(String hostName, int portNumber) {
00069         return new Connection(hostName, portNumber);
00070     }
00071 }