Package eu.tneitzel.rmg.networking
Class LimitedSocketFactory
- java.lang.Object
-
- java.rmi.server.RMISocketFactory
-
- eu.tneitzel.rmg.networking.LimitedSocketFactory
-
- All Implemented Interfaces:
RMIClientSocketFactory,RMIServerSocketFactory
public class LimitedSocketFactory extends RMISocketFactory
The LimitedSocketFactoryClass is used when creating a rogue JMX server. It is required to bind the server only to the address that was specified by the user.- Author:
- Tobias Neitzel (@qtc_de)
-
-
Constructor Summary
Constructors Constructor Description LimitedSocketFactory(String address)Creates a limited socket factory using the specified address.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerSocketcreateServerSocket(int port)Creates a server socket.SocketcreateSocket(String host, int port)Creates a client socket.-
Methods inherited from class java.rmi.server.RMISocketFactory
getDefaultSocketFactory, getFailureHandler, getSocketFactory, setFailureHandler, setSocketFactory
-
-
-
-
Constructor Detail
-
LimitedSocketFactory
public LimitedSocketFactory(String address)
Creates a limited socket factory using the specified address.- Parameters:
address- Address to bind the socket factory to.
-
-
Method Detail
-
createSocket
public Socket createSocket(String host, int port) throws IOException
Creates a client socket.- Specified by:
createSocketin interfaceRMIClientSocketFactory- Specified by:
createSocketin classRMISocketFactory- Throws:
IOException
-
createServerSocket
public ServerSocket createServerSocket(int port) throws IOException
Creates a server socket.- Specified by:
createServerSocketin interfaceRMIServerSocketFactory- Specified by:
createServerSocketin classRMISocketFactory- Throws:
IOException
-
-