All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.cassandra.utils.RMIServerSocketFactoryImpl Maven / Gradle / Ivy

Go to download

The Apache Cassandra Project develops a highly scalable second-generation distributed database, bringing together Dynamo's fully distributed design and Bigtable's ColumnFamily-based data model.

There is a newer version: 5.0.5
Show newest version
package org.apache.cassandra.utils;

import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.rmi.server.RMIServerSocketFactory;
import javax.net.ServerSocketFactory;


public class RMIServerSocketFactoryImpl implements RMIServerSocketFactory
{

    public ServerSocket createServerSocket(final int pPort) throws IOException
    {
        ServerSocket socket = ServerSocketFactory.getDefault()
                                                 .createServerSocket(pPort, 0, InetAddress.getLoopbackAddress());
        socket.setReuseAddress(true);
        return socket;
    }

    public boolean equals(Object obj)
    {
        if (obj == null)
        {
            return false;
        }
        if (obj == this)
        {
            return true;
        }

        return obj.getClass().equals(getClass());
    }

    public int hashCode()
    {
        return RMIServerSocketFactoryImpl.class.hashCode();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy