public void addPacketInterceptor ( PacketInterceptor packetInterceptor , PacketFilter packetFilter ) { if ( packetInterceptor == null ) { throw new NullPointerException ( "Packet interceptor is null." ) ; } interceptors . put ( packetInterceptor , new InterceptorWrapper ( packetInterceptor , packetFilter ) ) ; }
Registers a packet interceptor with this connection . The interceptor will be invoked every time a packet is about to be sent by this connection . Interceptors may modify the packet to be sent . A packet filter determines which packets will be delivered to the interceptor .