eXo Kernel :: MC Kernel Integration :: Demo 2.4.9-GA

org.exoplatform.kernel.demos.mc
Class InjectingBean

java.lang.Object
  extended by org.exoplatform.kernel.demos.mc.InjectingBean
All Implemented Interfaces:
org.picocontainer.Startable

public class InjectingBean
extends Object
implements org.picocontainer.Startable

This POJO demonstrates how to use annotations to perform injections of JBoss Microcontainer components into a service object configured and managed through exo-kernel. If we want our class to be instantiated at deploy time, it has to implement org.picocontainer.Startable, otherwise it will only be registered, but not instantiated. MC integration takes place at instantiation time, not at component registration time.

Author:
Marko Strukelj

Constructor Summary
InjectingBean()
          In this demo this bean is to be instantiated by exo-kernel.
 
Method Summary
 InjectedBean getBean()
          Getter method.
 Map getBindings()
          Getter method.
 org.jboss.kernel.spi.config.KernelConfigurator getConfigurator()
          Getter method.
 InjectedBean getInjectedBean()
          Getter method for field-injected bean.
 String getSomeStringProperty()
          Getter method.
 int getStartCount()
          Getter method.
 TransactionManager getTransactionManager()
          Getter method.
 void initialize(String param1, String param2, org.jboss.dependency.spi.Controller param3)
          Non-setter method annotated as injection method called with injected parameters
 boolean isInstallOk()
          Getter method.
 void setBean(InjectedBean bean)
          Setter method, annotated as injection point for type matching injection.
 void setBindings(Map<Class<?>,Object> bindings)
          Setter method, annotated as injection point with map injecting annotation.
 void setConfigurator(org.jboss.kernel.spi.config.KernelConfigurator configurator)
          Setter method, annotated as injection point for name matching injection.
 void setSomeStringProperty(String value)
          Setter method annotated as injection point for property getter injection.
 void setTransactionManager(TransactionManager tm)
          Setter method annotated as injection point for type matching injection
 void start()
          org.picocontainer.Startable lifecycle method.
 void stop()
          org.picocontainer.Startable lifecycle method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InjectingBean

public InjectingBean()
In this demo this bean is to be instantiated by exo-kernel. We can not use constructor based injection that mc kernel supports, since it's not mc kernel that does the instantiation.

Method Detail

getBean

public InjectedBean getBean()
Getter method.

Returns:
injected bean

setBean

public void setBean(InjectedBean bean)
Setter method, annotated as injection point for type matching injection.

Parameters:
bean -

getConfigurator

public org.jboss.kernel.spi.config.KernelConfigurator getConfigurator()
Getter method.

Returns:
injected component

setConfigurator

public void setConfigurator(org.jboss.kernel.spi.config.KernelConfigurator configurator)
Setter method, annotated as injection point for name matching injection.

Parameters:
configurator -

getBindings

public Map getBindings()
Getter method.

Returns:

setBindings

public void setBindings(Map<Class<?>,Object> bindings)
Setter method, annotated as injection point with map injecting annotation.

Parameters:
bindings -

getSomeStringProperty

public String getSomeStringProperty()
Getter method.

Returns:

setSomeStringProperty

public void setSomeStringProperty(String value)
Setter method annotated as injection point for property getter injection.

Parameters:
value -

start

public void start()
org.picocontainer.Startable lifecycle method. Supposed to be called exactly once.

Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
org.picocontainer.Startable lifecycle method.

Specified by:
stop in interface org.picocontainer.Startable

getInjectedBean

public InjectedBean getInjectedBean()
Getter method for field-injected bean.

Returns:
field-injected bean

getStartCount

public int getStartCount()
Getter method.

Returns:
start count

setTransactionManager

public void setTransactionManager(TransactionManager tm)
Setter method annotated as injection point for type matching injection

Parameters:
tm -

getTransactionManager

public TransactionManager getTransactionManager()
Getter method.

Returns:

initialize

public void initialize(String param1,
                       String param2,
                       org.jboss.dependency.spi.Controller param3)
Non-setter method annotated as injection method called with injected parameters

Parameters:
param1 -
param2 -
param3 -

isInstallOk

public boolean isInstallOk()
Getter method.

Returns:
true if install method was called successfully

eXo Kernel :: MC Kernel Integration :: Demo 2.4.9-GA

Copyright © 2014 eXo Platform SAS. All Rights Reserved.