2019-12-28 14:48:39 +01:00
|
|
|
package envoy.server;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
2019-12-30 14:53:40 +01:00
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.Set;
|
2019-12-28 14:48:39 +01:00
|
|
|
|
|
|
|
import com.jenkov.nioserver.Server;
|
|
|
|
|
|
|
|
/**
|
2019-12-30 15:15:25 +01:00
|
|
|
* Starts the server.<br>
|
|
|
|
* <br>
|
2019-12-28 14:48:39 +01:00
|
|
|
* Project: <strong>envoy-server-standalone</strong><br>
|
|
|
|
* File: <strong>Startup.java</strong><br>
|
|
|
|
* Created: <strong>24.12.2019</strong><br>
|
2019-12-30 15:15:25 +01:00
|
|
|
*
|
2019-12-28 14:48:39 +01:00
|
|
|
* @author Kai S. K. Engelbart
|
|
|
|
* @since Envoy Server Standalone v0.1-alpha
|
|
|
|
*/
|
|
|
|
public class Startup {
|
|
|
|
|
2019-12-30 15:15:25 +01:00
|
|
|
/**
|
|
|
|
* Starts the server.
|
|
|
|
*
|
|
|
|
* @param args the run configuration. Currently unused.
|
|
|
|
* @throws IOException if the server crashes
|
|
|
|
* @since Envoy Server Standalone v0.1-alpha
|
|
|
|
*/
|
2019-12-28 14:48:39 +01:00
|
|
|
public static void main(String[] args) throws IOException {
|
2019-12-30 14:53:40 +01:00
|
|
|
Set<ObjectProcessor<?, ?>> processors = new HashSet<>();
|
|
|
|
processors.add(new LoginCredentialProcessor());
|
|
|
|
processors.add(new MessageProcessor());
|
|
|
|
Server server = new Server(8080, () -> new ObjectMessageReader(), new ObjectMessageProcessor(processors));
|
2019-12-28 14:48:39 +01:00
|
|
|
server.start();
|
|
|
|
}
|
|
|
|
}
|