本文整理匯總了Java中org.jboss.as.version.ProductConfig.fromFilesystemSlot方法的典型用法代碼示例。如果您正苦於以下問題:Java ProductConfig.fromFilesystemSlot方法的具體用法?Java ProductConfig.fromFilesystemSlot怎麽用?Java ProductConfig.fromFilesystemSlot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jboss.as.version.ProductConfig
的用法示例。
在下文中一共展示了ProductConfig.fromFilesystemSlot方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ModelControllerService
import org.jboss.as.version.ProductConfig; //導入方法依賴的package包/類
ModelControllerService(final ControlledProcessState processState, final StringConfigurationPersister persister, final ServerDelegatingResourceDefinition rootResourceDefinition) {
super(ProcessType.EMBEDDED_SERVER, new RunningModeControl(RunningMode.ADMIN_ONLY), persister, processState, rootResourceDefinition, null, ExpressionResolver.TEST_RESOLVER,
AuditLogger.NO_OP_LOGGER, new DelegatingConfigurableAuthorizer(), new ManagementSecurityIdentitySupplier(), new CapabilityRegistry(true));
this.persister = persister;
this.processState = processState;
this.rootResourceDefinition = rootResourceDefinition;
Properties properties = new Properties();
properties.put("jboss.home.dir", System.getProperty("basedir", ".") + File.separatorChar + "target");
final String hostControllerName = "hostControllerName"; // Host Controller name may not be null when in a managed domain
environment = new ServerEnvironment(hostControllerName, properties, new HashMap<String, String>(), null, null,
ServerEnvironment.LaunchType.DOMAIN, null, ProductConfig.fromFilesystemSlot(Module.getBootModuleLoader(), ".", properties), false);
extensionRegistry =
new ExtensionRegistry(ProcessType.STANDALONE_SERVER, new RunningModeControl(RunningMode.NORMAL), null, null, null, RuntimeHostControllerInfoAccessor.SERVER);
capabilityRegistry = new CapabilityRegistry(processType.isServer());
}
示例2: createHostControllerEnvironment
import org.jboss.as.version.ProductConfig; //導入方法依賴的package包/類
private static HostControllerEnvironment createHostControllerEnvironment(String hostName) {
//Copied from core-model-test
try {
Map<String, String> props = new HashMap<String, String>();
File home = new File("target/wildfly");
delete(home);
home.mkdir();
props.put(HostControllerEnvironment.HOME_DIR, home.getAbsolutePath());
File domain = new File(home, "domain");
domain.mkdir();
props.put(HostControllerEnvironment.DOMAIN_BASE_DIR, domain.getAbsolutePath());
File configuration = new File(domain, "configuration");
configuration.mkdir();
props.put(HostControllerEnvironment.DOMAIN_CONFIG_DIR, configuration.getAbsolutePath());
props.put(HostControllerEnvironment.HOST_NAME, hostName);
boolean isRestart = false;
String modulePath = "";
InetAddress processControllerAddress = InetAddress.getLocalHost();
Integer processControllerPort = 9999;
InetAddress hostControllerAddress = InetAddress.getLocalHost();
Integer hostControllerPort = 1234;
String defaultJVM = null;
String domainConfig = null;
String initialDomainConfig = null;
String hostConfig = null;
String initialHostConfig = null;
RunningMode initialRunningMode = RunningMode.NORMAL;
boolean backupDomainFiles = false;
boolean useCachedDc = false;
ProductConfig productConfig = ProductConfig.fromFilesystemSlot(null, "", props);
return new HostControllerEnvironment(props, isRestart, modulePath, processControllerAddress, processControllerPort,
hostControllerAddress, hostControllerPort, defaultJVM, domainConfig, initialDomainConfig, hostConfig, initialHostConfig,
initialRunningMode, backupDomainFiles, useCachedDc, productConfig);
} catch (UnknownHostException e) {
// AutoGenerated
throw new RuntimeException(e);
}
}
示例3: run
import org.jboss.as.version.ProductConfig; //導入方法依賴的package包/類
@Override
public AsyncFuture<ServiceContainer> run(final List<ServiceActivator> runServices) {
final Bootstrap bootstrap = Bootstrap.Factory.newInstance();
final ProductConfig productConfig = ProductConfig.fromFilesystemSlot(Module.getBootModuleLoader(), home, properties);
// Create server environment on the server, so that the system properties are getting initialized on the right side
final ServerEnvironment providedEnvironment = new ServerEnvironment(hostControllerName, properties,
WildFlySecurityManager.getSystemEnvironmentPrivileged(), null, null, ServerEnvironment.LaunchType.DOMAIN,
RunningMode.NORMAL, productConfig, Module.getStartTime(), suspend);
DomainServerCommunicationServices.updateOperationID(initialOperationID);
// TODO perhaps have ConfigurationPersisterFactory as a Service
final List<ServiceActivator> services = new ArrayList<ServiceActivator>(startServices);
final ServerBootOperationsService service = new ServerBootOperationsService();
// ModelController.boot() will block on this future in order to get the boot updates.
final Future<ModelNode> bootOperations = service.getFutureResult();
final ServiceActivator activator = new ServiceActivator() {
@Override
public void activate(ServiceActivatorContext serviceActivatorContext) throws ServiceRegistryException {
final ServiceTarget target = serviceActivatorContext.getServiceTarget();
target.addService(ServiceName.JBOSS.append("server-boot-operations"), service)
.addDependency(Services.JBOSS_AS)
.addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, service.getServerController())
.addDependency(HostControllerConnectionService.SERVICE_NAME, HostControllerClient.class, service.getClientInjector())
.addDependency(Services.JBOSS_SERVER_EXECUTOR, Executor.class, service.getExecutorInjector())
.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
}
};
services.add(activator);
final Bootstrap.Configuration configuration = new Bootstrap.Configuration(providedEnvironment);
final ExtensionRegistry extensionRegistry = configuration.getExtensionRegistry();
final Bootstrap.ConfigurationPersisterFactory configurationPersisterFactory = new Bootstrap.ConfigurationPersisterFactory() {
@Override
public ExtensibleConfigurationPersister createConfigurationPersister(ServerEnvironment serverEnvironment, ExecutorService executorService) {
ExtensibleConfigurationPersister persister = new AbstractConfigurationPersister(new StandaloneXml(configuration.getModuleLoader(), executorService, extensionRegistry)) {
private final PersistenceResource pr = new PersistenceResource() {
@Override
public void commit() {
}
@Override
public void rollback() {
}
};
@Override
public PersistenceResource store(final ModelNode model, Set<PathAddress> affectedAddresses) throws ConfigurationPersistenceException {
return pr;
}
@Override
public List<ModelNode> load() throws ConfigurationPersistenceException {
try {
final ModelNode operations = bootOperations.get();
return operations.asList();
} catch (Exception e) {
throw new ConfigurationPersistenceException(e);
}
}
};
extensionRegistry.setWriterRegistry(persister);
return persister;
}
};
configuration.setConfigurationPersisterFactory(configurationPersisterFactory);
return bootstrap.bootstrap(configuration, services);
}
示例4: createHostControllerEnvironment
import org.jboss.as.version.ProductConfig; //導入方法依賴的package包/類
private HostControllerEnvironment createHostControllerEnvironment() {
try {
Map<String, String> props = new HashMap<String, String>();
File home = new File("target/jbossas");
delete(home);
home.mkdir();
int sleep = 10;
delay(sleep);
props.put(HostControllerEnvironment.HOME_DIR, home.getAbsolutePath());
File domain = new File(home, "domain");
domain.mkdir();
delay(sleep);
props.put(HostControllerEnvironment.DOMAIN_BASE_DIR, domain.getAbsolutePath());
File configuration = new File(domain, "configuration");
configuration.mkdir();
delay(sleep);
props.put(HostControllerEnvironment.DOMAIN_CONFIG_DIR, configuration.getAbsolutePath());
boolean isRestart = false;
String modulePath = "";
InetAddress processControllerAddress = InetAddress.getLocalHost();
Integer processControllerPort = 9999;
InetAddress hostControllerAddress = InetAddress.getLocalHost();
Integer hostControllerPort = 1234;
String defaultJVM = null;
String domainConfig = null;
String initialDomainConfig = null;
String hostConfig = null;
String initialHostConfig = null;
RunningMode initialRunningMode = runningModeControl.getRunningMode();
boolean backupDomainFiles = false;
boolean useCachedDc = false;
ProductConfig productConfig = ProductConfig.fromFilesystemSlot(null, "", props);
return new HostControllerEnvironment(props, isRestart, modulePath, processControllerAddress, processControllerPort,
hostControllerAddress, hostControllerPort, defaultJVM, domainConfig, initialDomainConfig, hostConfig, initialHostConfig,
initialRunningMode, backupDomainFiles, useCachedDc, productConfig);
} catch (UnknownHostException e) {
// AutoGenerated
throw new RuntimeException(e);
}
}
示例5: createLocalTool
import org.jboss.as.version.ProductConfig; //導入方法依賴的package包/類
/**
* Create an offline local patch tool.
*
* @param jbossHome the distribution root
* @param moduleRoots the module roots
* @param bundleRoots the bundle roots
* @return the patch tool
* @throws IOException
*/
public static PatchTool createLocalTool(final File jbossHome, final List<File> moduleRoots, final List<File> bundleRoots) throws IOException {
final File[] resolvedPath = resolveLayeredModulePath(moduleRoots); // Resolve the patched module root for the module loader
final ModuleLoader loader = new LocalModuleLoader(resolvedPath);
final ProductConfig config = ProductConfig.fromFilesystemSlot(loader, jbossHome.getAbsolutePath(), Collections.emptyMap());
final InstallationManager manager = InstallationManager.load(jbossHome, moduleRoots, bundleRoots, config);
return create(manager);
}