cometd-java/cometd-java-server/cometd-java-server-common/src/main/java/org/cometd/server/ServerSessionImpl.java
/**
     * @param message the message that caused the removal, or null
     * @param timeout whether the session has been removed due a timeout
     * @return True if the session was connected.
     */
@param message the message that caused the removal, or null
@param timeout whether the session has been removed due a timeout
@return True if the session was connected.
@param message the message that caused the removal or null @param timeout whether the session has been removed due a timeout @return True if the session was connected .
protected boolean removed(ServerMessage message, boolean timeout) {
        boolean result;
        synchronized (getLock()) {
            result = isHandshook();
            _state = timeout ? State.EXPIRED : State.DISCONNECTED;
        }
        if (result) {
            for (ServerChannelImpl channel : subscriptions) {
                channel.unsubscribe(this);
            }
            for (ServerSessionListener listener : _listeners) {
                if (listener instanceof RemovedListener) {
                    notifyRemoved((RemovedListener)listener, this, message, timeout);
                }
            }
        }
        return result;
    }
protected boolean removed ( ServerMessage message , boolean timeout ) { boolean result ; synchronized ( getLock ( ) ) { result = isHandshook ( ) ; _state = timeout ? State . EXPIRED : State . DISCONNECTED ; } if ( result ) { for ( ServerChannelImpl channel : subscriptions ) { channel . unsubscribe ( this ) ; } for ( ServerSessionListener listener : _listeners ) { if ( listener instanceof RemovedListener ) { notifyRemoved ( ( RemovedListener ) listener , this , message , timeout ) ; } } } return result ; }
@param message the message that caused the removal, or null
 @param timeout whether the session has been removed due a timeout
 @return True if the session was connected.
@param message the message that caused the removal or null @param timeout whether the session has been removed due a timeout @return True if the session was connected .