One thing I can see with this that might be an issue
is that if you use the Spring ContextLoaderListener
the Spring context is going to be created before the
Tapestry servlet gets initialized and so the Hivemind
Registry would probably be null.

--- Geoff Longman <[EMAIL PROTECTED]> wrote:

> I think you can replace thier RegistryFactoryBean
> with the following
> and still use thier ServiceFactoryBeans. (whipped
> this up, it's
> untested)
> 
> 
> Geoff
> 
> /**
>  * [EMAIL PROTECTED] FactoryBean} implementation that locates
> the HiveMind [EMAIL PROTECTED]
> Registry} for a Tapestry
>  * servlet. <p/> This assumes that the Tapestry
> servlet has already been inited.
>  */
> public class TapestryRegistryLocatorBean implements
> FactoryBean,
> InitializingBean,
>         ApplicationContextAware
> {
> 
>     // org.apache.tapestry.ApplicationServlet
> defines this but only privately!
>     public static final String REGISTRY_KEY_PREFIX =
> "org.apache.tapestry.Registry:";
> 
>     private WebApplicationContext
> applicationContext;
> 
>     private String tapestryServletName;
> 
>     private Registry registry;
> 
>     public Object getObject() throws Exception
>     {
>         return this.registry;
>     }
> 
>     public Class getObjectType()
>     {
>         return Registry.class;
>     }
> 
>     public boolean isSingleton()
>     {
>         return true;
>     }
> 
>     public void
> setApplicationContext(ApplicationContext
> applicationContext) throws BeansException
>     {
>         if (!(applicationContext instanceof
> WebApplicationContext))
>             throw new FatalBeanException(
>                     "TapestryRegistryLocatorBean
> must be installed in
> a Spring WebApplicationContext!");
> 
>         this.applicationContext =
> (WebApplicationContext) applicationContext;
>     }
> 
>     public void afterPropertiesSet() throws
> Exception
>     {
>         ServletContext context =
> applicationContext.getServletContext();
> 
>         String registryKey = REGISTRY_KEY_PREFIX +
> this.tapestryServletName;
> 
>         registry = (Registry)
> context.getAttribute(registryKey);
> 
>     }
> 
>     public void setTapestryServletName(String
> tapestryServletName)
>     {
>         this.tapestryServletName =
> tapestryServletName;
>     }
> }
> 
> 
> 
> On 1/2/06, John Smith <[EMAIL PROTECTED]> wrote:
> > I am using acegi with spring for the web security
> of my site. However, the
> > login process needs to be able to query the
> database to get information
> > about the user account (something different than
> just validating username
> > and password). Then I need to set the username on
> the Visit object. I
> > already have acegi working, and I already have a
> DAO for user information
> > working in HveMind.
> >
> > Now I am trying to use the DAO from HivemMind in
> my acegi security beans. I
> > could just create a spring DAO and then just have
> two sets DAOs (one for
> > spring and one for hivemind), but I would like the
> spring beans to use the
> > HiveMind managed DAOs.
> >
> > I have looked into springmodules which provides
> access to HiveMind services
> > through spring, but it looks like it actually is
> just creating a new
> > Hivemind registry inside spring. It's not using
> the same instance of the
> > registry that Tapestry is using. This may be ok,
> but I am concerned about
> > thread saftey, and other concurrency problems to
> resources that HiveMind may
> > access, like the db.
> >
> > I am thinking about using the Login page as the
> bridge between the two. I
> > would inject a spring bean into the page, and a
> HiveMind service. Then
> > spring and HiveMind would be in the same place at
> the same time and I could
> > set a reference to HiveMind services on the spring
> bean.
> >
> > Anyone have any ideas on this? There is probably a
> better way.
> >
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> 
> 
> --
> The Spindle guy.           http://spindle.sf.net
> Get help with Spindle:   
>
http://lists.sourceforge.net/mailman/listinfo/spindle-user
> Announcement Feed:    
>
http://www.jroller.com/rss/glongman?catname=/Announcements
> Feature Updates:           
> http://spindle.sf.net/updates
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 



        
                
__________________________________ 
Yahoo! for Good - Make a difference this year. 
http://brand.yahoo.com/cybergivingweek2005/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to