Package fr.dyade.aaa.jndi2.client
Class SimpleNamingConnection
- java.lang.Object
-
- fr.dyade.aaa.jndi2.client.SimpleNamingConnection
-
- All Implemented Interfaces:
NamingConnection
public class SimpleNamingConnection extends Object implements NamingConnection
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intconnectTimeoutDefines in milliseconds the timeout used during socket connection.protected Hashtableenvprotected StringhostNameprotected IOControlioCtrlprotected intport(package private) static StringSOCKET_FACTORY_PROPERTYName of the property that allow to define the SocketFactory class used for NamingConnection.(package private) SocketFactorysocketFactoryAllows to define a specific factory for socket in order to by-pass compatibility problem between JDK version.(package private) static StringTIMEOUT_PROPERTYName of the property that allow the configuration of the timeout during connect (by default 0, infinite timeout).
-
Constructor Summary
Constructors Constructor Description SimpleNamingConnection()SimpleNamingConnection(String hostName, int port, Hashtable env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NamingConnectioncloneConnection()HashtablegetEnvironment()StringgetHostName()intgetPort()voidinit(String hostName, int port, Hashtable env)JndiReplyinvoke(JndiRequest request)An invoke opens a connection and closes it when the result has been returned.private voidopen()StringtoString()
-
-
-
Field Detail
-
socketFactory
SocketFactory socketFactory
Allows to define a specific factory for socket in order to by-pass compatibility problem between JDK version. Currently there is two factories, The default factory one for JDK since 1.4, andSocketFactory13for JDK prior to 1.4. This value can be adjusted by settingfr.dyade.aaa.jndi2.client.SocketFactoryproperty.
-
SOCKET_FACTORY_PROPERTY
static final String SOCKET_FACTORY_PROPERTY
Name of the property that allow to define the SocketFactory class used for NamingConnection.- See Also:
- Constant Field Values
-
connectTimeout
int connectTimeout
Defines in milliseconds the timeout used during socket connection. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout. Default value is 0. This value can be adjusted by settingfr.dyade.aaa.jndi2.client.ConnectTimeoutproperty.
-
TIMEOUT_PROPERTY
static final String TIMEOUT_PROPERTY
Name of the property that allow the configuration of the timeout during connect (by default 0, infinite timeout).- See Also:
- Constant Field Values
-
hostName
protected String hostName
-
port
protected int port
-
env
protected Hashtable env
-
ioCtrl
protected IOControl ioCtrl
-
-
Method Detail
-
getHostName
public final String getHostName()
-
getPort
public final int getPort()
-
invoke
public JndiReply invoke(JndiRequest request) throws NamingException
An invoke opens a connection and closes it when the result has been returned. The overhead of the connection opening could be avoided if the server could close connections. Such a protocol would change the client as well.- Specified by:
invokein interfaceNamingConnection- Throws:
NamingException
-
open
private void open() throws NamingException- Throws:
NamingException
-
getEnvironment
public Hashtable getEnvironment()
- Specified by:
getEnvironmentin interfaceNamingConnection
-
cloneConnection
public NamingConnection cloneConnection()
- Specified by:
cloneConnectionin interfaceNamingConnection
-
-