High fellow ranchers,
I don't have much experience in
thread programming and I am new to
JSF and
java so I have 3 strikes against me on this one i guess but here goes.
The site I am building has a
servlet context listener that instantiates a singleton app manager which instantiates and retains a reference to a singleton member manager. So the application startup essentially creates the hierarchy of manager objects and stores the app manager in an AppBean which is ApplicationScoped.
The role of the member manager is to grab member records from a database on initialization and build them into member objects. The member objects are hidden within the member manager and any call to the manager to obtain a member or member list gets a memberproxy objects returned.
So the user logs in through a login page backed by a MemberBean that is session scoped. The memberBean object has methods for login, logout, creation, and deletion.
My understanding, and correct me if I am wrong, is that the MemberBean and the AppBean will require explicit synchronization because they are session and application scoped, respectively.
I assume I will have to implement synchonization or locking at multiple levels.
Level 1 would be to insure the integrity of each member and memberproxy object.
Level 2 would be to insure the integrity of the member manager's lists (list of members and memberproxies).
Level 3 may not be required but it seems logical to implement synchronization at the bean level since that is where the work begins when processing a request.
Just looking for general
patterns or recommendations at this point. Thanks