The NucleusResolverUtil class contains a single static resolveName method, which attempts to resolve the specified Nucleus path. Since Spring is unaware of Nucleus component scope, NucleusResolverUtil first attempts to resolve the name in the current request of the current thread (which should succeed if the component is request- or session-scoped) and if that fails, it then attempts to resolve the name in the global Nucleus scope.

To make a Nucleus component available in Spring, you declare it in your Spring configuration XML file. For example, to resolve the current user profile as a Spring component:

<bean name="/Profile" class="atg.nucleus.spring.NucleusResolverUtil"
    factory-method="resolveName" singleton="false">
  <constructor-arg value="/atg/userprofiling/Profile"/>
</bean>

Note that Nucleus components that do not have global scope should be specified with the singleton attribute set to false. If singleton is set to true, Spring will cache the component, which can result in the wrong instance of a request- or session-scoped component being exposed.

 
loading table of contents...