Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 //
 //  ========================================================================
 //  Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
 //  ------------------------------------------------------------------------
 //  All rights reserved. This program and the accompanying materials
 //  are made available under the terms of the Eclipse Public License v1.0
 //  and Apache License v2.0 which accompanies this distribution.
 //
 //      The Eclipse Public License is available at
//      http://www.eclipse.org/legal/epl-v10.html
//
//      The Apache License v2.0 is available at
//      http://www.opensource.org/licenses/apache2.0.php
//
//  You may elect to redistribute this code under either of these licenses.
//  ========================================================================
//
package org.eclipse.jetty.server.nio;

A specialized version of SelectChannelConnector that supports org.eclipse.jetty.io.NetworkTrafficListeners.

org.eclipse.jetty.io.NetworkTrafficListeners can be added and removed dynamically before and after this connector has been started without causing java.util.ConcurrentModificationExceptions.

Parameters:
listener the listener to add
    public void addNetworkTrafficListener(NetworkTrafficListener listener)
    {
        .add(listener);
    }

    

Parameters:
listener the listener to remove
    {
        .remove(listener);
    }
    @Override
    protected SelectChannelEndPoint newEndPoint(SocketChannel channelSelectorManager.SelectSet selectSetSelectionKey keythrows IOException
    {
        NetworkTrafficSelectChannelEndPoint endPoint = new NetworkTrafficSelectChannelEndPoint(channelselectSetkey);
        endPoint.setConnection(selectSet.getManager().newConnection(channel,endPointkey.attachment()));
        endPoint.notifyOpened();
        return endPoint;
    }
    @Override
    protected void endPointClosed(SelectChannelEndPoint endpoint)
    {
        super.endPointClosed(endpoint);
    }
New to GrepCode? Check out our FAQ X