Package uk.ac.cam.cl.fjava.messages

Examples of uk.ac.cam.cl.fjava.messages.StatusMessage


        multiQueue = q;
        nickname = String.format("Anonymous%05d", nickend);
        clientMessages = new SafeMessageQueue<Message>();

        q.register(clientMessages);
        StatusMessage connected = new StatusMessage(String.format(
                "%s connected from %s.", nickname, s.getInetAddress()
                        .getHostName()));
        multiQueue.put(connected);

        sender = new Thread(new SenderTask(this));
View Full Code Here


        receiver.start();
    }

    public void disconnect() {
        multiQueue.deregister(clientMessages);
        StatusMessage goodBye = new StatusMessage(nickname
                + " has disconnected.");
        multiQueue.put(goodBye);
    }
View Full Code Here

        }
        catch (SQLException e) {
            e.printStackTrace();
        }
        q.register(clientMessages);
        StatusMessage connected = new StatusMessage(String.format(
                "%s connected from %s.", nickname, s.getInetAddress()
                        .getHostName()));
        multiQueue.put(connected);

        sender = new Thread(new SenderTask(this));
View Full Code Here

        receiver.start();
    }

    public void disconnect() {
        multiQueue.deregister(clientMessages);
        StatusMessage goodBye = new StatusMessage(nickname
                + " has disconnected.");
        multiQueue.put(goodBye);
    }
View Full Code Here

            }
            Message mesOut = null;
            if (mesIn instanceof ChangeNickMessage) {
                String oldnickname = cHandler.nickname;
                cHandler.nickname = ((ChangeNickMessage) mesIn).name;
                mesOut = new StatusMessage(oldnickname + "is now known as "
                        + cHandler.nickname);
            }

            else if (mesIn instanceof ChatMessage) {
                // mesOut = new RelayMessage(cHandler.nickname,
View Full Code Here

            }
            Message mesOut = null;
            if (mesIn instanceof ChangeNickMessage) {
                String oldnickname = cHandler.nickname;
                cHandler.nickname = ((ChangeNickMessage) mesIn).name;
                mesOut = new StatusMessage(oldnickname + "is now known as "
                        + cHandler.nickname);
            }

            else if (mesIn instanceof ChatMessage) {
                mesOut = new RelayMessage(cHandler.nickname,
View Full Code Here

TOP

Related Classes of uk.ac.cam.cl.fjava.messages.StatusMessage

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.