當前位置: 首頁>>代碼示例>>Java>>正文


Java ProductConfig類代碼示例

本文整理匯總了Java中org.jboss.as.version.ProductConfig的典型用法代碼示例。如果您正苦於以下問題:Java ProductConfig類的具體用法?Java ProductConfig怎麽用?Java ProductConfig使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ProductConfig類屬於org.jboss.as.version包,在下文中一共展示了ProductConfig類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createPatch

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
File createPatch(String patchID) throws Exception {
    final String fileContent = "Hello World!";
    File oneOffPatchDir = mkdir(tempDir, patchID);
    ContentModification miscFileAdded = ContentModificationUtils.addMisc(oneOffPatchDir, patchID,
            fileContent, "awesomeDirectory", "awesomeFile");
    ProductConfig productConfig = new ProductConfig(PRODUCT, AS_VERSION, "main");
    Patch oneOffPatch = PatchBuilder.create()
            .setPatchId(patchID)
            .setDescription("A one-off patch adding a misc file.")
            .oneOffPatchIdentity(productConfig.getProductName(), productConfig.getProductVersion())
            .getParent()
            .addContentModification(miscFileAdded)
            .build();
    createPatchXMLFile(oneOffPatchDir, oneOffPatch);
    return createZippedPatchFile(oneOffPatchDir, patchID);
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:17,代碼來源:PatchRemoteHostUnitTestCase.java

示例2: createCP

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
protected File createCP(File cpDir, String cpID, String elementCpID, String overridenElementId, final File miscDir,
        final File baseModuleDir, String moduleName,
        final ProductConfig productConfig) throws Exception {

    final File patchedModule = IoUtils.newFile(baseModuleDir, ".overlays", overridenElementId, moduleName);

    final ContentModification fileModified2 = ContentModificationUtils.modifyMisc(cpDir, cpID, "another file update", new File(miscDir, "test-file"), "miscDir", "test-file");
    final ContentModification moduleModified2 = ContentModificationUtils.modifyModule(cpDir, elementCpID, patchedModule, "another module update");

    final Patch cp = PatchBuilder.create()
            .setPatchId(cpID)
            .setDescription(descriptionFor(cpID))
            .setLink("http://test.two")
            .upgradeIdentity(productConfig.getProductName(), productConfig.getProductVersion(), productConfig.getProductVersion() + "_CP" + cpID)
            .getParent()
            .addContentModification(fileModified2)
            .upgradeElement(elementCpID, "base", false)
            .setDescription(descriptionFor(elementCpID))
            .addContentModification(moduleModified2)
            .getParent()
            .build();
    createPatchXMLFile(cpDir, cp);
    File zippedCP = PatchingTestUtil.createZippedPatchFile(cpDir, cpID);
    return zippedCP;
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:26,代碼來源:RemotePatchInfoUnitTestCase.java

示例3: createOneOff2

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
protected File createOneOff2(File patchDir, String patchId, String elementId, String overridenElementId, final File miscDir,
        final File baseModuleDir, String moduleName,
        final ProductConfig productConfig) throws Exception {

    final File patchedModule = IoUtils.newFile(baseModuleDir, ".overlays", overridenElementId, moduleName);
    final ContentModification fileModified = ContentModificationUtils.modifyMisc(patchDir, patchId, "another file update", new File(miscDir, "test-file"), "miscDir", "test-file");
    final ContentModification moduleModified = ContentModificationUtils.modifyModule(patchDir, elementId, patchedModule, "another module update");

    final Patch patch = PatchBuilder.create()
            .setPatchId(patchId)
            .setDescription(descriptionFor(patchId))
            .setLink("http://test.two")
            .oneOffPatchIdentity(productConfig.getProductName(), productConfig.getProductVersion())
            .getParent()
            .addContentModification(fileModified)
            .oneOffPatchElement(elementId, "base", false)
            .setDescription(descriptionFor(elementId))
            .addContentModification(moduleModified)
            .getParent()
            .build();
    createPatchXMLFile(patchDir, patch);
    return PatchingTestUtil.createZippedPatchFile(patchDir, patchId);
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:24,代碼來源:RemotePatchInfoUnitTestCase.java

示例4: createOneOff

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
protected File createOneOff(File oneOffDir, String oneOffId, String patchElementId, File moduleDir, ProductConfig productConfig) throws Exception {
    // patch misc file
    final ContentModification miscFileAdded = ContentModificationUtils.addMisc(oneOffDir, oneOffId, "Hello World!", "miscDir", "test-file");
    // patch module
    final ContentModification moduleModified = ContentModificationUtils.modifyModule(oneOffDir, patchElementId, moduleDir, "new resource in the module");

    final Patch oneOff = PatchBuilder.create()
            .setPatchId(oneOffId)
            .setDescription(descriptionFor(oneOffId))
            .setLink("http://test.one")
            .oneOffPatchIdentity(productConfig.getProductName(), productConfig.getProductVersion())
            .getParent()
            .addContentModification(miscFileAdded)
            .oneOffPatchElement(patchElementId, "base", false)
            .setDescription(descriptionFor(patchElementId))
            .addContentModification(moduleModified)
            .getParent()
            .build();
    createPatchXMLFile(oneOffDir, oneOff);
    return PatchingTestUtil.createZippedPatchFile(oneOffDir, oneOffId);
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:22,代碼來源:RemotePatchInfoUnitTestCase.java

示例5: createLocalHostHostInfo

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
/**
 * Create the metadata which gets send to the DC when registering.
 *
 *
 * @param hostInfo the local host info
 * @param productConfig the product config
 * @param ignoredResourceRegistry registry of ignored resources
 * @return the host info
 */
public static ModelNode createLocalHostHostInfo(final LocalHostControllerInfo hostInfo, final ProductConfig productConfig,
                                         final IgnoredDomainResourceRegistry ignoredResourceRegistry, final Resource hostModelResource) {
    final ModelNode info = new ModelNode();
    info.get(NAME).set(hostInfo.getLocalHostName());
    info.get(RELEASE_VERSION).set(Version.AS_VERSION);
    info.get(RELEASE_CODENAME).set(Version.AS_RELEASE_CODENAME);
    info.get(MANAGEMENT_MAJOR_VERSION).set(Version.MANAGEMENT_MAJOR_VERSION);
    info.get(MANAGEMENT_MINOR_VERSION).set(Version.MANAGEMENT_MINOR_VERSION);
    info.get(MANAGEMENT_MICRO_VERSION).set(Version.MANAGEMENT_MICRO_VERSION);
    final String productName = productConfig.getProductName();
    final String productVersion = productConfig.getProductVersion();
    if(productName != null) {
        info.get(PRODUCT_NAME).set(productName);
    }
    if(productVersion != null) {
        info.get(PRODUCT_VERSION).set(productVersion);
    }
    ModelNode ignoredModel = ignoredResourceRegistry.getIgnoredResourcesAsModel();
    if (ignoredModel.hasDefined(IGNORED_RESOURCE_TYPE)) {
        info.get(IGNORED_RESOURCES).set(ignoredModel.require(IGNORED_RESOURCE_TYPE));
    }
    boolean ignoreUnaffectedServerGroups = hostInfo.isRemoteDomainControllerIgnoreUnaffectedConfiguration();
    IgnoredNonAffectedServerGroupsUtil.addCurrentServerGroupsToHostInfoModel(ignoreUnaffectedServerGroups, hostModelResource, info);
    return info;
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:35,代碼來源:HostInfo.java

示例6: registerRootResource

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
public static void registerRootResource(Resource rootResource, ProductConfig cfg) {
    ModelNode model = rootResource.getModel();
    model.get(ModelDescriptionConstants.MANAGEMENT_MAJOR_VERSION).set(Version.MANAGEMENT_MAJOR_VERSION);
    model.get(ModelDescriptionConstants.MANAGEMENT_MINOR_VERSION).set(Version.MANAGEMENT_MINOR_VERSION);
    model.get(ModelDescriptionConstants.MANAGEMENT_MICRO_VERSION).set(Version.MANAGEMENT_MICRO_VERSION);

    model.get(ModelDescriptionConstants.RELEASE_VERSION).set(Version.AS_VERSION);
    model.get(ModelDescriptionConstants.RELEASE_CODENAME).set(Version.AS_RELEASE_CODENAME);

    if (cfg != null) {
        if (cfg.getProductVersion() != null) {
            model.get(ModelDescriptionConstants.PRODUCT_VERSION).set(cfg.getProductVersion());
        }
        if (cfg.getProductName() != null) {
            model.get(ModelDescriptionConstants.PRODUCT_NAME).set(cfg.getProductName());
        }
    }
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:19,代碼來源:VersionModelInitializer.java

示例7: 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());
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:19,代碼來源:InterfaceManagementUnitTestCase.java

示例8: createStandaloneServerEnvironment

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
private ServerEnvironment createStandaloneServerEnvironment() {
    Properties props = new Properties();
    File home = new File("target/jbossas");
    delete(home);
    home.mkdir();
    delay(10);
    props.put(ServerEnvironment.HOME_DIR, home.getAbsolutePath());

    File standalone = new File(home, "standalone");
    standalone.mkdir();
    props.put(ServerEnvironment.SERVER_BASE_DIR, standalone.getAbsolutePath());

    File configuration = new File(standalone, "configuration");
    configuration.mkdir();
    props.put(ServerEnvironment.SERVER_CONFIG_DIR, configuration.getAbsolutePath());

    File xml = new File(configuration, "standalone.xml");
    try {
        xml.createNewFile();
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
    props.put(ServerEnvironment.JBOSS_SERVER_DEFAULT_CONFIG, "standalone.xml");
    ProductConfig pc =  new ProductConfig("Test", Version.AS_VERSION, "main");
    return new ServerEnvironment(null, props, new HashMap<String, String>(), "standalone.xml", null, LaunchType.STANDALONE, runningModeControl.getRunningMode(), pc, false);
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:27,代碼來源:TestModelControllerService.java

示例9: createOneOffPatchAddingMiscFile

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
private File createOneOffPatchAddingMiscFile(String patchID, String asVersion) throws Exception {
    File oneOffPatchDir = mkdir(tempDir, patchID);
    ContentModification miscFileAdded = ContentModificationUtils.addMisc(oneOffPatchDir, patchID,
            "test content", "awesomeDirectory", "awesomeFile");
    ProductConfig productConfig = new ProductConfig(PRODUCT, asVersion, "main");
    Patch oneOffPatch = PatchBuilder.create()
            .setPatchId(patchID)
            .setDescription("A one-off patch adding a misc file.")
            .oneOffPatchIdentity(productConfig.getProductName(), productConfig.getProductVersion())
            .getParent()
            .addContentModification(miscFileAdded)
            .build();
    createPatchXMLFile(oneOffPatchDir, oneOffPatch);
    return createZippedPatchFile(oneOffPatchDir, patchID);
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:16,代碼來源:MergedPatchesTestCase.java

示例10: getPrettyProductName

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
public String getPrettyProductName() {

        final String result;
        if(productName != null) {
            result = ProductConfig.getPrettyVersionString(productName, productVersion, releaseVersion);
        } else {
            result = ProductConfig.getPrettyVersionString(null, releaseVersion, releaseCodeName);
        }
        return result;
    }
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:11,代碼來源:HostInfo.java

示例11: HostControllerEnvironment

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
/** Only for test cases */
public HostControllerEnvironment(Map<String, String> hostSystemProperties, boolean isRestart, String modulePath,
                                 InetAddress processControllerAddress, Integer processControllerPort, InetAddress hostControllerAddress,
                                 Integer hostControllerPort, String defaultJVM, String domainConfig, String initialDomainConfig, String hostConfig,
                                 String initialHostConfig, RunningMode initialRunningMode, boolean backupDomainFiles, boolean useCachedDc, ProductConfig productConfig) {
    this(hostSystemProperties, isRestart, modulePath, processControllerAddress, processControllerPort, hostControllerAddress, hostControllerPort, defaultJVM,
            domainConfig, initialDomainConfig, hostConfig, initialHostConfig, initialRunningMode, backupDomainFiles, useCachedDc, productConfig, false,
            System.currentTimeMillis(), ProcessType.HOST_CONTROLLER, ConfigurationFile.InteractionPolicy.STANDARD, ConfigurationFile.InteractionPolicy.STANDARD);
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:10,代碼來源:HostControllerEnvironment.java

示例12: testRemoteDomainControllerIgnoreUnaffectedConfiguration

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
@Test
public void testRemoteDomainControllerIgnoreUnaffectedConfiguration() {
    LocalHostControllerInfoImpl lch = new MockLocalHostControllerInfo(new ControlledProcessState(true), "test");
    ProductConfig productConfig = new ProductConfig("product", "version", "main");
    Resource hostResource = Resource.Factory.create();
    Resource server1 = Resource.Factory.create();
    server1.getModel().get(GROUP).set("server-group1");
    server1.getModel().get(SOCKET_BINDING_GROUP).set("socket-binding-group1");
    hostResource.registerChild(PathElement.pathElement(SERVER_CONFIG, "server-1"), server1);
    Resource server2 = Resource.Factory.create();
    server2.getModel().get(GROUP).set("server-group1");
    hostResource.registerChild(PathElement.pathElement(SERVER_CONFIG, "server-2"), server2);

    Resource domainResource = Resource.Factory.create();
    domainResource.registerChild(PathElement.pathElement(HOST, "test"), hostResource);
    Resource serverGroup1 = Resource.Factory.create();
    serverGroup1.getModel().get(PROFILE).set("profile1");
    serverGroup1.getModel().get(SOCKET_BINDING_GROUP).set("socket-binding-group1a");
    domainResource.registerChild(PathElement.pathElement(SERVER_GROUP, "server-group1"), serverGroup1);
    Resource serverGroup2 = Resource.Factory.create();
    serverGroup2.getModel().get(PROFILE).set("profile1");
    domainResource.registerChild(PathElement.pathElement(SERVER_GROUP, "server-group2"), serverGroup2);

    IgnoredDomainResourceRegistry ignoredRegistry = new IgnoredDomainResourceRegistry(lch);

    ModelNode model = HostInfo.createLocalHostHostInfo(lch, productConfig, ignoredRegistry, hostResource);

    Assert.assertTrue(model.get(IGNORE_UNUSED_CONFIG).asBoolean());
    Assert.assertEquals(2, model.get(INITIAL_SERVER_GROUPS).keys().size());
    Assert.assertEquals("server-group1", model.get(INITIAL_SERVER_GROUPS, "server-1", GROUP).asString());
    Assert.assertEquals("socket-binding-group1", model.get(INITIAL_SERVER_GROUPS, "server-1", SOCKET_BINDING_GROUP).asString());
    Assert.assertEquals("server-group1", model.get(INITIAL_SERVER_GROUPS, "server-2", GROUP).asString());
    Assert.assertFalse(model.get(INITIAL_SERVER_GROUPS, "server-2", SOCKET_BINDING_GROUP).isDefined());
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:35,代碼來源:HostInfoUnitTestCase.java

示例13: execute

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {

    final ModelNode syncOperation = new ModelNode();
    syncOperation.get(OP).set("calculate-diff-and-sync");
    syncOperation.get(OP_ADDR).setEmptyList();
    syncOperation.get(DOMAIN_MODEL).set(operation.get(DOMAIN_MODEL));

    Resource original = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS);

    final HostControllerRegistrationHandler.OperationExecutor internalExecutor = getControllerService().getInternalExecutor();

    Map<String, ProxyController> serverProxies = new HashMap<>();
    for (Map.Entry<String, MockServerProxy> entry : SyncModelServerStateTestCase.this.serverProxies.entrySet()) {
        serverProxies.put(entry.getKey(), entry.getValue());
    }
    SyncModelParameters parameters =
            new SyncModelParameters(new MockDomainController(), ignoredDomainResourceRegistry,
                    hostControllerEnvironment, extensionRegistry, internalExecutor, true,
                    serverProxies, repository, repository);
    final Resource hostResource =
            context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS).getChildren(HOST).iterator().next();
    final ProductConfig cfg = new ProductConfig("product", "version", "main");
    final HostInfo hostInfo =
            HostInfo.fromModelNode(
                    HostInfo.createLocalHostHostInfo(hostControllerInfo,
                            cfg,
                            ignoredDomainResourceRegistry,
                            hostResource));
    final SyncDomainModelOperationHandler handler =
            new SyncDomainModelOperationHandler(hostInfo, parameters);
    context.addStep(syncOperation, handler, OperationContext.Stage.MODEL, true);
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:34,代碼來源:SyncModelServerStateTestCase.java

示例14: handleHelpOrVersion

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
private static boolean handleHelpOrVersion(String arg, String jbossHome) {
    if (CommandLineConstants.HELP.equals(arg) || CommandLineConstants.SHORT_HELP.equals(arg)
        || CommandLineConstants.OLD_HELP.equals(arg)) {
        usage();
        return true;
    } else if (CommandLineConstants.VERSION.equals(arg) || CommandLineConstants.SHORT_VERSION.equals(arg)
            || CommandLineConstants.OLD_VERSION.equals(arg) || CommandLineConstants.OLD_SHORT_VERSION.equals(arg)) {
        System.out.println(ProductConfig.fromFilesystemSlot(Module.getBootModuleLoader(), jbossHome, null).getPrettyVersionString());
        return true;
    }
    return false;
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:13,代碼來源:Main.java

示例15: InstallationConfiguration

import org.jboss.as.version.ProductConfig; //導入依賴的package包/類
public InstallationConfiguration(ProcessEnvironment environment, ProductConfig config, ModelNode patchingInfo, Path installationDir) {
    assert environment != null;
    assert config != null;
    assert patchingInfo != null;
    assert installationDir != null;

    this.environment = environment;
    this.config = config;
    this.patchingInfo = patchingInfo;
    this.installationDir = installationDir;
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:12,代碼來源:AbstractInstallationReporter.java


注:本文中的org.jboss.as.version.ProductConfig類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。