Skip to content

Commit 7885380

Browse files
committed
Apply Google coding conventions
1 parent 230c02f commit 7885380

File tree

2 files changed

+44
-45
lines changed
  • publish-subscribe/src
    • main/java/com/iluwatar/publish/subscribe
    • test/java/com/iluwatar/publish/subscribe

2 files changed

+44
-45
lines changed

publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/App.java

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,49 @@
66

77
/**
88
*
9-
* When applications communicate with each other using a messaging system
10-
* they first need to establish a communication channel that will carry the
11-
* data. Message Channel decouples Message producers (publisher) and consumers (subscriber).
9+
* When applications communicate with each other using a messaging system they first need to
10+
* establish a communication channel that will carry the data. Message Channel decouples Message
11+
* producers (publisher) and consumers (subscriber).
1212
* <p>
13-
* The sending application doesn't necessarily know what particular applications
14-
* will end up retrieving it, but it can be assured that the application that
15-
* retrieves the information is interested in that information. This is because
16-
* the messaging system has different Message Channels for different types of
17-
* information the applications want to communicate. When an application sends
18-
* information, it doesn't randomly add the information to any channel available;
19-
* it adds it to a channel whose specific purpose is to communicate that sort of
20-
* information. Likewise, an application that wants to receive particular information
21-
* doesn't pull info off some random channel; it selects what channel to get information
22-
* from based on what type of information it wants.
13+
* The sending application doesn't necessarily know what particular applications will end up
14+
* retrieving it, but it can be assured that the application that retrieves the information is
15+
* interested in that information. This is because the messaging system has different Message
16+
* Channels for different types of information the applications want to communicate. When an
17+
* application sends information, it doesn't randomly add the information to any channel available;
18+
* it adds it to a channel whose specific purpose is to communicate that sort of information.
19+
* Likewise, an application that wants to receive particular information doesn't pull info off some
20+
* random channel; it selects what channel to get information from based on what type of information
21+
* it wants.
2322
* <p>
24-
* In this example we use Apache Camel to establish different Message Channels. The first
25-
* one reads from standard input and delivers messages to Direct endpoints (Publish; Broadcast). The other Message
26-
* Channels are established from the Direct component to different Endpoints (Subscriber). No actual messages are sent,
27-
* only the established routes are printed to standard output.
23+
* In this example we use Apache Camel to establish different Message Channels. The first one reads
24+
* from standard input and delivers messages to Direct endpoints (Publish; Broadcast). The other
25+
* Message Channels are established from the Direct component to different Endpoints (Subscriber).
26+
* No actual messages are sent, only the established routes are printed to standard output.
2827
*
2928
*/
3029
public class App {
3130

32-
/**
33-
* Program entry point
34-
*
35-
* @param args command line args
36-
* @throws Exception
37-
*/
38-
public static void main(String[] args) throws Exception {
39-
CamelContext context = new DefaultCamelContext();
40-
41-
context.addRoutes(new RouteBuilder() {
31+
/**
32+
* Program entry point
33+
*
34+
* @param args
35+
* command line args
36+
* @throws Exception
37+
*/
38+
public static void main(String[] args) throws Exception {
39+
CamelContext context = new DefaultCamelContext();
4240

43-
@Override
44-
public void configure() throws Exception {
45-
from("stream:in")
46-
.multicast()
47-
.to("direct:greetings1", "direct:greetings2", "direct:greetings3");
48-
}
49-
});
50-
51-
context.start();
52-
context.getRoutes().stream().forEach((r) -> System.out.println(r));
53-
context.stop();
54-
}
41+
context.addRoutes(new RouteBuilder() {
42+
43+
@Override
44+
public void configure() throws Exception {
45+
from("stream:in").multicast().to("direct:greetings1", "direct:greetings2",
46+
"direct:greetings3");
47+
}
48+
});
49+
50+
context.start();
51+
context.getRoutes().stream().forEach((r) -> System.out.println(r));
52+
context.stop();
53+
}
5554
}

publish-subscribe/src/test/java/com/iluwatar/publish/subscribe/AppTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
*/
1010
public class AppTest {
1111

12-
@Test
13-
public void test() throws Exception {
14-
String[] args = {};
15-
App.main(args);
16-
}
17-
}
12+
@Test
13+
public void test() throws Exception {
14+
String[] args = {};
15+
App.main(args);
16+
}
17+
}

0 commit comments

Comments
 (0)