Calling kernel methods

As a class

To register a bean as a class, you need to have an instance of a Tigase Kernel execute it’s registerBean() method passing your Bean1 class.

kernel.registerBean(Bean1.class).exec();

Note

To be able to use this method you will need to annotate Bean1 class with @Bean annotation and provide a bean name which will be used for registration of the bean.

As a factory

To do this you need to have an instance of a Tigase Kernel execute it’s registerBean() method passing your bean Bean5 class.

kernel.registerBean("bean5").asClass(Bean5.class).withFactory(Bean5Factory.class).exec();
As an instance

For this you need to have an instance of a Tigase Kernel execute it’s registerBean() method passing your bean Bean41 class instance.

Bean41 bean41 = new Bean41();
kernel.registerBean("bean4_1").asInstance(bean41).exec();

Warning

Beans registered as an instance will not inject dependencies. As well this bean instances will not be configured by provided bean configurators.