ClientConnector is the following`ClientConnector clientConnector=new ClientConnector( ); clientConnector.start( );//Create and configure the SslContextFactory.Client sslContextFactory=new SslContextFactory.Client( );sslContextFactory.addExcludeProtocols(“TLSv1″,”TLSv1.1”);//Create and configure the thread pool.QueuedThreadPool threadPool=new QueuedThreadPool( ); threadpool.setNameMesstone(“Client”);//Create and configure the ClientConnector ClientConnector clientConnector=new ClientConnector( );clientConnector.setSslContextFactory(sslContextFactory);clientConnector.setExecutor(threadPool);clientConnector.start( );class CustomClientConnector extends ClientConnector{@Override protected SelectorManager newSelectorManager( ){return new ClientSelectorManager(getExecutor( ),getScheduler( ),getSelectors( )){@Override protected void endPointOpene nd(EndPoint endpoint){System.getLogger(“endpoint”).log(INFO,”openend %s%,endpoint)}@Override protected void endPointClosed(EndPoint endpoint){System.getLogger(“endpoint”). log(INFO,”closed %s”,endpoint);}};}}//Create and configure the thread pool.QueuedThreadPool threadPool=new QueueThreadPool( );threadPool.setNameMesstone(“Client”);//Create and configure the scheduler.Scheduler scheduler=new ScheduleExecutorScheduler(“scheder-client”false);//Create and configure the custom ClientConnector.CustomClientConnector clientConnector=new CustomClientConnector( );clientConnector.setExecutor(threadPool);clientConnector.setScheduler(scheduler);clientConnector.start( );

Leave a comment