Skip to main content

Posts

Showing posts with the label webservice connection pool

Create Thread Pool in JAVA is Easy now

By using ExecutorService we can create a pool of threads and run in parallel. This feature has introduced in JAVA5. see the below links. ExecutorService ThreadPoolExecutor here is an example: ExecutorService exec = Executors.newFixedThreadPool(10); for (int i=0;i exec.execute(new DoSomething(data)); } in this example we have created a pool of threads contains 10. Here new DoSomething(data) will be executed 10times parallel. this can be used, where we need to call Web services since we cannot create webservice connection pool.