Hi again,
Aadithya Deshpande wrote:
> Thanks for your response, Thomas.
>
> I was actually interested in creating a generic solution that didn't
> step on others toes.
>
> Is there a similar case where there is a second configuration file used
> to configure a sequence/logging/cache manager that I could use for
> reference?
>
No there is no such sample. But it is very easy to do.
Have a look at o.a.ojb.broker.util.configuration.impl
OjbConfiguration extend ConfigurationAbstractImpl that provides all
neccessary infrastructure for loading the properties file and to
retrieve config settings.
you have to provide your own Configuration class that extends
ConfigurationAbstractImpl. to load a special file you have to overwrite
load():
/**
* loads the configuration
*/
protected void load()
{
setFilename("myProps.properties");
super.load();
...
}
You also will have to implement your own Configurator. OjbConfigurator
code will show you how easy this is to do.
cheers,
Thomas
>
> -a
>
>
> -----Original Message-----
> From: Thomas Mahler [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 10, 2002 3:57 PM
> To: OJB Users List
> Subject: Re: FW: creating a sequencemanager with a configuration
>
>
> Hi Aadthya,
>
> Aadithya Deshpande wrote:
> > Using the org.apache.ojb.broker.util.sequence.SequenceManagerSapDBImpl
> > as a base, I'm attempting to create a sequencemanager that uses a
> > configuration to help it decide which sequence name to use. The premise
> > is to basically provide a mapping from a generated name ( using the same
> > spec as in the SapDB impl ) to a given name.
> >
> > i.e.
> >
> > SEQ_TB_USER_ID_USER = SEQ_USER_ID
> >
> > would be an entry in the configuration.
> >
> > What I was wondering was how the Configuration spec works. Is
> > everything read from the OJB.properties files, or is there a way to
> > specify a different file for the logging configuraiton and sequence
> > configuration.
>
> OJB provides a generic configuration package, that may be useful for
> many cases, not only OJB related ones.
> (o.a.ojb.broker.util.configuration)
> There is a concrete implementation in package
> o.a.ojb.broker.util.configuration.impl. This package contains the OJB
> specific implementation of the generic configuration framework.
> Our config framework loads all config data from the OJB.properties file.
>
> you can
> 1. place your extra config settings in OJB properties and use the
> OjbConfigurator to load them.
>
> 2. If you don't want to place your config data into OJB.properties you
> can provide your own own implementation to load config data from other
> sources.
>
> 3. You can just use a simple java.util.Properties based approach.
>
> Personally I would recommend 2. you avoid mixing OJB specific config
> data with your app specific stuff.
>
> cheers,
> Thomas
>
>
> >
> > Sorry if this seems like a very basic question; I've just downloaded
> > today and am diving in.
> >
> > Thanks in advance for any help,
> >
> > Aadi Deshpande
> > Director of Engineering
> > ClubMom, Inc.
> > 200 Madison Ave., 6th Floor
> > New York, NY 10016
> > tel 646.435.6562
> > fax 646.435.6600
> >
> >
> >
>
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>