Пример #1
0
 @SuppressWarnings("unchecked")
 private Pair<ActorRef<? extends WebMessage>, Class<? extends ActorImpl<? extends WebMessage>>>
     autoCreateActor(FullHttpRequest req) {
   registerActorClasses();
   final String uri = req.getUri();
   for (final Class<?> c : actorClasses) {
     if (WebActorHandler.handlesWithHttp(uri, c) || WebActorHandler.handlesWithWebSocket(uri, c))
       return new Pair<
           ActorRef<? extends WebMessage>, Class<? extends ActorImpl<? extends WebMessage>>>(
           Actor.newActor(
                   new ActorSpec(
                       c, actorParams != null ? actorParams.get(c) : EMPTY_OBJECT_ARRAY))
               .spawn(),
           (Class<? extends ActorImpl<? extends WebMessage>>) c);
   }
   return null;
 }
Пример #2
0
 @Override
 public final boolean handlesWithHttp(String uri) {
   return WebActorHandler.handlesWithHttp(uri, actorClass);
 }