2 Replies Latest reply on Apr 1, 2005 3:55 PM by adrian.brock

    injecting the Kernel

    bill.burke

      As we discussed before, aspects like the SecurityAspect will need to be able to query the Kernel for dependencies it resolves through the bean class's annotations.

      It would be cool if the Kernel could be injected into a bean:

      <bean name="SecurityAspectFacotry">
       <property name="Kernel"><ref name="Kernel"></property>
      </bean>
      



        • 1. Re: injecting the Kernel

          You can already do this. The current names of the kernel objects in the registry
          can be found in (I named after the jmx patterns):

          org.jboss.kernel.plugins.bootstrap.basic.KernelConstants

          • 2. Re: injecting the Kernel

            In fact, it should do it automatically based on Monomorphism.

            i.e. Only one class in the registry implements
            org.jboss.kernel.Kernel
            so it would just be a case of doing:

            @Inject // Uses monomorphic injection - no need for the name
            public void setKernel(Kernel kernel)