Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » NamespaceHandler
NamespaceHandler [message #766353] Thu, 15 December 2011 15:50 Go to next message
Frederic Boucher is currently offline Frederic BoucherFriend
Messages: 3
Registered: December 2011
Junior Member
Hello,

I got some troubles with the NamespaceHandler management in spring-dm and virgo. I explained my problem here: http ://www.eclipse.org/forums/index.php/t/265692/

When spring-dm refresh a spring bundle, it use a DelegateNamespaceHandlerResolver composed of:
- a "local NamespaceHandlerResolver" that use the ClassLoader of the bundle to find the spring.handlers file;
- a "OSGI service NamespaceHandlerResolver" that use an osgi service to find the NamespaceHandler;

In a first time, I thought that my issue come from the "OSGI service NamespaceHandlerResolver" (http ://www.eclipse.org/forums/index.php/t/265692/).

But I found this code in the class MetaInfResourceClassLoaderDelegateHook from the Virgo code source:
    private boolean isDelegatedResolverCall() {
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        return isSpringDmDelegatedResolverCall(stackTrace) || isBlueprintDelegatedResolverCall(stackTrace);
    }
    
    private boolean isSpringDmDelegatedResolverCall(StackTraceElement[] stackTrace) {
        return isDelegatedResolverCall(stackTrace, SPRINGDM_DELEGATED_NAMESPACE_HANDLER_RESOLVER_CLASS_NAME, SPRINGDM_DELEGATED_ENTITY_RESOLVER_CLASS_NAME);
    }
    
    private boolean isBlueprintDelegatedResolverCall(StackTraceElement[] stackTrace) {
        return isDelegatedResolverCall(stackTrace, BLUEPRINT_DELEGATED_NAMESPACE_HANDLER_RESOLVER_CLASS_NAME, BLUEPRINT_DELEGATED_ENTITY_RESOLVER_CLASS_NAME);
    }


It seems that this code is here to avoid to use the "local NamespaceHandlerResolver" when loading the bean definitions using Spring-Dm but I don't understand why ?

regards,
Frederic
Re: NamespaceHandler [message #766701 is a reply to message #766353] Fri, 16 December 2011 09:30 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
The purpose of MetaInfResourceClassLoaderDelegateHook is to propagate an attempt to get resource(s) from META-INF to the principle bundle's dependencies, but this is not done if the request is being driven through Spring DM's DelgatedNamespaceHandlerResolver as it would not be appropriate to get namespace handlers directly from a bundle's dependencies. This logic should not affect the behaviour of the local namespace handler resolver as that only depends on looking up resources in a bundle's own META-INF.
Previous Topic:faild to build org.eclipse.virgo.kernel.userregion
Next Topic:Deploy war file
Goto Forum:
  


Current Time: Sun Dec 21 08:38:12 GMT 2014

Powered by FUDForum. Page generated in 0.01638 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software