@Produces @ApplicationScoped public EeRuntime getConfigurationUtil() { return EeRuntime.getInstance(); } }
private ServiceConfigInfo() { EeConfig eeConfig = EeConfig.getInstance(); this.environment = eeConfig.getEnv().getName(); if (this.environment == null || this.environment.isEmpty()) { this.environment = "dev"; } this.serviceName = eeConfig.getName(); if (this.serviceName == null || this.serviceName.isEmpty()) { this.serviceName = "UNKNOWN"; } this.serviceVersion = eeConfig.getVersion(); if (this.serviceVersion == null || this.serviceVersion.isEmpty()) { this.serviceVersion = "1.0.0"; } this.instanceId = EeRuntime.getInstance().getInstanceId(); this.addToTags = ConfigurationUtil.getInstance().getBoolean("kumuluzee.metrics.add-default-tags") .orElse(true); }
@Produces @ApplicationScoped public EeRuntime getConfigurationUtil() { return EeRuntime.getInstance(); } }
@Override public void init(KumuluzServerWrapper server, EeConfig eeConfig) { LOG.info("Initiating CXF"); // Check if CDI is present in the runtime Boolean cdiPresent = EeRuntime.getInstance().getEeComponents().stream().anyMatch(c -> c.getType().equals(EeComponentType.CDI)); LOG.fine("CXF component will run with" + (cdiPresent ? "" : "out") + " CDI"); final ServletServer kumuluzServer = (ServletServer) server.getServer(); final String baseUrl = server.getServer().getServerConfig().getBaseUrl(); final JaxWsAnnotationProcessorUtil wsInstance = JaxWsAnnotationProcessorUtil.getInstance(); wsInstance.setContextRoot(baseUrl); final Map<String, String> servletParams = new HashMap<>(); servletParams.put(KumuluzCXFServlet.CDI_INIT_PARAM, cdiPresent.toString()); String contextRoot = wsInstance.getContextRoot(); LOG.fine(KumuluzCXFServlet.class.getName() + " mapping set to " + contextRoot); kumuluzServer.registerServlet(KumuluzCXFServlet.class, contextRoot, servletParams); }
@Override public void init(KumuluzServerWrapper server, EeConfig eeConfig) { PersistenceUnitHolder holder = PersistenceUnitHolder.getInstance(); // Check if JTA is present in the runtime Boolean jtaPresent = EeRuntime.getInstance().getEeComponents().stream().anyMatch(c -> c.getType().equals(EeComponentType.JTA)); holder.setProviderProperties(new EclipseLinkSettings(jtaPresent)); }