Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] loading XMLTooling config on the fly

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] loading XMLTooling config on the fly


Chronological Thread 
  • From: Brent Putman <>
  • To:
  • Subject: Re: [OpenSAML] loading XMLTooling config on the fly
  • Date: Thu, 08 May 2008 15:28:57 -0400

You could just extend DefaultBootstrap and add what you need. Or you can load additional config files at anytime using an XMLConfigurator, as you noted. This is essentially all that the DefaultBootstrap does:


Class clazz = Configuration.class;
XMLConfigurator configurator = new XMLConfigurator();

for (String config : providerConfigs) {
configurator.load(clazz.getResourceAsStream(config));
}


That shows loading via an InputStream from files located as resources on the classpath. XMLConfigurator also has methods of loading via a File and via a DOM Document.

All the XMLConfigurator does is call methods and change config state that is stored in the static Configuration class. Therefore, you can also add/remove providers and other config info programatically by just calling methods on that class directly, for example:

Configuration#registerObjectProvider(QName providerName, XMLObjectBuilder builder, Marshaller marshaller,
Unmarshaller unmarshaller, Element configuration)


HTH,
Brent


Asa Hardcastle wrote:
Hi all,

I am sure that this is simple, but I have not done it yet. I have a need to load xml-tooling config files (or simply config parameters) on the fly. When I launch my app, the standard supported tooling config files are loaded by creating an XMLConfigurator and loading. I need to add additional config after launch. Is there any easy way to do this programmatically? Can someone email me an example?

thanks,

asa


--
Asa Hardcastle, Technical Lead, openLiberty ID-WSF ClientLib
Tel: +1.413.429.1044 Skype: subsystem7




Archive powered by MHonArc 2.6.16.

Top of Page