FileDocCategorySizeDatePackage
PropertyBasedMonitoringSocket_RMIClientSocketFactory.javaAPI DocExample1536Thu Nov 08 00:23:22 GMT 2001com.ora.rmibook.chapter18.sockets

PropertyBasedMonitoringSocket_RMIClientSocketFactory

public class PropertyBasedMonitoringSocket_RMIClientSocketFactory extends Object implements Serializable, RMIClientSocketFactory

Fields Summary
private static final String
USE_MONITORING_SOCKETS_PROPERTY
private static final String
TRUE
private int
_hashCode
private boolean
_isMonitoringOn
Constructors Summary
public PropertyBasedMonitoringSocket_RMIClientSocketFactory()


      
        String monitoringProperty = System.getProperty(USE_MONITORING_SOCKETS_PROPERTY);

        if ((null != monitoringProperty) && (monitoringProperty.equalsIgnoreCase(TRUE))) {
            _isMonitoringOn = true;
            _hashCode++;
        } else {
            _isMonitoringOn = false;
        }
        return;
    
Methods Summary
public java.net.SocketcreateSocket(java.lang.String host, int port)

        try {
            if (_isMonitoringOn) {
                return new MonitoringSocket(host, port);
            } else {
                return new Socket(host, port);
            }
        } catch (IOException e) {
        }
        return null;
    
public booleanequals(java.lang.Object object)

        if (object instanceof PropertyBasedMonitoringSocket_RMIClientSocketFactory) {
            return true;
        }
        return false;
    
public inthashCode()

        return _hashCode;