Class KernelImpl

java.lang.Object
com.github.fungal.impl.KernelImpl
All Implemented Interfaces:
Kernel, KernelImplMBean

public class KernelImpl extends Object implements Kernel, KernelImplMBean
The kernel implementation for Fungal
Author:
Jesper Pedersen
  • Constructor Details

    • KernelImpl

      public KernelImpl(KernelConfiguration kc)
      Constructor
      Parameters:
      kc - The kernel configuration
  • Method Details

    • getName

      public String getName()
      Get the name of the kernel
      Specified by:
      getName in interface Kernel
      Specified by:
      getName in interface KernelImplMBean
      Returns:
      The value
    • getVersion

      public String getVersion()
      Get the version of the kernel
      Specified by:
      getVersion in interface Kernel
      Specified by:
      getVersion in interface KernelImplMBean
      Returns:
      The value
    • getMBeanServer

      public MBeanServer getMBeanServer()
      Get the MBeanServer for the kernel
      Specified by:
      getMBeanServer in interface Kernel
      Returns:
      The MBeanServer instance
    • getDeployments

      public Collection<Deployment> getDeployments()
      Get the deployments
      Specified by:
      getDeployments in interface Kernel
      Returns:
      The deployment units; null if no units is found
    • getDeployments

      public List<Deployment> getDeployments(URL url)
      Get the deployment units for a deployment
      Specified by:
      getDeployments in interface Kernel
      Parameters:
      url - The unique URL for a deployment
      Returns:
      The deployment units; null if no units is found
    • startup

      public void startup() throws Throwable
      Startup
      Specified by:
      startup in interface Kernel
      Throws:
      Throwable - Thrown if an error occurs
    • shutdown

      public void shutdown() throws Throwable
      Shutdown
      Specified by:
      shutdown in interface Kernel
      Throws:
      Throwable - Thrown if an error occurs
    • getKernelClassLoader

      public KernelClassLoader getKernelClassLoader()
      Get the kernel class loader
      Specified by:
      getKernelClassLoader in interface Kernel
      Returns:
      The class loader
    • getExecutorService

      public ExecutorService getExecutorService()
      Get the executor service
      Returns:
      The executor service
    • getBean

      public <T> T getBean(String name, Class<T> expectedType) throws Throwable
      Get a bean
      Specified by:
      getBean in interface Kernel
      Parameters:
      name - The bean name
      expectedType - The expected type for the bean
      Returns:
      The bean instance
      Throws:
      Throwable - If an error occurs
    • install

      public BeanDeployment install(Bean... beans) throws Throwable
      Install beans
      Specified by:
      install in interface Kernel
      Parameters:
      beans - The beans
      Returns:
      The deployment that represents the beans
      Throws:
      Throwable - If an error occurs
    • uninstall

      public void uninstall(BeanDeployment beans) throws Throwable
      Uninstall beans
      Specified by:
      uninstall in interface Kernel
      Parameters:
      beans - The bean deployment
      Throws:
      Throwable - If an error occurs
    • getBean

      public Object getBean(String name)
      Get a bean
      Parameters:
      name - The name of the bean
      Returns:
      The bean
    • getMainDeployer

      public MainDeployer getMainDeployer()
      Get the main deployer
      Specified by:
      getMainDeployer in interface Kernel
      Returns:
      The main deployer
    • getHotDeployer

      public HotDeployer getHotDeployer()
      Get the hot deployer
      Returns:
      The hot deployer
    • dump

      public String dump()
      Dump the bean information
      Specified by:
      dump in interface KernelImplMBean
      Returns:
      The information
    • dump

      public String dump(String name)
      Dump the bean information
      Specified by:
      dump in interface KernelImplMBean
      Parameters:
      name - The bean name
      Returns:
      The information