Package co.paralleluniverse.actors.behaviors.Server

Examples of co.paralleluniverse.actors.behaviors.Server.ServerRequest


     * {@link #handleCast(ActorRef, Object, Object) handleCast} or {@link #handleInfo(Object) handleInfo} as appropriate.
     */
    @Override
    protected void handleMessage(Object m) throws InterruptedException, SuspendExecution {
        if (m instanceof ServerRequest) {
            ServerRequest r = (ServerRequest) m;
            switch (r.getType()) {
                case CALL:
                    try {
                        final V res = handleCall((ActorRef<V>) r.getFrom(), r.getId(), (CallMessage) r.getMessage());
                        if (res != null)
                            reply((ActorRef<V>) r.getFrom(), r.getId(), res == NULL_RETURN_VALUE ? null : res);
                    } catch (Exception e) {
                        replyError((ActorRef<V>) r.getFrom(), r.getId(), e);
                    }
                    break;

                case CAST:
                    handleCast((ActorRef<V>) r.getFrom(), r.getId(), (CastMessage) r.getMessage());
                    break;
            }
        } else
            handleInfo(m);
    }
View Full Code Here

TOP

Related Classes of co.paralleluniverse.actors.behaviors.Server.ServerRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.