Package org.jboss.kernel.spi.registry

Examples of org.jboss.kernel.spi.registry.KernelRegistry


   {
      public void installAction(KernelControllerContext context) throws Throwable
      {
         KernelController controller = (KernelController) context.getController();
         Kernel kernel = controller.getKernel();
         KernelRegistry registry = kernel.getRegistry();

         BeanMetaData metaData = context.getBeanMetaData();
         Object name = metaData.getName();
         registry.registerEntry(name, context);
         controller.addSupplies(context);
      }
View Full Code Here


     
      public void uninstallAction(KernelControllerContext context)
      {
         KernelController controller = (KernelController) context.getController();
         Kernel kernel = controller.getKernel();
         KernelRegistry registry = kernel.getRegistry();

         BeanMetaData metaData = context.getBeanMetaData();
         Object name = metaData.getName();
         try
         {
            controller.removeSupplies(context);
            registry.unregisterEntry(name);
         }
         catch (Throwable t)
         {
            log.warn("Ignoring unregistered entry at uninstall " + name);
         }
View Full Code Here

      ControllerContext context = super.getContext(name, state);
      if (context != null)
         return context;
      if (state == null || state == ControllerState.INSTALLED)
      {
         KernelRegistry registry = kernel.getRegistry();
         try
         {
            return registry.getEntry(name);
         }
         catch (Throwable ignored)
         {
         }
      }
View Full Code Here

  
   // KernelInitializer implementation ------------------------------
  
   public void initKernel(Kernel kernel) throws Throwable
   {
      KernelRegistry registry = createKernelRegistry(kernel);
      if (trace)
         log.trace("Using Registry: " + registry);
      registry.setKernel(kernel);
      kernel.setRegistry(registry);
     
      KernelEventManager eventManager = createKernelEventManager(kernel);
      if (trace)
         log.trace("Using EventManager: " + eventManager);
View Full Code Here

    * @param object the object
    */
   protected void register(Kernel kernel, Object name, Object object) throws Throwable
   {
      KernelRegistryEntry entry = createKernelRegistryEntry(kernel, object);
      KernelRegistry registry = kernel.getRegistry();
      registry.registerEntry(name, entry);
   }
View Full Code Here

      bootstrap.run();
      Kernel kernel = bootstrap.getKernel();
      getLog().debug("Got kernel: " + kernel);
      assertNotNull(kernel);
     
      KernelRegistry registry = kernel.getRegistry();
      assertNotNull(registry);

      check("Kernel", registry, kernel, KernelConstants.KERNEL_NAME, Kernel.class.getName());

      check("KernelRegistry", registry, registry, KernelConstants.KERNEL_REGISTRY_NAME, KernelConstants.KERNEL_REGISTRY_CLASS);
View Full Code Here

   }

   public void testSimpleFireEvent() throws Throwable
   {
      Kernel kernel = bootstrap();
      KernelRegistry registry = kernel.getRegistry();
      KernelEventManager eventManager = kernel.getEventManager();
      TestEmitter emitter = new TestEmitter();
      KernelRegistryEntry entry = makeEntry(emitter);
      registry.registerEntry("Emitter", entry);
      TestListener listener = new TestListener();
      eventManager.registerListener("Emitter", listener, null, null);
      emitter.testFire("testtype", null);
      ArrayList expected = new ArrayList();
      expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 0, null, null));
View Full Code Here

   }

   public void testDoubleFireEvent() throws Throwable
   {
      Kernel kernel = bootstrap();
      KernelRegistry registry = kernel.getRegistry();
      KernelEventManager eventManager = kernel.getEventManager();
      TestEmitter emitter = new TestEmitter();
      KernelRegistryEntry entry = makeEntry(emitter);
      registry.registerEntry("Emitter", entry);
      TestListener listener = new TestListener();
      eventManager.registerListener("Emitter", listener, null, null);
      emitter.testFire("testtype", null);
      emitter.testFire("testtype", null);
      ArrayList expected = new ArrayList();
View Full Code Here

   }

   public void testFilter() throws Throwable
   {
      Kernel kernel = bootstrap();
      KernelRegistry registry = kernel.getRegistry();
      KernelEventManager eventManager = kernel.getEventManager();
      TestEmitter emitter = new TestEmitter();
      KernelRegistryEntry entry = makeEntry(emitter);
      registry.registerEntry("Emitter", entry);
      TestListener listener = new TestListener();
      TestFilter filter = new TestFilter();
      eventManager.registerListener("Emitter", listener, filter, null);
      emitter.testFire("testtype", null);
      filter.fireEvent = false;
View Full Code Here

   }

   public void testHandback() throws Throwable
   {
      Kernel kernel = bootstrap();
      KernelRegistry registry = kernel.getRegistry();
      KernelEventManager eventManager = kernel.getEventManager();
      TestEmitter emitter = new TestEmitter();
      KernelRegistryEntry entry = makeEntry(emitter);
      registry.registerEntry("Emitter", entry);
      TestListener listener = new TestListener();
      TestFilter filter = new TestFilter();
      Object handback = new Object();
      eventManager.registerListener("Emitter", listener, filter, handback);
      emitter.testFire("testtype", null);
View Full Code Here

TOP

Related Classes of org.jboss.kernel.spi.registry.KernelRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.