* Add files via upload * Update pom.xml * Update RunGuice.java * Update Communication.java * Update CommunicationMode.java * Update DefaultCommunicator.java * Update EmailCommunicationMode.java * Update IMCommunicationMode.java * Update SMSCommunicationMode.java * Update MessageLogger.java * Update MessageSentLoggable.java * Update AOPModule.java * Update BasicModule.java * Update CommunicationModel.java * Update Communicator.java * Update BasicModule.java * Update RunGuice.java * Update MessageLogger.java * Update Communicator.java * Update pom.xml * BAEL-278: Updated README.md * BAEL-554: Add and update README.md files * Update pom.xml * Update pom.xml * Update pom.xml * BAEL-345: fixed assertion * BAEL-109: Updated README.md * BAEL-345: Added README.md * Reinstating reactor-core module in root-level pom * BAEL-393: Adding guide-intro module to root pom * BAEL-9: Updated README.md * BAEL-157: README.md updated * Changed project name * Update RunGuice.java Removed references to message logging and output * Update Communication.java Removed message logging-related code * BAEL-566: Updated README.md * New project name * BAEL-393: removing guice-intro directory * BAEL-393: renamed module guice-intro to guice in root pom.xml
33 lines
875 B
Java
33 lines
875 B
Java
|
|
package com.baeldung.examples;
|
|
|
|
import com.baeldung.examples.guice.Communication;
|
|
import com.baeldung.examples.guice.binding.AOPModule;
|
|
import com.baeldung.examples.guice.modules.BasicModule;
|
|
import com.google.inject.Guice;
|
|
import com.google.inject.Injector;
|
|
import java.util.Scanner;
|
|
|
|
/**
|
|
*
|
|
* @author baeldung
|
|
*/
|
|
public class RunGuice {
|
|
|
|
public static void main(String[] args) {
|
|
Injector injector = Guice.createInjector(new BasicModule(), new AOPModule());
|
|
Communication comms = injector.getInstance(Communication.class);
|
|
Scanner scanner = new Scanner(System.in);
|
|
while (true) {
|
|
String input = scanner.nextLine();
|
|
if (input.equalsIgnoreCase("q")) {
|
|
System.exit(0);
|
|
} else {
|
|
comms.sendMessage(input);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|