Hello guys this Pankaj Kumar Mishra , Right now I am working on a model asked by my Project Manager. This Model have following description with its problem and requirement.
1- Problem - There a is an client server application, in which Client is sending request to server and server responding it back to client.
The server is using
Tomcat Appache web Server and DBCP for connection pooling. It was not working well as The DBCP usually has lots of connection instance free but request are unprocessed!
2- Requirement Description of New System:
There should be a system which accept the coming HTTP requests ,parameters and type of activity required by request.
a). A front controller System receive requests and its parameter. Enqueue Them into a queue
b). there should be 10
thread having independent db connection - responsible for dequeue information from queue by checking them and process the request
b) Finally processed request send back to Front controller so, that information can be send to the client side.
3- Solution to the System: and My Architecture- 4- Classes as per Description
a)
Servlet as Front Controller --------------------------RequestReciever.java
b) A Queue class based on Fundamental DataStrutcture -------------------------RequestQueue.java ==with==RequestObject capsule to insert into Queue --RequestObject.java
c) A Sole class to Handle database connectivity , datafetch and update ---- ----------------------CoreConnector
c.i)A ChachedRow Class to hold records and even after connection ends --CRSHolder.java
d) Thread Class Which activate the Connectivity and Process the busyness Logic. -------------------------- ProcessRequestFromQueue.java
e) A ThreadPooler responsible for creating ThreadPool and handle the above Thread --------------------------TestThreadPoolExecutor
f) A listener to load database driver -------------------------- LoadWebResources.java
g) a Global class having all - public static object objects of ThreadPooler, ThreadClass, Queue and database connector Classes --------------------------globalx.java
The system is using [oracle [Client Driver] ,
This is system is working OK. But not good for what it is designed. As it is for concurrent and high load request handler. It is also making lots of request process unattained at user end.
Please give yours valuable suggestions and If it is wrong then what should be for else.