2 Replies Latest reply on Jan 25, 2007 1:10 PM by Björn Voß

    Spring deployer + cluster

    Vinicius Carvalho Apprentice

      Hi there! I just checked the new Spring deployer. One simple question. Does the applicationcontext get registred under jndi? Would it mean that using a cluster jndi I would have a single bean shared through the cluster?

      Regards

        • 1. Re: Spring deployer + cluster
          Ales Justin Master

           

          Does the applicationcontext get registred under jndi?


          Yes.
          This is the code that does it (AbstractBeanFactoryLoader class):
          NonSerializableFactory is used, since we don't want to impound Serializability to all of our beans.

          // JNDI stuff
          
           public static void bind(BeanFactory beanFactory, String name) throws BeansException
           {
           InitialContext ctx = null;
           try
           {
           ctx = new InitialContext();
           NonSerializableFactory.rebind(ctx, name, beanFactory);
           }
           catch (NamingException e)
           {
           throw new FatalBeanException("Unable to bind BeanFactory into JNDI", e);
           }
           finally
           {
           if (ctx != null)
           {
           try
           {
           ctx.close();
           }
           catch (Throwable ignored)
           {
           }
           }
           }
           }
          


          Would it mean that using a cluster jndi I would have a single bean shared through the cluster


          Hmm ... never tried it. But you can probably try HAJndi.

          • 2. Re: Spring deployer + cluster
            Björn Voß Newbie

            Have you tryed it with HAJndi? And what are youre expiriences?