|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--net.directj.csf.ServerFactory
This class is used to easely create servers. It is quite simple, but can manage a lot of server'type, like SSL or TLS server. To change the type of the created server, you may use the getSupportedType(), getSupportedTypeDescription() and setServerType() methods.
| Field Summary | |
private static ServerFactory |
instance
the factory single instance. |
| Constructor Summary | |
protected |
ServerFactory()
Forbids direct instanciation. |
| Method Summary | |
abstract Server |
createServer()
Creates a new server. |
abstract Server |
createServer(java.lang.String _name,
int _port)
Creates a new server. |
abstract Server |
createServer(java.lang.String _name,
int _port,
int _maxClient)
Creates a new server. |
abstract Server |
createServer(java.lang.String _name,
int _port,
int _maxClient,
java.net.InetAddress _address)
Creates a new server. |
static ServerFactory |
getDefault()
Returs the default factory. |
abstract java.lang.String[] |
getSupportedType()
Returns the list of server type supported by this factory. |
abstract java.lang.String[] |
getSupportedTypeDescription()
Returns the description of the different supported type. |
abstract void |
setServerType(java.lang.String _type)
Changes the type of the server that will be created with the createServer method. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static ServerFactory instance
| Constructor Detail |
protected ServerFactory()
| Method Detail |
public abstract java.lang.String[] getSupportedType()
String[] - An array of string that indicate the list of supported server type.The description method.public abstract java.lang.String[] getSupportedTypeDescription()
String[] - An array of string that describe the supported server type.The server type method.
public abstract void setServerType(java.lang.String _type)
throws java.lang.IllegalArgumentException
_type - The server's type.
java.lang.IllegalArgumentException - If the specified type is not a valid server's type.The method to check the valid type.public static ServerFactory getDefault()
ServerFactory - The default ServerFactory.public abstract Server createServer()
ClientHandler - A new client server.
public abstract Server createServer(java.lang.String _name,
int _port)
throws java.lang.IllegalArgumentException
_name - The server's name._port - The server's port.
Server - A new server.
java.lang.IllegalArgumentException - If a specified parameters is not valid.
public abstract Server createServer(java.lang.String _name,
int _port,
int _maxClient)
throws java.lang.IllegalArgumentException
_name - The server's name._port - The server's port._maxClient - The maximum amount of client the server can handle.
Server - A new server.
java.lang.IllegalArgumentException - If a specified parameters is not valid.
public abstract Server createServer(java.lang.String _name,
int _port,
int _maxClient,
java.net.InetAddress _address)
throws java.lang.IllegalArgumentException
_name - The server's name._port - The server's port._maxClient - The maximum amount of client the server can handle._address - The server's address.
Server - A new server.
java.lang.IllegalArgumentException - If a specified parameters is not valid.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||