feat: Add Spring Boot auto-configuration for lm-lib modules
- Introduced auto-configuration classes for profile, client, agent, and prompt modules. - Updated README to reflect new modular architecture and configuration properties. - Added selective enabling/disabling of modules via application properties. - Refactored existing services and strategies to remove unnecessary Spring annotations. - Enhanced test configurations to utilize auto-configuration. - Updated META-INF imports to include new auto-configuration classes.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package de.extio.lmlib.agent;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
import de.extio.lmlib.client.ClientAutoConfiguration;
|
||||
|
||||
@AutoConfiguration
|
||||
@AutoConfigureAfter(ClientAutoConfiguration.class)
|
||||
@ConditionalOnProperty(prefix = "lmlib.agent", name = "enabled", havingValue = "true", matchIfMissing = true)
|
||||
public class AgentAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
AgentExecutorService agentExecutorService() {
|
||||
return new AgentExecutorService();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,12 +15,10 @@ import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import de.extio.lmlib.client.Client;
|
||||
import de.extio.lmlib.client.ClientService;
|
||||
|
||||
@Service
|
||||
public class AgentExecutorService implements InitializingBean, DisposableBean {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AgentExecutorService.class);
|
||||
|
||||
Reference in New Issue
Block a user