mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-19 03:26:07 +00:00
Reformat rest of the design patterns - Issue #224
This commit is contained in:
@@ -46,7 +46,7 @@ public class LoadBalancer {
|
||||
Server server = servers.get(lastServedId++);
|
||||
server.serve(request);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.iluwatar.monostate;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Request class. A {@link Server} can handle an instance of a Request.
|
||||
* The Request class. A {@link Server} can handle an instance of a Request.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.iluwatar.monostate;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Server class. Each Server sits behind a LoadBalancer which delegates the call to the
|
||||
* servers in a simplistic Round Robin fashion.
|
||||
* The Server class. Each Server sits behind a LoadBalancer which delegates the call to the servers
|
||||
* in a simplistic Round Robin fashion.
|
||||
*
|
||||
*/
|
||||
public class Server {
|
||||
@@ -26,6 +26,7 @@ public class Server {
|
||||
}
|
||||
|
||||
public final void serve(Request request) {
|
||||
System.out.println("Server ID " + id + " associated to host : " + getHost() + " and Port " + getPort() +" Processed request with value " + request.value);
|
||||
System.out.println("Server ID " + id + " associated to host : " + getHost() + " and Port "
|
||||
+ getPort() + " Processed request with value " + request.value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user