Package org.jboss.kernel

Examples of org.jboss.kernel.Kernel


      assertEquals("Static Factory Value", bean.getConstructorUsed());
   }

   protected SimpleBean staticInstantiateFromFactoryWithParameters() throws Throwable
   {
      Kernel kernel = bootstrap();
      KernelConfigurator configurator = kernel.getConfigurator();
     
      AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName());
      AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
      bmd.setConstructor(cmd);
      cmd.setFactoryClass(SimpleBeanFactory.class.getName());
View Full Code Here


      assertEquals("7", bean.getConstructorUsed());
   }

   protected SimpleBean staticInstantiateFromFactoryWithIntegerParameter() throws Throwable
   {
      Kernel kernel = bootstrap();
      KernelConfigurator configurator = kernel.getConfigurator();
     
      AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName());
      AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
      bmd.setConstructor(cmd);
      cmd.setFactoryClass(SimpleBeanFactory.class.getName());
View Full Code Here

      // Shutdown the controller
      try
      {
         // Get a reference to the underlying kernel
         Kernel tempKernelReference = null;
         if (bootstrap != null)
         {
            tempKernelReference = bootstrap.getKernel();
         }

         // Null out the Bootstrap
         bootstrap = null;

         // If we had a kernel
         if (tempKernelReference != null)
         {
            // Shut it down
            KernelController controller = tempKernelReference.getController();
            controller.shutdown();
         }
      }
      catch (final Exception e)
      {
View Full Code Here

   @Override
   protected void doStart() throws Exception
   {
      // Register the server implementation
      final String mcServerBindName = "JBossServer";
      final Kernel kernel = this.getKernel();
      if (kernel == null)
      {
         throw new IllegalStateException("Server cannot be started without the presence of an underlying "
               + Kernel.class.getName());
      }
      final KernelController controller = kernel.getController();
      final BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(mcServerBindName, getClass().getName());
      builder.addMethodInstallCallback("addBootstrap");
      builder.addMethodUninstallCallback("removeBootstrap");
      builder.ignoreStart(); // We invoke start manually, don't let MC do it
      try
View Full Code Here

   protected void defaultWebConfig()
   {
      processWebMetaData(metaDataShared.get());

      ServletContext servletContext = context.getServletContext();
      Kernel kernel = kernelLocal.get();
      DeploymentUnit unit = deploymentUnitLocal.get();
      log.debug("Setting MC attributes, kernel: " + kernel + ", unit: " + unit);
      servletContext.setAttribute(KernelConstants.KERNEL_NAME, kernel);
      servletContext.setAttribute(DeploymentUnit.class.getName(), unit);
   }
View Full Code Here

    */
   public synchronized AbstractKernelController getRootController()
   {
      if (rootController == null)
      {
         Kernel kernel = ThreadLocalUtils.getKernel();
         if (kernel != null)
         {
            rootController = (AbstractKernelController) kernel.getController();
         }
         else
         {
            log.warn("GateIn - MC integration not available");
            return null;
View Full Code Here

   {
      if (beanName == null)
         throw new IllegalArgumentException("Null bean name.");

      KernelController controller = (KernelController)vistor.getControllerContext().getController();
      Kernel kernel = controller.getKernel();
      AbstractConstructorMetaData constructor = new AbstractConstructorMetaData();
      constructor.setFactoryClass(factoryClassName);
      constructor.setFactoryMethod("getProxy");
      List<ParameterMetaData> parameters = new ArrayList<ParameterMetaData>();
      parameters.add(new AbstractParameterMetaData(kernel));
View Full Code Here

    */
   @Deprecated
   protected final MainDeployer getMainDeployer()
   {
      // Get the MainDeployer
      final Kernel kernel = this.getKernel();
      final KernelController controller = kernel.getController();
      final ControllerContext context = controller.getContext(MC_NAME_MAIN_DEPLOYER, ControllerState.INSTALLED);
      if (context == null)
      {
         throw new IllegalStateException("Main deployer could not be found");
      }
View Full Code Here

      {
         log.trace("Handling server state change to: " + state);
      }

      // Get the Kernel
      final Kernel kernel = this.getBootstrap().getKernel();

      // Send a notification
      final KernelEventManager eventMgr = kernel.getEventManager();
      final long currentTime = System.currentTimeMillis();
      final String type = this.getNotificationType();
      final KernelEvent event = new AbstractEvent(eventMgr, type, 0, currentTime, new Long(currentTime));
      eventMgr.fireKernelEvent(event);
View Full Code Here

    */
   @Deprecated
   protected final MainDeployer getMainDeployer()
   {
      // Get the MainDeployer
      final Kernel kernel = this.getKernel();
      final KernelController controller = kernel.getController();
      final ControllerContext context = controller.getContext(MC_NAME_MAIN_DEPLOYER, ControllerState.INSTALLED);
      if (context == null)
      {
         throw new IllegalStateException("Main deployer could not be found");
      }
View Full Code Here

TOP

Related Classes of org.jboss.kernel.Kernel

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.