Netflix/karyon — pull request #73 by NiteshKant (2014-07-09 08:59:52+00:00)
Title: Karyon2.0

[karyon 2.0](https://github.com/Netflix/karyon/wiki/Karyon-2.0) release candidate changes.

Revamp of karyon to use [RxNetty](https://github.com/Netflix/RxNetty) as the transport and a better bootstrapping infrastructure as described in the wiki above.

Now, an application class can be written as follows:

```java

@ArchaiusBootstrap
@KaryonBootstrap(name = "hello-netflix-oss")
@Modules(include = {HelloWorldApp.KaryonJerseyModuleImpl.class, KaryonWebAdminModule.class, KaryonEurekaModule.class})
public final class HelloWorldApp {

public static class KaryonJerseyModuleImpl extends KaryonJerseyModule {

@Override
protected void configure() {
super.configure();
bind(AuthenticationService.class).to(AuthenticationServiceImpl.class);
}

@Override
public int serverPort() {
return 8888;
}

@Override
public int shutdownPort() {
return 8899;
}

@Override
public void configureInterceptors(GovernatorHttpInterceptorSupport interceptorSupport) {
interceptorSupport.forUri("/*").intercept(LoggingInterceptor.class);
interceptorSupport.forUri("/hello").interceptIn(AuthInterceptor.class);
}
}
}
```

and then can be started running the main class `KaryonServer` as

```
java com.netflix.karyon.KaryonServer com.netflix.hellonoss.server.HelloWorldApp
```

The example is provided in `karyon-examples/hello-netflix-oss` module.