Class SpringRegistrator
java.lang.Object
services.moleculer.config.SpringRegistrator
- All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
public class SpringRegistrator
extends Object
implements org.springframework.context.ApplicationContextAware
Register Spring Components as Moleculer Services in ServiceBroker.
ServiceBroker must be a Spring Component also.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.slf4j.Loggerprotected String[]Java package(s) where the custom Spring/Moleculer Services are located. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetPackagesToScan(String... packagesToScan)
-
Field Details
-
packagesToScan
Java package(s) where the custom Spring/Moleculer Services are located. Do not use if you use Spring's "ComponentScan" feature. -
logger
protected final org.slf4j.Logger logger
-
-
Constructor Details
-
SpringRegistrator
public SpringRegistrator()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
getPackagesToScan
-
setPackagesToScan
-