use of com.peterphi.std.guice.common.logging.rest.iface.ServiceManagerLoggingRestService in project stdlib by petergeneric.
the class LogForwardDaemonPreGuice method start.
private void start() {
final String instanceId = config.get(GuiceProperties.INSTANCE_ID);
// TODO fix this!
final String localEndpoint = config.get(GuiceProperties.LOCAL_REST_SERVICES_ENDPOINT, "http://unknown");
final boolean useMoxy = config.getBoolean(GuiceProperties.MOXY_ENABLED, true);
// Construct the necessary classes to create resteasy proxy clients.
// We must do this independent of the guice creation path because we'll be running as Guice is starting up
final JAXBContextResolver jaxb = new JAXBContextResolver(new JAXBSerialiserFactory(useMoxy));
this.clientFactory = new ResteasyClientFactoryImpl(null, null, null, jaxb);
ResteasyProxyClientFactoryImpl proxyFactory = new ResteasyProxyClientFactoryImpl(clientFactory, config);
// Instantiate the services
final ServiceManagerLoggingRestService logService = proxyFactory.getClient(ServiceManagerLoggingRestService.class);
final ServiceManagerRegistryRestService registryService = proxyFactory.getClient(ServiceManagerRegistryRestService.class);
this.daemon = new ServiceManagerLogForwardDaemon(instanceId, URI.create(localEndpoint), registryService, logService, this::guiceHasTakenOver);
// Start the thread running
this.daemon.startThread();
}
Aggregations