Class DependencyInjectionPart
java.lang.Object
com.iohao.net.framework.core.DependencyInjectionPart
Singleton bridge for third-party dependency injection frameworks (e.g. Spring).
When injection is true, controller instances are obtained from
the external container via the configured ActionFactoryBean instead of
being instantiated directly by the framework.
- Author:
- 渔民小镇
- date:
- 2022-10-25
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe currently used ActionFactoryBeanClass<? extends Annotation> Container Management Tagbooleantrue means integration with a third-party framework -
Method Summary
Modifier and TypeMethodDescriptionbooleandeliveryContainer(Class<?> controllerClazz) Check whether the given controller class is managed by the external container.<T> TgetBean(ActionCommand actionCommand) Obtain a controller bean from the external container for the given action command.<T> TObtain a controller bean from the external container by class.static DependencyInjectionPartme()Return the singleton instance.
-
Field Details
-
injection
public boolean injectiontrue means integration with a third-party framework -
annotationClass
Container Management Tag -
actionFactoryBean
The currently used ActionFactoryBean
-
-
Method Details
-
deliveryContainer
Check whether the given controller class is managed by the external container.- Parameters:
controllerClazz- the controller class to check- Returns:
trueif the class carries the container annotation
-
getBean
Obtain a controller bean from the external container for the given action command.- Type Parameters:
T- the controller type- Parameters:
actionCommand- the action command whose controller is requested- Returns:
- the controller instance
-
getBean
Obtain a controller bean from the external container by class.- Type Parameters:
T- the controller type- Parameters:
actionControllerClazz- the controller class- Returns:
- the controller instance
-
me
Return the singleton instance.- Returns:
- the global
DependencyInjectionPart
-