@ ConditionalOnClass ( { Pcap . class , Inet4Address . class , Context . class } ) //@ConditionalOnBean({Pcap.Builder.class, Inet4Address.class}) @ Bean ( CONTEXT_BEAN_NAME ) public Context context ( @ Qualifier ( PCAP_BUILDER_BEAN_NAME ) Pcap . Builder builder , @ Qualifier ( NETMASK_BEAN_NAME ) Inet4Address netmask ) { switch ( properties . getPcapType ( ) ) { case DEAD : if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Opening pcap dead handler : {}" , builder ) ; } builder . pcapType ( Pcap . PcapType . DEAD ) ; break ; case OFFLINE : if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Opening pcap offline hadler : {}" , builder ) ; } builder . pcapType ( Pcap . PcapType . OFFLINE ) ; break ; default : if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Opening pcap live hadler : {}" , builder ) ; } builder . pcapType ( Pcap . PcapType . LIVE ) ; break ; } Application . run ( applicationName , applicationDisplayName , applicationVersion , builder ) ; Context context = Application . getApplicationContext ( ) ; if ( properties . getFilter ( ) != null ) { if ( context . pcapCompile ( properties . getFilter ( ) , properties . getBpfCompileMode ( ) , netmask . toInt ( ) ) == PcapCode . PCAP_OK ) { if ( context . pcapSetFilter ( ) != PcapCode . PCAP_OK ) { if ( LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( context . pcapGetErr ( ) ) ; } } else { LOGGER . debug ( "Filter \'{}\' has been applied." , this . properties . getFilter ( ) ) ; } } else { if ( LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( context . pcapGetErr ( ) ) ; } } } else { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "No filter has been applied." ) ; } } return context ; }
Jxnet application context .