Package org.quna.rsc.data.message

Examples of org.quna.rsc.data.message.Message


        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTextField5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField5ActionPerformed
        String message = jTextField5.getText ();
        Message msg = new Message (message, Date.from (Instant.now ()), "asdf", MessageType.MESSAGE);
        ByteBuffer buffer = StringByteBufferConverter.ByteBufferFromString (msg.toString ()) ;
        try {
            socket.write (buffer);
        } catch (IOException ex) {
            Logger.getLogger (ClientFrame.class.getName())
                .log (Level.SEVERE, null, ex);
View Full Code Here


        jTextField5.setText ("");
    }//GEN-LAST:event_jTextField5ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        String message = jTextField5.getText ();
        Message msg = new Message (message, Date.from (Instant.now ()), "asdf", MessageType.MESSAGE);
        ByteBuffer buffer = StringByteBufferConverter.ByteBufferFromString (msg.toString ()) ;
        try {
            socket.write (buffer) ;
        } catch (IOException ex) {
            Logger.getLogger (ClientFrame.class.getName())
                .log (Level.SEVERE, null, ex);
View Full Code Here

   
    @Override
    void process (ByteBuffer data) {
        try {
            String string = StringByteBufferConverter.decodeToString (data);
            Message message = new Message (string);
            ActionListener listener = listenerMap.get (message.getMessageType ());
            if (listener != null) {
                listener.process (message);
            }
        } catch (ParseException ex) {
            logger.log (Level.SEVERE, "", ex);
View Full Code Here

        if (welcomeMsg == null || welcomeMsg.isEmpty ()) {
            welcomeMsg = languageResource.getString ("defWelcome").replace
            ("%roomName", serverName) ;
        }
       
        Message welcome = new Message (welcomeMsg, Date.from (Instant.now ()),
            "root", MessageType.INFO);
       
        rw.write (channel, StringByteBufferConverter.ByteBufferFromString (welcome.toString ()));
        channel.register (selector, SelectionKey.OP_READ);
        userList.add (new User (channel, false));
    }   
View Full Code Here

    @Override
    void process (Selector selector, ByteBuffer data) {
        try {
            String string = StringByteBufferConverter.decodeToString (data);
            System.out.println (string);
            Message message = new Message (string);
           
            ActionListener listener = listenerMap.get (message.getMessageType ());
            if (listener != null) {
                listener.process (message);
            }
        } catch (ParseException ex) {
            logger.log (Level.SEVERE, null, ex);
View Full Code Here

TOP

Related Classes of org.quna.rsc.data.message.Message

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.