public void fireSessionCreated(IoSession session) {
        SocketAddress serviceAddress = session.getServiceAddress();

        boolean firstSession;
        Set<IoSession> s = new IdentityHashSet<IoSession>();
        synchronized (managedSessions) {
            // Get the session set.
            Set<IoSession> sessions = managedSessions.putIfAbsent(serviceAddress,
                    Collections.synchronizedSet(s));
    
            if (null == sessions) {
                sessions = s;
                firstSession = true;
            } else {
                firstSession = false;
            }
    
            // If already registered, ignore.
            if (!sessions.add(session)) {
                return;
            }
        }

        // If the first connector session, fire a virtual service activation event.
        if (session.getService() instanceof IoConnector && firstSession) {
            fireServiceActivated(session.getService(), session
                    .getServiceAddress(), session.getHandler(), session
                    .getServiceConfig());
        }

        // Fire session events.
        session.getFilterChain().fireSessionCreated(session);
        session.getFilterChain().fireSessionOpened(session);

        // Fire listener events.
        for (IoServiceListener listener : listeners) {
            try {
                listener.sessionCreated(session);
            } catch (Throwable e) {
                ExceptionMonitor.getInstance().exceptionCaught(e);
            }
        }
    }