![JAR search and dependency download from the Maven repository](/logo.png)
co.paralleluniverse.actors.behaviors.GenServerActor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quasar-actors Show documentation
Show all versions of quasar-actors Show documentation
lightweight threads and actors for the JVM.
/*
* 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.behaviors;
import co.paralleluniverse.actors.Actor;
import co.paralleluniverse.actors.ActorRef;
import co.paralleluniverse.actors.MailboxConfig;
import co.paralleluniverse.actors.behaviors.GenServer.GenServerRequest;
import co.paralleluniverse.fibers.FiberScheduler;
import co.paralleluniverse.fibers.SuspendExecution;
import co.paralleluniverse.strands.Strand;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author pron
*/
public class GenServerActor extends GenBehaviorActor {
private static final Logger LOG = LoggerFactory.getLogger(GenServerActor.class);
private TimeUnit timeoutUnit;
private long timeout;
public GenServerActor(String name, Server server, long timeout, TimeUnit unit, Strand strand, MailboxConfig mailboxConfig) {
super(name, server, strand, mailboxConfig);
this.timeoutUnit = timeout > 0 ? unit : null;
this.timeout = timeout;
}
//
/////////// Behavior boilerplate ///////////////////////////////////
@Override
protected GenServer makeRef(ActorRef
//
/////////// Constructors ///////////////////////////////////
public GenServerActor(String name, Server server, MailboxConfig mailboxConfig) {
this(name, server, -1, null, null, mailboxConfig);
}
public GenServerActor(String name, Server server) {
this(name, server, -1, null, null, null);
}
public GenServerActor(Server server, MailboxConfig mailboxConfig) {
this(null, server, -1, null, null, mailboxConfig);
}
public GenServerActor(Server server) {
this(null, server, -1, null, null, null);
}
public GenServerActor(String name, MailboxConfig mailboxConfig) {
this(name, null, -1, null, null, mailboxConfig);
}
public GenServerActor(String name) {
this(name, null, -1, null, null, null);
}
public GenServerActor(MailboxConfig mailboxConfig) {
this(null, null, -1, null, null, mailboxConfig);
}
public GenServerActor() {
this(null, null, -1, null, null, null);
}
//
protected Server server() {
return (Server) getInitializer();
}
@Override
public Logger log() {
return LOG;
}
public static GenServerActor currentGenServer() {
return (GenServerActor) Actor.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy