Hi,
maybe i can help, i have some idea's how a pool can implemented.
here is may setup
interface Pool {
public Object take() throws PoolException;
public void release( Object token ) throws PoolException;
}
interface PoolContext{
public void setFactory( Factory factory ) throws FactoryException;
public void create( int objects ) throws FactoryException;
public void destroy( int objects ) throws FactoryException;
public void destory() throws FactoryException;
public Pool getPool();
}
interface Factory {
public Object create() throws FactoryException;
public void destroy( Object destroyme ) throws FactoryException;
// i do not difine an event mechanisme for 2 reasons
// 1)i want to be able to pool everthing if smal objects are pooled the
event
//costs more than the win off a pooled objects
// 2) the process of token and released objects are bound to the factory
that
//creates them e.g. creators of Factory knowns at best how there objects
// should be threated and invalidated ( pools may implement an event
// mechanism )
public void hasToken( Object o ) throws PoolElementException;
public void hasReleased( Object o ) throws PoolElementException;
}
Exception hierachie:
PoolException --> RuntimeException
PoolElementException --> PoolException
// when an pool element has an state problem
BrokenPoolElementException --> PoolElementException
// when some one want to release an object that doesn't come from this pool
InvalidPoolElementException --> PoolElementException
FactoryException --> Exception
// the FactoryException chain isn't stil ready
// a size factory exception when an max or an min size is reached
// when an illegal factory is set
my current implementations use an stack mechanisme
i'am working on an WeakPool but the problem is that i never known when an
object is cleaned up when the VM cleans an WeakReference ( I could use both
an WeakReference and a PhantomReference ) auw this hurts again Reference
Objects can't be reused so an double overhead
* I'am an Performance Freak, the reason is very clear i think *
So a very quick and hot greeting
----- Original Message -----
From: "Toby Allsopp" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 13, 2001 11:49 PM
Subject: Re: [JBoss-user] where can i find the minerva source
> On Sun, May 13, 2001 at 11:28:18PM +0200, Tbone wrote:
> > Hi,
> >
> > I have some pools of my own and i want to make them minerva( the jboss
pool
> > implementation ) compatible.
> >
> > where do I find the source of minerva package
> > i've traveled the jboss source tree.
>
> You can find the sources in the jbosscx module, under src/external.
However,
> I would advise holding off for a couple of days because we are forking
> Minerva and bringing it back under the JBoss umbrella. This will mean
that
> the package names will change. Stay tuned.
>
> Toby.
>
> > greetz tbone
>
> Word! :-)
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user