example.message.router/src/example/message/SocketListener.java
@Activate
    public void activate(final BundleContext context, final Map<String, Object> props)
    {
        m_Running = new AtomicBoolean(false);
        m_ResponseMap = new HashMap<>();
        m_Socket = (Socket)props.get(PROP_SOCKET);
        m_SendHandler = new UnreachableEventHandler();
        m_SendHandler.registerForEvents(context);
        
        final byte[] id = new byte[Long.BYTES];
        try
        {
            m_Socket.getInputStream().read(id, 0, Long.BYTES);
        }
        catch (final IOException ex)
        {
            m_Logger.error(ex, "Unable to read in system ID");
            return;
        }
        final ByteBuffer buffer = ByteBuffer.wrap(id);
        m_SystemId = buffer.getLong();
        
        m_Logger.debug("Received system ID from: %s", m_SystemId);
    }
/**
     * Socket listener activate method.
     * 
     * @param context
     *      Bundle context the socket listener is associated with.
     * @param props
     *      Map of properties to be passed to the socket listener upon startup.
     */
Socket listener activate method.

@param context
Bundle context the socket listener is associated with.
@param props
Map of properties to be passed to the socket listener upon startup.
Socket listener activate method . @param context Bundle context the socket listener is associated with . @param props Map of properties to be passed to the socket listener upon startup .
@Activate
    public void activate(final BundleContext context, final Map<String, Object> props)
    {
        m_Running = new AtomicBoolean(false);
        m_ResponseMap = new HashMap<>();
        m_Socket = (Socket)props.get(PROP_SOCKET);
        m_SendHandler = new UnreachableEventHandler();
        m_SendHandler.registerForEvents(context);
        final byte[] id = new byte[Long.BYTES];
        try
        {
            m_Socket.getInputStream().read(id, 0, Long.BYTES);
        }
        catch (final IOException ex)
        {
            m_Logger.error(ex, "Unable to read in system ID");
            return;
        }
        final ByteBuffer buffer = ByteBuffer.wrap(id);
        m_SystemId = buffer.getLong();
        m_Logger.debug("Received system ID from: %s", m_SystemId);
    }
@ Activate public void activate ( final BundleContext context , final Map < String , Object > props ) { m_Running = new AtomicBoolean ( false ) ; m_ResponseMap = new HashMap < > ( ) ; m_Socket = ( Socket ) props . get ( PROP_SOCKET ) ; m_SendHandler = new UnreachableEventHandler ( ) ; m_SendHandler . registerForEvents ( context ) ; final byte [ ] id = new byte [ Long . BYTES ] ; try { m_Socket . getInputStream ( ) . read ( id , 0 , Long . BYTES ) ; } catch ( final IOException ex ) { m_Logger . error ( ex , "Unable to read in system ID" ) ; return ; } final ByteBuffer buffer = ByteBuffer . wrap ( id ) ; m_SystemId = buffer . getLong ( ) ; m_Logger . debug ( "Received system ID from: %s" , m_SystemId ) ; }
Socket listener activate method.
Socket listener activate method .