I have added support for the PooledLifestyleHandler and the
ThreadLocalLifestyleHandler so you can see how easy it is to use, with
a central CommandManager/ThreadManager/PoolManager. I got them working,
however if you want to adjust how to configure it as opposed to just
using
the hardcoded values, I will leave that excersize to you. I still am
not
sure how it all works together, and I don't have a working license for
Together ControlCenter anymore so I can't create a Sequence Diagram for
initialization.
It is important to note that BOTH CommandManager and PoolManager are
passive, in that they react to events. The ThreadManager is what
provides
the necessary support to the CommandManager to move events through the
EventPipelines. The CommandManager runs the different commands or sends
signals to SignalHandlers so that we can run management tasks in the
background. The PoolManager has a recurring Command that cycles through
the different pools, and adjusts their size. I have been meaning to
add some real intelligence to the logic, storing working values so that
we can preallocate or deallocate pool entries based on historical data
for the pool.
Anyway, you have the support available, and I might move the SystemUtil
into event project to remove one more dependency from the system.
Although, I want to intelligently use the Thread project (thread pool)
as it is written, but use my MPool based thread pool. Any ideas on how
to do that *without* requiring the Pool project would be appreciated.
Oh, and a note about why I use ComponentFactory and Handlers in
Fortress:
Most pools have an ObjectFactory so that you can easily plug in the
factory and repurpose the pool for whatever the type of object we need.
It was easier for me to use that ObjectFactory from the pool to build
all
my components since the logic is the same. I told the pool to use the
ObjectFactory, but in the other lifestyle handlers, I simply used the
existing ObjectFactory. It was just easier. Granted, I *could* have
merged the two together in the AbstractLifestyleHandler so that all the
handlers used the same interface. As it is, in Merlin I had to wrap
the existing methods with the ObjectFactory methods.
Have Fun!
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>