On Thu, 20 Mar 2003 19:13, kim pepper wrote:
> I need to write some software that runs as a background process. It needs
> to keep a database connection pool and a socket connection open to a remote
> server. The idea is a java method is called by a perl script that accesses
> the database, iterates over the results, then creates a new thread to send
> some information to the remote server for each of the results.
>
> Is this something that can be hadled by Avalon?
yep.
> Can I call methods on a
> class that is loaded by Avalon? Is there a simple way to do this?
The simplest way is to use fortress. It is not released yet (but will be soon)
so you will have to grab it from CVS (avalon-excalibur/fortress). It has a
bunch of examples so you can use them as a starting point. But basically what
you can do is something like
final FortressConfig config = new FortressConfig();
config.setContextDirectory( "./" );
config.setWorkDirectory( "./" );
config.setContainerConfiguration("resource://com/biz/MyConfig.xconf" );
config.setLoggerManagerConfiguration("resource://com/biz/MyLogger.xlog" );
config.setRoleManagerConfiguration("resource://com/biz/MyRoles.roles" );
m_containerManager = new DefaultContainerManager( config.getContext() );
ContainerUtil.initialize(m_containerManager);
m_container = (DefaultContainer)m_containerManager.getContainer();
myComponent =
(MyComponent)m_container.getServiceManager().lookup( MyComponent.ROLE );
myComponent.doMagic();
Where MyComponent is the interface of the component you are using and the
config files are in jar in com.biz package.
Lookup examples for more info.
--
Cheers,
Peter Donald
The big mistake that men make is that when they turn thirteen or fourteen and
all of a sudden they've reached puberty, they believe that they like women.
Actually, you're just horny. It doesn't mean you like women any more at
twenty-one than you did at ten. --Jules Feiffer (cartoonist)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]