Examples of ActorRef


Examples of co.paralleluniverse.actors.ActorRef

                a = actor.get().ref();
            return a;
        }

        private ActorRef actor() {
            final ActorRef a = getActor();
            if (a == null)
                throw new RuntimeException("Temporary actor is out of scope");
            return a;
        }
View Full Code Here

Examples of co.paralleluniverse.actors.ActorRef

            return actor().getName();
        }

        @Override
        public void interrupt() {
            final ActorRef a = getActor();
            if (a != null)
                a.interrupt();
        }
View Full Code Here

Examples of co.paralleluniverse.actors.ActorRef

                a.interrupt();
        }

        @Override
        public void send(Message message) throws SuspendExecution {
            final ActorRef a = getActor();
            if (a != null)
                a.send(message);
        }
View Full Code Here

Examples of co.paralleluniverse.actors.ActorRef

                a.send(message);
        }

        @Override
        public void sendSync(Message message) throws SuspendExecution {
            final ActorRef a = getActor();
            if (a != null)
                a.sendSync(message);
        }
View Full Code Here

Examples of co.paralleluniverse.actors.ActorRef

                a.sendSync(message);
        }

        @Override
        public boolean send(Message message, long timeout, TimeUnit unit) throws SuspendExecution, InterruptedException {
            final ActorRef a = getActor();
            if (a != null)
                return a.send(message, timeout, unit);
            return true;
        }
View Full Code Here

Examples of co.paralleluniverse.actors.ActorRef

            return send(msg, timeout.nanosLeft(), TimeUnit.NANOSECONDS);
        }

        @Override
        public boolean trySend(Message message) {
            final ActorRef a = getActor();
            if (a != null)
                return a.trySend(message);
            return true;
        }
View Full Code Here

Examples of co.paralleluniverse.actors.ActorRef

    @Override
    public void onOpen(Session session, EndpointConfig config) {
        if (this.config == null)
            this.config = config;
        ActorRef webActor = getHttpSessionActor(config).getWebActor();
        if (webActor != null) {
            WebSocketActorRef wsa = attachWebActor(session, config, webActor);
            wsa.onOpen();
        } else {
            try {
View Full Code Here

Examples of co.paralleluniverse.actors.ActorRef

        }
    }

    private ChildEntry addChild1(ChildSpec spec) {
        LOG.debug("Adding child {}", spec);
        ActorRef actor = null;
        if (spec.builder instanceof ActorRef) {
            actor = (ActorRef) spec.builder;
            if (findEntry(actor) != null)
                throw new SupervisorException("Supervisor " + this + " already supervises actor " + actor);
        }

        Object id = spec.getId();
        if (id == null && actor != null)
            id = actor.getName();
        if (id != null && findEntryById(id) != null)
            throw new SupervisorException("Supervisor " + this + " already supervises an actor by the name " + id);
        final ChildEntry child = new ChildEntry(spec, actor);
        children.add(child);
        if (id != null)
View Full Code Here

Examples of co.paralleluniverse.actors.ActorRef

        boolean handled = false;
        try {
            if (m instanceof ExitMessage) {
                final ExitMessage death = (ExitMessage) m;
                if (death.getWatch() != null) {
                    final ActorRef actor = death.actor;
                    final ChildEntry child = findEntry(actor);

                    if (child != null) {
                        LOG.info("Detected child death: " + child + ". cause: ", death.cause);
                        if (!restartStrategy.onChildDeath(this, child, death.cause)) {
View Full Code Here

Examples of co.paralleluniverse.actors.ActorRef

                    return true;
                }
            // fall through
            case PERMANENT:
                LOG.info("Supervisor trying to restart child {}. (cause: {})", child, cause);
                final ActorRef actor = child.actor;
                shutdownChild(child, true);
                child.restartHistory.addRestart(now);
                final int numRestarts = child.restartHistory.numRestarts(now - child.spec.unit.toMillis(child.spec.duration));
                if (LOG.isDebugEnabled())
                    LOG.debug("Child {} has been restarted {} times in the last {} {}s", child, numRestarts, child.spec.duration, child.spec.unit);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.