use of de.fraunhofer.iosb.ilt.faaast.service.Service in project FAAAST-Service by FraunhoferIOSB.
the class Application method run.
@Override
public void run() {
try {
ConfigFactory configFactory = new ConfigFactory();
AASEnvironmentFactory environmentFactory = new AASEnvironmentFactory();
readConfigurationParametersOverEnvironmentVariables();
readFilePathsOverEnvironmentVariables();
List<Config> customConfigComponents = getCustomConfigComponents();
ServiceConfig config = configFactory.toServiceConfig(configFilePath, autoCompleteConfiguration, properties, customConfigComponents);
AssetAdministrationShellEnvironment environment = null;
if (useEmptyAASEnvironment) {
LOGGER.info("Using empty Asset Administration Shell Environment");
environment = environmentFactory.getEmptyAASEnvironment();
} else {
environment = environmentFactory.getAASEnvironment(aasEnvironmentFilePath);
LOGGER.info("Successfully parsed Asset Administration Shell Environment");
}
if (validateAASEnv) {
validate(environment);
}
service = new Service(config);
service.setAASEnvironment(environment);
service.start();
LOGGER.info("FAAAST Service is running!");
} catch (Exception ex) {
if (service != null) {
service.stop();
}
LOGGER.error(ex.getMessage());
LOGGER.error("Abort starting FAAAST Service");
}
}
use of de.fraunhofer.iosb.ilt.faaast.service.Service in project FAAAST-Service by FraunhoferIOSB.
the class IntegrationTestHttpEndpoint method init.
@Before
public void init() throws Exception {
environment = AASFull.createEnvironment();
ServiceConfig serviceConfig = new ServiceConfig.Builder().core(new CoreConfig.Builder().requestHandlerThreadPoolSize(2).build()).persistence(new PersistenceInMemoryConfig()).endpoints(List.of(new HttpEndpointConfig())).messageBus(new MessageBusInternalConfig()).build();
service = new Service(serviceConfig);
messageBus = service.getMessageBus();
service.setAASEnvironment(environment);
service.start();
}
Aggregations