Refine search
@Override void startValue(StartContext context) throws StartException { ManagedThreadFactoryImpl managedThreadFactory = managedThreadFactoryInjectedValue.getOptionalValue(); if(managedThreadFactory == null) { // if not injected create one using normal thread priority final String threadFactoryName = "EE-ManagedExecutorService-"+name; managedThreadFactory = new ElytronManagedThreadFactory(threadFactoryName, null, Thread.NORM_PRIORITY); } if(requestController.getOptionalValue() != null) { controlPoint = requestController.getValue().getControlPoint(name, "managed-executor-service"); } executorService = new ManagedExecutorServiceImpl(name, managedThreadFactory, hungTaskThreshold, longRunningTasks, corePoolSize, maxPoolSize, keepAliveTime, keepAliveTimeUnit, threadLifeTime, queueCapacity, contextService.getOptionalValue(), rejectPolicy, controlPoint); }
@Override void startValue(StartContext context) throws StartException { ManagedThreadFactoryImpl managedThreadFactory = managedThreadFactoryInjectedValue.getOptionalValue(); if(managedThreadFactory == null) { // if not injected create one using normal thread priority final String threadFactoryName = "EE-ManagedScheduledExecutorService-" + name; managedThreadFactory = new ElytronManagedThreadFactory(threadFactoryName, null, Thread.NORM_PRIORITY); } if(requestController.getOptionalValue() != null) { controlPoint = requestController.getValue().getControlPoint(name, "managed-scheduled-executor-service"); } executorService = new ManagedScheduledExecutorServiceImpl(name, managedThreadFactory, hungTaskThreshold, longRunningTasks, corePoolSize, keepAliveTime, keepAliveTimeUnit, threadLifeTime, contextService.getOptionalValue(), rejectPolicy, controlPoint); }
@Override public void start(StartContext startContext) throws StartException { HttpHandler handler = remoteHttpInvokerServiceInjectedValue.getValue(); if(httpAuthenticationFactoryInjectedValue.getOptionalValue() != null) { handler = secureAccess(handler, httpAuthenticationFactoryInjectedValue.getOptionalValue()); } else if(realmService.getOptionalValue() != null) { handler = secureAccess(handler, realmService.getOptionalValue().getHttpAuthenticationFactory()); } handler = setupRoutes(handler); host.getValue().registerHandler(path, handler); host.getValue().registerLocation(path); }
@Override public void start(StartContext context) throws StartException { RequestController rq = requestControllerInjectedValue.getOptionalValue(); if(rq != null) { controlPoint = rq.getControlPoint("", "org.wildfly.undertow.webhost." + server.getValue().getName() + "." + host.getValue().getName()); } }
@Override public void start(StartContext context) throws StartException { UndertowLogger.ROOT_LOGGER.tracef("starting handler: %s", httpHandler); if(requestControllerInjectedValue.getOptionalValue() != null) { controlPoint = requestControllerInjectedValue.getValue().getControlPoint("org.wildfly.extension.undertow.handlers", name); realHandler = new GlobalRequestControllerHandler(httpHandler, controlPoint, Collections.emptyList()); } else { realHandler = httpHandler; } }
protected void registerListener(ListenerService listener) { listeners.add(listener); if (!listener.isSecure()) { SocketBinding binding = listener.getBinding().getValue(); SocketBinding redirectBinding = listener.getRedirectSocket().getOptionalValue(); if (redirectBinding!=null) { securePortMappings.put(binding.getAbsolutePort(), redirectBinding.getAbsolutePort()); }else{ securePortMappings.put(binding.getAbsolutePort(), -1); } } }
if (((Credential) credential).isElytronEnabled()) { try { return new ElytronSubjectFactory(authenticationContext.getOptionalValue(), new java.net.URI(jndiName)); } catch (URISyntaxException e) { throw ConnectorLogger.ROOT_LOGGER.cannotDeploy(e); } else if (securityDomain == null || securityDomain.trim().equals("") || subjectFactory.getOptionalValue() == null) { return null; } else { return new PicketBoxSubjectFactory(subjectFactory.getValue()){ @Override public Subject createSubject(final String sd) {
@Override public void start(StartContext context) throws StartException { createConnectionDefinition(); ra.getValue().addConnectionDefinition(getValue()); if (ActivationSecurityUtil.isLegacySecurityRequired(ra.getValue())) { ra.getValue().setSubjectFactory(subjectFactory.getValue()); ra.getValue().setSecManager(secManager.getOptionalValue()); } SUBSYSTEM_RA_LOGGER.debugf("Starting ResourceAdapters Service"); }
@Override public synchronized void start(final StartContext context) throws StartException { BatchLogger.LOGGER.debugf("Creating batch environment; %s", classLoader); final BatchConfiguration batchConfiguration = batchConfigurationInjector.getValue(); // Find the job executor to use JobExecutor jobExecutor = jobExecutorInjector.getOptionalValue(); if (jobExecutor == null) { jobExecutor = batchConfiguration.getDefaultJobExecutor(); } // Find the job repository to use JobRepository jobRepository = jobRepositoryInjector.getOptionalValue(); if (jobRepository == null) { jobRepository = batchConfiguration.getDefaultJobRepository(); } this.batchEnvironment = new WildFlyBatchEnvironment(artifactFactoryInjector.getValue(), jobExecutor, ContextTransactionManager.getInstance(), jobRepository, jobXmlResolver); final RequestController requestController = requestControllerInjector.getOptionalValue(); if (requestController != null) { // Create the entry point controlPoint = requestController.getControlPoint(deploymentName, "batch-executor-service"); } else { controlPoint = null; } }
@Override void stopValue(StopContext context) { if (executorService != null) { executorService.shutdownNow(); if(managedThreadFactoryInjectedValue.getOptionalValue() == null) { // if not injected the thread factory was created on start, and now needs to stop executorService.getManagedThreadFactory().stop(); } this.executorService = null; } if(controlPoint != null) { requestController.getValue().removeControlPoint(controlPoint); } }
@Override void stopValue(StopContext context) { if (executorService != null) { executorService.shutdownNow(); if(managedThreadFactoryInjectedValue.getOptionalValue() == null) { // if not injected the thread factory was created on start, and now needs to stop executorService.getManagedThreadFactory().stop(); } this.executorService = null; } if(controlPoint != null) { requestController.getValue().removeControlPoint(controlPoint); } }
@Override public void start(StartContext context) throws StartException { final AssociationService associationService = associationServiceInjectedValue.getValue(); final Endpoint endpoint = endpointValue.getValue(); Executor executor = executorService.getOptionalValue(); if (executor != null) { associationService.setExecutor(executor); } RemoteEJBService remoteEJBService = RemoteEJBService.create( associationService.getAssociation(), remotingTransactionServiceInjectedValue.getValue() ); remoteEJBService.serverUp(); // Register an EJB channel open listener OpenListener channelOpenListener = remoteEJBService.getOpenListener(); try { registration = endpoint.registerService(EJB_CHANNEL_NAME, channelOpenListener, this.channelCreationOptions); } catch (ServiceRegistrationException e) { throw new StartException(e); } }
if (timerPersistence.getOptionalValue() == null) { try { transactionManager.begin(); persistedTimers = timerPersistence.getValue().loadActiveTimers(timedObjectId, this); transactionManager.commit(); } catch (Exception e){
final SocketBinding socketBinding = iiopSocketBindingInjector.getOptionalValue(); final SocketBinding sslSocketBinding = this.iiopSSLSocketBindingInjector.getOptionalValue(); InetSocketAddress address = this.iiopSocketBindingInjector.getValue().getSocketAddress(); properties.setProperty(ORBConstants.SERVER_HOST_PROPERTY, address.getAddress().getHostAddress()); properties.setProperty(ORBConstants.SERVER_PORT_PROPERTY, String.valueOf(address.getPort())); InetSocketAddress address = this.iiopSSLSocketBindingInjector.getValue().getSocketAddress(); properties.setProperty(ORBConstants.SERVER_HOST_PROPERTY, address.getAddress().getHostAddress()); properties.setProperty(Constants.ORB_SSL_PORT, String.valueOf(address.getPort()));
@Override public synchronized void stop(final StopContext stopContext) { IoUtils.safeClose(this.deploymentInfo.getResourceManager()); if (securityDomain != null && securityFunction.getOptionalValue() == null) { AuthenticationManager authManager = securityDomainContextValue.getValue().getAuthenticationManager(); if (authManager != null && authManager instanceof JBossCachedAuthenticationManager) { ((JBossCachedAuthenticationManager) authManager).releaseModuleEntries(module.getClassLoader()); } } this.deploymentInfo.setConfidentialPortManager(null); this.deploymentInfo = null; if (registration != null) { registration.cancel(); } }
configuratorServiceInjector.getValue().accept(builder); final EJBTransportProvider localTransport = localProviderInjector.getOptionalValue(); if (localTransport != null) { builder.addTransportProvider(localTransport); final RemotingProfileService profileService = profileServiceInjector.getOptionalValue(); if (profileService != null) for (RemotingProfileService.ConnectionSpec spec : profileService.getConnectionSpecs()) { final EJBClientConnection.Builder connBuilder = new EJBClientConnection.Builder(); connBuilder.setDestination(spec.getInjector().getValue().getDestinationUri()); if(appClientUri.getOptionalValue() != null) { final EJBClientConnection.Builder connBuilder = new EJBClientConnection.Builder(); connBuilder.setDestination(appClientUri.getOptionalValue()); builder.addClientConnection(connBuilder.build()); if(appClientEjbProperties.getOptionalValue() != null) { setupEjbClientProps(appClientEjbProperties.getOptionalValue()); LegacyPropertiesConfiguration.configure(builder);
@Override public void start(StartContext startContext) throws StartException { //todo: this is a bit of a hack, as the proxy handler may be wrapped by a request controller handler for graceful shutdown ProxyHandler proxyHandler = (ProxyHandler) (this.proxyHandler.getValue() instanceof GlobalRequestControllerHandler ? ((GlobalRequestControllerHandler)this.proxyHandler.getValue()).getNext() : this.proxyHandler.getValue()); final LoadBalancingProxyClient client = (LoadBalancingProxyClient) proxyHandler.getProxyClient(); try { SSLContext sslContext = this.sslContext.getOptionalValue(); if (sslContext == null) { SecurityRealm securityRealm = this.securityRealm.getOptionalValue(); if (securityRealm != null) { sslContext = securityRealm.getSSLContext(); } } if (sslContext == null) { client.addHost(getUri(), instanceId, null, OptionMap.create(UndertowOptions.ENABLE_HTTP2, enableHttp2)); } else { OptionMap.Builder builder = OptionMap.builder(); builder.set(Options.USE_DIRECT_BUFFERS, true); OptionMap combined = builder.getMap(); XnioSsl xnioSsl = new UndertowXnioSsl(Xnio.getInstance(), combined, sslContext); client.addHost(getUri(), instanceId, xnioSsl, OptionMap.create(UndertowOptions.ENABLE_HTTP2, enableHttp2)); } } catch (URISyntaxException e) { throw new StartException(e); } }
@Override public void start(final StartContext startContext) throws StartException { final Host host = hostInjector.getValue(); UndertowLogger.ROOT_LOGGER.debugf("Starting console redirect for %s", host.getName()); final HttpManagement httpManagement = httpManagementInjector.getOptionalValue(); if (httpManagement != null) { if (httpManagement.hasConsole()) { host.registerHandler(CONSOLE_PATH, new ConsoleRedirectHandler(httpManagement)); } else { host.registerHandler(CONSOLE_PATH, new RedirectHandler(NO_CONSOLE)); } } else { host.registerHandler(CONSOLE_PATH, new RedirectHandler(NO_CONSOLE)); } }
@Override public void stop(StopContext context) { if (IIOPLogger.ROOT_LOGGER.isDebugEnabled()) { IIOPLogger.ROOT_LOGGER.debugf("Stopping service %s", context.getController().getName().getCanonicalName()); } final SocketBinding socketBinding = iiopSocketBindingInjector.getOptionalValue(); final SocketBinding sslSocketBinding = iiopSSLSocketBindingInjector.getOptionalValue(); if (socketBinding != null) { socketBinding.getSocketBindings().getNamedRegistry().unregisterBinding(socketBinding.getName()); } if (sslSocketBinding != null) { sslSocketBinding.getSocketBindings().getNamedRegistry().unregisterBinding(sslSocketBinding.getName()); } // stop the ORB asynchronously. final ORBDestroyer destroyer = new ORBDestroyer(this.orb, context); try { executorInjector.getValue().execute(destroyer); } catch (RejectedExecutionException e) { destroyer.run(); } finally { context.asynchronous(); } }
doPrivileged((PrivilegedExceptionAction<Void>) () -> { final EJBClientContextService ejbClientContextService = ejbClientContextInjectedValue.getValue(); final EJBClientContext ejbClientContext = ejbClientContextService.getClientContext(); final AuthenticationContext ejbClientClustersAuthenticationContext = ejbClientContextService.getClustersAuthenticationContext(); EjbLogger.DEPLOYMENT_LOGGER.debugf("Registering EJB client context %s for classloader %s", ejbClientContext, classLoader); final ContextManager<AuthenticationContext> authenticationContextManager = AuthenticationContext.getContextManager(); final RemotingProfileService profileService = profileServiceInjectedValue.getOptionalValue(); if (profileService != null || ejbClientClustersAuthenticationContext != null) { Discovery.getContextManager().setClassLoaderDefault(classLoader, discoveryInjector.getValue()); return null; });