Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* JBoss, Home of Professional Open Source.
* Copyright 2011, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.server;
import java.lang.management.ManagementFactory;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import javax.management.ObjectName;
import org.jboss.as.controller.ControlledProcessState;
import org.jboss.as.controller.ControlledProcessStateService;
import org.jboss.modules.Module;
import org.jboss.modules.ModuleIdentifier;
import org.jboss.modules.ModuleLoadException;
import org.jboss.modules.ModuleLoader;
import org.jboss.msc.service.AbstractServiceListener;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.ServiceActivator;
import org.jboss.msc.service.ServiceContainer;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceTarget;
import org.jboss.threads.AsyncFuture;
import org.jboss.threads.AsyncFutureTask;
import org.jboss.threads.JBossExecutors;
import org.wildfly.security.manager.WildFlySecurityManager;
/**
* The bootstrap implementation.
*
* @author David M. Lloyd
*/
final class BootstrapImpl implements Bootstrap {
private static final int MAX_THREADS = ServerEnvironment.getBootstrapMaxThreads();
private final ShutdownHook shutdownHook;
private final ServiceContainer container;
public BootstrapImpl() {
this.shutdownHook = new ShutdownHook();
this.container = shutdownHook.register();
}
@Override
public AsyncFuture bootstrap(final Configuration configuration, final List extraServices) {
try {
final Object value = ManagementFactory.getPlatformMBeanServer().getAttribute(new ObjectName("java.lang", "type", "OperatingSystem"), "MaxFileDescriptorCount");
final long fdCount = Long.valueOf(value.toString()).longValue();
if (fdCount < 4096L) {
ServerLogger.FD_LIMIT_LOGGER.fdTooLow(fdCount);
}
} catch (Throwable ignored) {}
assert configuration != null : "configuration is null";
// AS7-6381 set this property so we can get it out of the launch scripts
String resolverWarning = WildFlySecurityManager.getPropertyPrivileged("org.jboss.resolver.warning", null);
if (resolverWarning == null) {
WildFlySecurityManager.setPropertyPrivileged("org.jboss.resolver.warning", "true");
}
final ModuleLoader moduleLoader = configuration.getModuleLoader();
final Bootstrap.ConfigurationPersisterFactory configurationPersisterFactory = configuration.getConfigurationPersisterFactory();
assert configurationPersisterFactory != null : "configurationPersisterFactory is null";
try {
Module.registerURLStreamHandlerFactoryModule(moduleLoader.loadModule(ModuleIdentifier.create("org.jboss.vfs")));
} catch (ModuleLoadException e) {
throw ServerMessages.MESSAGES.vfsNotAvailable();
}
final FutureServiceContainer future = new FutureServiceContainer(container);
final ServiceTarget tracker = container.subTarget();
final ControlledProcessState processState = new ControlledProcessState(true);
shutdownHook.setControlledProcessState(processState);
ControlledProcessStateService.addService(tracker, processState);
final Service> applicationServerService = new ApplicationServerService(extraServices, configuration, processState);
tracker.addService(Services.JBOSS_AS, applicationServerService)
.install();
final ServiceController> rootService = container.getRequiredService(Services.JBOSS_AS);
rootService.addListener(new AbstractServiceListener