public void start() {
		this.logger.info("starting reflection server on port : " + this.port);
		try {
			this.server = new ServerSocket(this.port);
			while (!this.stopped) {
				this.logger.info("Reflection server waiting client connection...");
				this.waitingClient = true;
				final Socket client = this.server.accept();
				this.waitingClient = false;
				this.logger.info("handling client connection request to reflection server...");
				handleClient(client);
			}
		} catch (final Exception e) {
			if (e instanceof RuntimeException) {
				throw (RuntimeException) e;
			}
			if (e instanceof SocketException && e.getMessage().equals("socket closed")) {
				// it is safe to eat the exception since it most likely caused
				// by calling the stop method
			} else {
				throw new RemoteReflectionException(e);
			}
		} finally {
			if (this.server != null && !this.server.isClosed()) {
				try {
					this.server.close();
				} catch (final IOException e) {
					throw new RemoteReflectionException(e);
				}
			}
		}
	}
public void start ( ) { this . logger . info ( "starting reflection server on port : " + this . port ) ; try { this . server = new ServerSocket ( this . port ) ; while ( ! this . stopped ) { this . logger . info ( "Reflection server waiting client connection..." ) ; this . waitingClient = true ; final Socket client = this . server . accept ( ) ; this . waitingClient = false ; this . logger . info ( "handling client connection request to reflection server..." ) ; handleClient ( client ) ; } } catch ( final Exception e ) { if ( e instanceof RuntimeException ) { throw ( RuntimeException ) e ; } if ( e instanceof SocketException && e . getMessage ( ) . equals ( "socket closed" ) ) { } else { throw new RemoteReflectionException ( e ) ; } } finally { if ( this . server != null && ! this . server . isClosed ( ) ) { try { this . server . close ( ) ; } catch ( final IOException e ) { throw new RemoteReflectionException ( e ) ; } } } }
Start the server on the port set in the constructor, this method behaves as
follows :
<ul>
<li>Start server socket on the assigned port number</li>
<li>starts accepting clients connection</li>
<li>for every client connection received , handleClient method will be called
</ul>
.