Package co.paralleluniverse.actors

Source Code of co.paralleluniverse.actors.LifecycleListenerProxy

/*
* Quasar: lightweight threads and actors for the JVM.
* Copyright (C) 2013, Parallel Universe Software Co. All rights reserved.
*
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*   or (per the licensee's choosing)
* under the terms of the GNU Lesser General Public License version 3.0
* as published by the Free Software Foundation.
*/
package co.paralleluniverse.actors;

import co.paralleluniverse.actors.RemoteActorRef.RemoteActorRegisterListenerAdminMessage;
import co.paralleluniverse.actors.RemoteActorRef.RemoteActorUnregisterListenerAdminMessage;

/**
*
* @author pron
*/
abstract public class LifecycleListenerProxy {
    public void addLifecycleListener(RemoteActorRef actor, LifecycleListener listener) {
        actor.internalSendNonSuspendable(new RemoteActorRegisterListenerAdminMessage((ActorRefImpl.ActorLifecycleListener) listener));
    }

    public void removeLifecycleListener(RemoteActorRef actor, LifecycleListener listener) {
        actor.internalSendNonSuspendable(new RemoteActorUnregisterListenerAdminMessage(listener));
    }

    public void removeLifecycleListeners(RemoteActorRef actor, ActorRef observer) {
        actor.internalSendNonSuspendable(new RemoteActorUnregisterListenerAdminMessage((ActorRefImpl)observer));
    }
}
TOP

Related Classes of co.paralleluniverse.actors.LifecycleListenerProxy

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.