Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [higgins-dev] Configuration APIs and Registry Initialization Behaviour Issues

Well yes.. It lies in the nature of the Configuration API to instantiate all components that you define in the configuration file. This doesn't have anything to do with IdASRegistry and context factories. So at a time when you ask the IdASRegistry for CNTXT1, all the context factories have already been instantiated. To change this behavior, I think modifications to the Configuration API itself would be necessary, so that htf:instance (and similar) settings get instantiated only when you need them.

I think that would be possible somehow, but I'm probably not the right person for that.

As far as the special case of IdASRegistry and context factories is concerned, there is an alternative way of listing and configuring context factories which uses XRDS files instead of the Configuration API. With that method context factories don't get instantiated at the start, but rather on demand in the way you describe it.

Have a look at this example: http://wiki.eclipse.org/Context_Discovery_Components#Example_3

This requires you to set up an XRDS file with all the context factories you ever want. The XRDS can be a local file or retrieved from a URL or by XRI resolution. And instead of instantiating all context factories right at the start, the IdASRegistry only picks the ones from the XRDS that are needed, using XRDS "service endpoint selection".

Markus

On Fri, Aug 8, 2008 at 6:08 AM, Prakash C Mallick <prakash.mallick@xxxxxxxxxx> wrote:

Hi All,
         Recently when I tried to use a contextconfiguration.xml file which describes definition of more than one contexts, but at a particular time I only use one of the context defined in the file, IdAS configuration APIs tries to create context factory instances for all the Contexts defined in the file. Is this a known behaviour ? If so I could see the possible usage issues on following scenarios when one contextconfiguration.xml is placed in shared location and used by but multiple IdAS API consumer applications in an organization.

1. Say Application1 tries to access a context using a specific context id CNTXT1 defined in the above contextconfiguration.xml registry database. Configuration API will try to create context factory instances of all contexts in addition to CNTXT1  defined in contextconfiguration.xml, which will consume lots of memory for all the context factory instances unintentionally if there are more than one context id definitions in  file.

2. If Application1 is accessing a context CNTXT1, it should only look up the context provider run time jar of CNTXT1, but the above behaviour will enforce the consumer application to have all context provider implementation run time jar in its environment to be in classpath or else application will fail.

Suggestion : if the above analysis is valid, I would prefer the ConfigurationAPIs should create the context factory instance thats requested by any application using context Id on demand.


Thanks and Regards,
Prakash
---------------------------------------------------------------------------------------------------
Advisory Software Engineer,
Tivoli Security Products
ETZ, Plot No. 3 , Rajiv Gandhi Infotech Park
Phase II, Hinjewadi, Pune - 411057
Ph: +91-20-42025544
e-mail: prakash.mallick@xxxxxxxxxx
---------------------------------------------------------------------------------------------------

_______________________________________________
higgins-dev mailing list
higgins-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/higgins-dev



Back to the top