fr.dyade.aaa.jndi2.client
Class SimpleNamingConnection

java.lang.Object
  extended by fr.dyade.aaa.jndi2.client.SimpleNamingConnection
All Implemented Interfaces:
NamingConnection

public class SimpleNamingConnection
extends java.lang.Object
implements NamingConnection


Field Summary
(package private)  int connectTimeout
          Defines in milliseconds the timeout used during socket connection.
protected  java.util.Hashtable env
           
protected  java.lang.String hostName
           
protected  IOControl ioCtrl
           
protected  int port
           
(package private) static java.lang.String SOCKET_FACTORY_PROPERTY
          Name of the property that allow to define the SocketFactory class used for NamingConnection.
(package private)  SocketFactory socketFactory
          Allows to define a specific factory for socket in order to by-pass compatibility problem between JDK version.
(package private) static java.lang.String TIMEOUT_PROPERTY
          Name of the property that allow the configuration of the timeout during connect (by default 0, infinite timeout).
 
Constructor Summary
SimpleNamingConnection()
           
SimpleNamingConnection(java.lang.String hostName, int port, java.util.Hashtable env)
           
 
Method Summary
 NamingConnection cloneConnection()
           
 java.util.Hashtable getEnvironment()
           
 java.lang.String getHostName()
           
 int getPort()
           
 void init(java.lang.String hostName, int port, java.util.Hashtable env)
           
 JndiReply invoke(JndiRequest request)
          An invoke opens a connection and closes it when the result has been returned.
private  void open()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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, and SocketFactory13 for JDK prior to 1.4. This value can be adjusted by setting fr.dyade.aaa.jndi2.client.SocketFactory property.


SOCKET_FACTORY_PROPERTY

static final java.lang.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 setting fr.dyade.aaa.jndi2.client.ConnectTimeout property.


TIMEOUT_PROPERTY

static final java.lang.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 java.lang.String hostName

port

protected int port

env

protected java.util.Hashtable env

ioCtrl

protected IOControl ioCtrl
Constructor Detail

SimpleNamingConnection

public SimpleNamingConnection()

SimpleNamingConnection

public SimpleNamingConnection(java.lang.String hostName,
                              int port,
                              java.util.Hashtable env)
Method Detail

init

public void init(java.lang.String hostName,
                 int port,
                 java.util.Hashtable env)

getHostName

public final java.lang.String getHostName()

getPort

public final int getPort()

invoke

public JndiReply invoke(JndiRequest request)
                 throws javax.naming.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:
invoke in interface NamingConnection
Throws:
javax.naming.NamingException

open

private void open()
           throws javax.naming.NamingException
Throws:
javax.naming.NamingException

getEnvironment

public java.util.Hashtable getEnvironment()
Specified by:
getEnvironment in interface NamingConnection

cloneConnection

public NamingConnection cloneConnection()
Specified by:
cloneConnection in interface NamingConnection

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.