protected AliasService getAliasService() { AliasService as = services.getService(GatewayServices.ALIAS_SERVICE); return as; }
private void initializeServices(boolean persisting) throws ServiceLifecycleException { GatewayConfig config = getGatewayConfig(); Map<String,String> options = new HashMap<>(); options.put(GatewayCommandLine.PERSIST_LONG, Boolean.toString(persisting)); if (master != null) { options.put("master", master); } services.init(config, options); }
private static void injectServices(Object contributor) { if (gatewayServices != null) { Statement stmt; for(String serviceName : gatewayServices.getServiceNames()) { try { // TODO: this is just a temporary injection solution // TODO: test for the existence of the setter before attempting it // TODO: avoid exception throwing when there is no setter stmt = new Statement(contributor, "set" + serviceName, new Object[]{gatewayServices.getService(serviceName)}); stmt.execute(); } catch (NoSuchMethodException e) { // TODO: eliminate the possibility of this being thrown up front } catch (Exception e) { // Maybe it makes sense to throw exception log.failedToInjectService( serviceName, e ); throw new DeploymentException("Failed to inject service.", e); } } } }
gatewayServices.finalizeContribution(context);
private static void injectServices(Object contributor) { if (gatewayServices != null) { Statement stmt = null; for(String serviceName : gatewayServices.getServiceNames()) { try { // TODO: this is just a temporary injection solution // TODO: test for the existence of the setter before attempting it // TODO: avoid exception throwing when there is no setter stmt = new Statement(contributor, "set" + serviceName, new Object[]{gatewayServices.getService(serviceName)}); stmt.execute(); } catch (NoSuchMethodException e) { // TODO: eliminate the possibility of this being thrown up front } catch (Exception e) { // Maybe it makes sense to throw exception log.failedToInjectService( serviceName, e ); throw new DeploymentException("Failed to inject service.", e); } } } }
gatewayServices.finalizeContribution(context);
protected TopologyService getTopologyService() { TopologyService ts = services.getService(GatewayServices.TOPOLOGY_SERVICE); return ts; }
private void initializeServices(boolean persisting) throws ServiceLifecycleException { GatewayConfig config = getGatewayConfig(); Map<String,String> options = new HashMap<>(); options.put(GatewayCommandLine.PERSIST_LONG, Boolean.toString(persisting)); if (master != null) { options.put("master", master); } services.init(config, options); }
protected RemoteConfigurationRegistryClientService getRemoteConfigRegistryClientService() { return services.getService(GatewayServices.REMOTE_REGISTRY_CLIENT_SERVICE); }
services.init(config, options); if (!cmd.hasOption(GatewayCommandLine.NOSTART_LONG)) { startGateway( config, services );
protected RemoteConfigurationRegistryClientService getRemoteConfigRegistryClientService() { return services.getService(GatewayServices.REMOTE_REGISTRY_CLIENT_SERVICE); }
services.init(config, options); if (!cmd.hasOption(GatewayCommandLine.NOSTART_LONG)) { startGateway( config, services );
protected KeystoreService getKeystoreService() { KeystoreService ks = services.getService(GatewayServices.KEYSTORE_SERVICE); return ks; }
protected KeystoreService getKeystoreService() { return services.getService(GatewayServices.KEYSTORE_SERVICE); }
protected AliasService getAliasService() { return services.getService(GatewayServices.ALIAS_SERVICE); }
protected TopologyService getTopologyService() { return services.getService(GatewayServices.TOPOLOGY_SERVICE); }
@Override public void init( FilterConfig filterConfig ) throws ServletException { ServletContext context = filterConfig.getServletContext(); if (context != null) { GatewayServices services = (GatewayServices) context.getAttribute(GatewayServices.GATEWAY_SERVICES_ATTRIBUTE); if (services != null) { authority = services.getService(GatewayServices.TOKEN_SERVICE); } } }
private AliasService getAliasService() { final GatewayServices services = (GatewayServices) request .getServletContext() .getAttribute(GatewayServices.GATEWAY_SERVICES_ATTRIBUTE); return services.getService(GatewayServices.ALIAS_SERVICE); }
@Override public void init( FilterConfig filterConfig ) throws ServletException { GatewayServices services = (GatewayServices) filterConfig.getServletContext().getAttribute(GatewayServices.GATEWAY_SERVICES_ATTRIBUTE); authority = services.getService(GatewayServices.TOKEN_SERVICE); }
@Override public void init( FilterConfig filterConfig ) throws ServletException { super.init(filterConfig); String validityStr = filterConfig.getInitParameter("validity"); if (validityStr == null) { validityStr = "3600"; // 1 hr. in secs } // validity = Long.parseLong(validityStr); GatewayServices services = (GatewayServices) filterConfig.getServletContext().getAttribute(GatewayServices.GATEWAY_SERVICES_ATTRIBUTE); authority = services.getService(GatewayServices.TOKEN_SERVICE); sr = services.getService(GatewayServices.SERVICE_REGISTRY_SERVICE); }