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);
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ public class AppTest {
|
||||
// Both Should have the same LastServedId
|
||||
Assert.assertTrue(balancer.getLastServedId() == balancer2.getLastServedId());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testMain() {
|
||||
String[] args = {};
|
||||
|
Reference in New Issue
Block a user