The kernel is the entry point into the kernel services. @author Adrian Brock @author Les A. Hazlewood @version $Revision: 1.6 $
334335336337338339340341342343344
{ // Bind an EJB3 Registrar Implementation if not already bound if (!Ejb3RegistrarLocator.isRegistrarBound()) { // Obtain the Kernel Kernel sanders = this.kernel; assert sanders != null : Kernel.class.getSimpleName() + " must be provided in order to bind " + Ejb3Registrar.class.getSimpleName(); // Create an EJB3 Registrar Ejb3Registrar registrar = new Ejb3McRegistrar(sanders);
220221222223224225226227228229230
{ processWebMetaData(sharedJBossWebMetaData); } 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); }
919293949596979899100101102
ClassLoader loader = Thread.currentThread().getContextClassLoader(); mbeanServer.registerMBean(new JmxCL(loader), new ObjectName("jboss:service=defaultClassLoader")); BasicBootstrap bootstrap = new BasicBootstrap(); bootstrap.run(); Kernel kernel = bootstrap.getKernel(); AbstractController controller = (AbstractController)kernel.getController(); serviceController.setMBeanServer(mbeanServer); serviceController.setKernel(kernel); MainDeployerImpl mainDeployer = new MainDeployerImpl();
110111112113114115116117118119120121
assertEquals(expected, result); } protected SimpleBean simpleMapFromStrings() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties);
152153154155156157158159160161162163
assertEquals(expected, result); } protected SimpleBean customMapExplicit() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties);
195196197198199200201202203204205206
assertEquals(expected, result); } protected SimpleBean customMapFromSignature() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties);
241242243244245246247248249250251252
assertEquals(expected, result); } protected SimpleBean customMapPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties);
284285286287288289290291292293294295
assertEquals(expected, result); } protected SimpleBean mapWithKeyTypeOverride() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties);
333334335336337338339340341342343344
assertEquals(expected, result); } protected SimpleBean mapWithValueTypeOverride() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties);
384385386387388389390391392393394395
checkThrowable(ClassCastException.class, exception); } protected SimpleBean mapNotAMap() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties);