ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darren Davison <dar...@davisononline.org>
Subject Re: listing cache models
Date Thu, 13 Dec 2007 14:02:14 GMT
Thanks Larry.

Since SqlMapClientImpl is currently the only internal class that
implements both of those interfaces, would there be an issue to move the
getDelegate() method into the SqlMapClient interface itself, or even
merging the two interfaces?

Of course, this would break anyone's code if they had previously
implemented their own version of that interface, but I imagine that's
not something that people would be doing as a general rule.  One for
ibatis 3.0 ?  :)

Cheers,

On Thu, Dec 13, 2007 at 06:17:09AM -0700, Larry Meadors wrote:
> Nope, that's the only way - other than reflection, which would have
> the same issue.
> 
> Once you get it working, it shouldn't be a problem unless you update
> iBATIS or Spring.
> 
> Larry
> 
> 
> On Dec 13, 2007 2:00 AM, Darren Davison <darren@davisononline.org> wrote:
> > hi,
> >
> > on our project we'd like to include an admin page that allows someone
> > to manually flush any particular cache that ibatis is using.
> >
> > It looks like we can get an iterator over the cache models by doing
> > something like this (untried yet!);
> >
> > ExtendedSqlMapClient ext = (ExtendedSqlMapClient) sqlMapClient;
> > SqlMapExecutorDelegate dlgt = ext.getDelegate();
> > Iterator iter = dlgt.getCacheModelNames();
> >
> > and then iterate to get (I assume) CacheModel objects that I can flush
> > as needed.
> >
> > But this looks a bit dodgy because of the initial cast.. I can't
> > guarantee that our SqlMapClient is also an ExtendedSqlMapClient as we're
> > using Spring support for ibatis and so we typically deal with the super
> > interface only [1]
> >
> > Is there another way?
> >
> > Cheers,
> >
> >
> >
> > [1]
> > http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/orm/ibatis/SqlMapClientTemplate.html#getSqlMapClient()
> > --
> > Darren Davison
> > Public Key: 0xE855B3EA
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.6 (GNU/Linux)
> >
> > iD8DBQFHYPSYVgOfSOhVs+oRAph8AJ4/WDrfH8yIBSkaB4XUDYx45NOo3QCgk6OV
> > Wb3JafqkugEIu44jk0ugNZY=
> > =UvgQ
> > -----END PGP SIGNATURE-----
> >
> >
> 

-- 
Darren Davison
Public Key: 0xE855B3EA

Mime
View raw message