Package com.jk.core.reflection.server
Class ReflectionServer
java.lang.Object
com.jk.core.reflection.server.ReflectionServer
This class represents a server that handles reflection-based method
 invocations over a network.
- Version:
 - 1.0
 - Author:
 - Dr. Jalal H. Kiswani
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intRepresents the default port number for the server. - 
Constructor Summary
ConstructorsConstructorDescriptionThis method constructs a newReflectionServer.ReflectionServer(int port) This method constructs a newReflectionServerwith the provided port. - 
Method Summary
Modifier and TypeMethodDescriptionprotected voidhandleClient(Socket client) This method handles a client connection by creating aClientHandlerto process the client's request.voidstart()This method starts the reflection server and listens for incoming client connections.voidstop()This method stops the reflection server, closing the server socket and stopping ongoing client handling. 
- 
Field Details
- 
DEFAULT_PORT
public static final int DEFAULT_PORTRepresents the default port number for the server.- See Also:
 
 
 - 
 - 
Constructor Details
- 
ReflectionServer
public ReflectionServer()This method constructs a newReflectionServer. - 
ReflectionServer
public ReflectionServer(int port) This method constructs a newReflectionServerwith the provided port.- Parameters:
 port- Specifies the server port number on which the server should listen.
 
 - 
 - 
Method Details
- 
handleClient
This method handles a client connection by creating aClientHandlerto process the client's request.- Parameters:
 client- Specifies the connected client's socket.- Throws:
 IOException- if an I/O exception has occurred.
 - 
start
public void start()This method starts the reflection server and listens for incoming client connections. - 
stop
This method stops the reflection server, closing the server socket and stopping ongoing client handling.- Throws:
 IOException- if an I/O exception has occurred.
 
 -