All Downloads are FREE. Search and download functionalities are using the official Maven repository.

link.jfire.socket.socketserver.transfer.server.ServerStatus Maven / Gradle / Ivy

Go to download

Jfire - socket is a server-side framework based on AIO. Users only need a simple implementation of a business logic processing interface can be the business data processing. The framework provides the client and server at the same time. Have strong connection capacity. Single server provides tens of thousands of connections.

The newest version!
package link.jfire.socket.socketserver.transfer.server;

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import javax.annotation.Resource;
import link.jfire.socket.socketserver.bus.ServerChannelInfo;

@Resource
public class ServerStatus
{
    private Queue messages = new ConcurrentLinkedQueue<>();
    private boolean        record   = false;
    
    public Queue getMessages()
    {
        return messages;
    }
    
    public void add(ServerChannelInfo msg)
    {
        if (record)
        {
            messages.add(msg);
        }
    }
    
    public void remove(ServerChannelInfo message)
    {
        if (record)
        {
            messages.remove(message);
        }
    }
    
    public boolean isRecord()
    {
        return record;
    }
    
    public void setRecord(boolean record)
    {
        this.record = record;
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy