Iris/src/main/java/TcpServer.java
protected synchronized void fireTcpServerSocketReceived() {
        
        final TcpServer.Listener[] ll = listeners.toArray(new TcpServer.Listener[ listeners.size() ] );
        
        // Make a Runnable object to execute the calls to listeners.
        // In the event we don't have an Executor, this results in
        // an unnecessary object instantiation, but it also makes
        // the code more maintainable.
        Runnable r = new Runnable(){
            public void run(){
            for( Listener l : ll ){
                try{
                    l.socketReceived(event);
                } catch( Exception exc ){
                    LOGGER.warning("TcpServer.Listener " + l + " threw an exception: " + exc.getMessage() );
                    fireExceptionNotification(exc);
                }   // end catch
            }   // end for: each listener
            }   // end run
        };
        
        if( this.executor == null ){
            r.run();
        } else {
            try{
                this.executor.execute( r ); 
            } catch( Exception exc ){
                LOGGER.warning("Supplied Executor " + this.executor + " threw an exception: " + exc.getMessage() );
                fireExceptionNotification(exc);
            }   // end catch
        }   // end else: other thread
     }
/** Fires event when a socket is received */
Fires event when a socket is received
Fires event when a socket is received
protected synchronized void fireTcpServerSocketReceived() {
        final TcpServer.Listener[] ll = listeners.toArray(new TcpServer.Listener[ listeners.size() ] );
        Runnable r = new Runnable(){
            public void run(){
            for( Listener l : ll ){
                try{
                    l.socketReceived(event);
                } catch( Exception exc ){
                    LOGGER.warning("TcpServer.Listener " + l + " threw an exception: " + exc.getMessage() );
                    fireExceptionNotification(exc);
                }   
            }   
            }   
        };
        if( this.executor == null ){
            r.run();
        } else {
            try{
                this.executor.execute( r ); 
            } catch( Exception exc ){
                LOGGER.warning("Supplied Executor " + this.executor + " threw an exception: " + exc.getMessage() );
                fireExceptionNotification(exc);
            }   
        }   
     }
protected synchronized void fireTcpServerSocketReceived ( ) { final TcpServer . Listener [ ] ll = listeners . toArray ( new TcpServer . Listener [ listeners . size ( ) ] ) ; Runnable r = new Runnable ( ) { public void run ( ) { for ( Listener l : ll ) { try { l . socketReceived ( event ) ; } catch ( Exception exc ) { LOGGER . warning ( "TcpServer.Listener " + l + " threw an exception: " + exc . getMessage ( ) ) ; fireExceptionNotification ( exc ) ; } } } } ; if ( this . executor == null ) { r . run ( ) ; } else { try { this . executor . execute ( r ) ; } catch ( Exception exc ) { LOGGER . warning ( "Supplied Executor " + this . executor + " threw an exception: " + exc . getMessage ( ) ) ; fireExceptionNotification ( exc ) ; } } }
Fires event when a socket is received
Fires event when a socket is received
// Make a Runnable object to execute the calls to listeners. // In the event we don't have an Executor, this results in // an unnecessary object instantiation, but it also makes // the code more maintainable. // end catch // end for: each listener // end run // end catch // end else: other thread