We probably need to do the following: 1) Define a SPI for org.apache.tuscany.sca.contribution.ContributionClassLoaderProvider 2) Provide a default implementation based on the ContributionClassLoader we have today 3) Change ClassReferenceModelResolver to use UtilityExtensionPoint.getUtility(ContributionClassLoaderProvider.class) to create the classloader for a given contribution instead of hard-coding the ContributionClassLoader. The later can be a default if no ContributionClassLoaderProvider impl is found 4) If you provide your own impl of ContributionClassLoaderProvider, register it with META-INF/services/org.apache.tuscany.sca.contribution.ContributionClassLoaderProvider
Thanks, Raymond From: Rashmi Hunt Sent: Wednesday, January 07, 2009 1:45 PM To: [email protected] Subject: Re: ContributionClassLoader Thanks for looking into this. I am trying to get an understanding on the suggested solution. What it means is to have a new utility service ContributionClassLoaderProvider under modules/extensibility/src/main/resources/META-INF/services? How does this get associated with contribution classloader set in ClassReferenceModelResolver.ClassReferenceModelResolver() ? Also ContributionClassLoaderProvider will be a new class? Regards Rashmi On Wed, Jan 7, 2009 at 11:44 AM, Raymond Feng <[email protected]> wrote: Hi, It sounds reasonable to me that we should allow the Tuscany embedders to plug in their own Contribution classloading scheme. The classloader might be constructed based on the contribution graph with the import/export dependencies. I suggest that we add a new utility service such as ContributionClassLoaderProvider into our UtilityExtensionPoint. This way, it can be replaced with a customized ContributionClassLoaderProvider implementation. Thanks, Raymond From: Rashmi Hunt Sent: Wednesday, January 07, 2009 10:48 AM To: [email protected] Subject: ContributionClassLoader Hi Is there a way to change the classloader which loads contribution classes or resources in a contribution? Tuscany sets the contribution classloader in ClassReferenceModelResolver.ClassReferenceModelResolver() and is there anyway to use a different classloader? Regards Rashmi
