id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
159,000
wildfly/wildfly-core
controller-client/src/main/java/org/jboss/as/controller/client/OperationBuilder.java
OperationBuilder.addInputStream
public OperationBuilder addInputStream(final InputStream in) { Assert.checkNotNullParam("in", in); if (inputStreams == null) { inputStreams = new ArrayList<InputStream>(); } inputStreams.add(in); return this; }
java
public OperationBuilder addInputStream(final InputStream in) { Assert.checkNotNullParam("in", in); if (inputStreams == null) { inputStreams = new ArrayList<InputStream>(); } inputStreams.add(in); return this; }
[ "public", "OperationBuilder", "addInputStream", "(", "final", "InputStream", "in", ")", "{", "Assert", ".", "checkNotNullParam", "(", "\"in\"", ",", "in", ")", ";", "if", "(", "inputStreams", "==", "null", ")", "{", "inputStreams", "=", "new", "ArrayList", "<", "InputStream", ">", "(", ")", ";", "}", "inputStreams", ".", "add", "(", "in", ")", ";", "return", "this", ";", "}" ]
Associate an input stream with the operation. Closing the input stream is the responsibility of the caller. @param in the input stream. Cannot be {@code null} @return a builder than can be used to continue building the operation
[ "Associate", "an", "input", "stream", "with", "the", "operation", ".", "Closing", "the", "input", "stream", "is", "the", "responsibility", "of", "the", "caller", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller-client/src/main/java/org/jboss/as/controller/client/OperationBuilder.java#L111-L118
159,001
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/installation/InstallationManagerImpl.java
InstallationManagerImpl.getInstalledIdentity
@Override public InstalledIdentity getInstalledIdentity(String productName, String productVersion) throws PatchingException { final String defaultIdentityName = defaultIdentity.getIdentity().getName(); if(productName == null) { productName = defaultIdentityName; } final File productConf = new File(installedImage.getInstallationMetadata(), productName + Constants.DOT_CONF); final String recordedProductVersion; if(!productConf.exists()) { recordedProductVersion = null; } else { final Properties props = loadProductConf(productConf); recordedProductVersion = props.getProperty(Constants.CURRENT_VERSION); } if(defaultIdentityName.equals(productName)) { if(recordedProductVersion != null && !recordedProductVersion.equals(defaultIdentity.getIdentity().getVersion())) { // this means the patching history indicates that the current version is different from the one specified in the server's version module, // which could happen in case: // - the last applied CP didn't include the new version module or // - the version module version included in the last CP didn't match the version specified in the CP's metadata, or // - the version module was updated from a one-off, or // - the patching history was edited somehow // In any case, here I decided to rely on the patching history. defaultIdentity = loadIdentity(productName, recordedProductVersion); } if(productVersion != null && !defaultIdentity.getIdentity().getVersion().equals(productVersion)) { throw new PatchingException(PatchLogger.ROOT_LOGGER.productVersionDidNotMatchInstalled( productName, productVersion, defaultIdentity.getIdentity().getVersion())); } return defaultIdentity; } if(recordedProductVersion != null && !Constants.UNKNOWN.equals(recordedProductVersion)) { if(productVersion != null) { if (!productVersion.equals(recordedProductVersion)) { throw new PatchingException(PatchLogger.ROOT_LOGGER.productVersionDidNotMatchInstalled(productName, productVersion, recordedProductVersion)); } } else { productVersion = recordedProductVersion; } } return loadIdentity(productName, productVersion); }
java
@Override public InstalledIdentity getInstalledIdentity(String productName, String productVersion) throws PatchingException { final String defaultIdentityName = defaultIdentity.getIdentity().getName(); if(productName == null) { productName = defaultIdentityName; } final File productConf = new File(installedImage.getInstallationMetadata(), productName + Constants.DOT_CONF); final String recordedProductVersion; if(!productConf.exists()) { recordedProductVersion = null; } else { final Properties props = loadProductConf(productConf); recordedProductVersion = props.getProperty(Constants.CURRENT_VERSION); } if(defaultIdentityName.equals(productName)) { if(recordedProductVersion != null && !recordedProductVersion.equals(defaultIdentity.getIdentity().getVersion())) { // this means the patching history indicates that the current version is different from the one specified in the server's version module, // which could happen in case: // - the last applied CP didn't include the new version module or // - the version module version included in the last CP didn't match the version specified in the CP's metadata, or // - the version module was updated from a one-off, or // - the patching history was edited somehow // In any case, here I decided to rely on the patching history. defaultIdentity = loadIdentity(productName, recordedProductVersion); } if(productVersion != null && !defaultIdentity.getIdentity().getVersion().equals(productVersion)) { throw new PatchingException(PatchLogger.ROOT_LOGGER.productVersionDidNotMatchInstalled( productName, productVersion, defaultIdentity.getIdentity().getVersion())); } return defaultIdentity; } if(recordedProductVersion != null && !Constants.UNKNOWN.equals(recordedProductVersion)) { if(productVersion != null) { if (!productVersion.equals(recordedProductVersion)) { throw new PatchingException(PatchLogger.ROOT_LOGGER.productVersionDidNotMatchInstalled(productName, productVersion, recordedProductVersion)); } } else { productVersion = recordedProductVersion; } } return loadIdentity(productName, productVersion); }
[ "@", "Override", "public", "InstalledIdentity", "getInstalledIdentity", "(", "String", "productName", ",", "String", "productVersion", ")", "throws", "PatchingException", "{", "final", "String", "defaultIdentityName", "=", "defaultIdentity", ".", "getIdentity", "(", ")", ".", "getName", "(", ")", ";", "if", "(", "productName", "==", "null", ")", "{", "productName", "=", "defaultIdentityName", ";", "}", "final", "File", "productConf", "=", "new", "File", "(", "installedImage", ".", "getInstallationMetadata", "(", ")", ",", "productName", "+", "Constants", ".", "DOT_CONF", ")", ";", "final", "String", "recordedProductVersion", ";", "if", "(", "!", "productConf", ".", "exists", "(", ")", ")", "{", "recordedProductVersion", "=", "null", ";", "}", "else", "{", "final", "Properties", "props", "=", "loadProductConf", "(", "productConf", ")", ";", "recordedProductVersion", "=", "props", ".", "getProperty", "(", "Constants", ".", "CURRENT_VERSION", ")", ";", "}", "if", "(", "defaultIdentityName", ".", "equals", "(", "productName", ")", ")", "{", "if", "(", "recordedProductVersion", "!=", "null", "&&", "!", "recordedProductVersion", ".", "equals", "(", "defaultIdentity", ".", "getIdentity", "(", ")", ".", "getVersion", "(", ")", ")", ")", "{", "// this means the patching history indicates that the current version is different from the one specified in the server's version module,", "// which could happen in case:", "// - the last applied CP didn't include the new version module or", "// - the version module version included in the last CP didn't match the version specified in the CP's metadata, or", "// - the version module was updated from a one-off, or", "// - the patching history was edited somehow", "// In any case, here I decided to rely on the patching history.", "defaultIdentity", "=", "loadIdentity", "(", "productName", ",", "recordedProductVersion", ")", ";", "}", "if", "(", "productVersion", "!=", "null", "&&", "!", "defaultIdentity", ".", "getIdentity", "(", ")", ".", "getVersion", "(", ")", ".", "equals", "(", "productVersion", ")", ")", "{", "throw", "new", "PatchingException", "(", "PatchLogger", ".", "ROOT_LOGGER", ".", "productVersionDidNotMatchInstalled", "(", "productName", ",", "productVersion", ",", "defaultIdentity", ".", "getIdentity", "(", ")", ".", "getVersion", "(", ")", ")", ")", ";", "}", "return", "defaultIdentity", ";", "}", "if", "(", "recordedProductVersion", "!=", "null", "&&", "!", "Constants", ".", "UNKNOWN", ".", "equals", "(", "recordedProductVersion", ")", ")", "{", "if", "(", "productVersion", "!=", "null", ")", "{", "if", "(", "!", "productVersion", ".", "equals", "(", "recordedProductVersion", ")", ")", "{", "throw", "new", "PatchingException", "(", "PatchLogger", ".", "ROOT_LOGGER", ".", "productVersionDidNotMatchInstalled", "(", "productName", ",", "productVersion", ",", "recordedProductVersion", ")", ")", ";", "}", "}", "else", "{", "productVersion", "=", "recordedProductVersion", ";", "}", "}", "return", "loadIdentity", "(", "productName", ",", "productVersion", ")", ";", "}" ]
This method returns the installed identity with the requested name and version. If the product name is null, the default identity will be returned. If the product name was recognized and the requested version was not null, the version comparison will take place. If the version of the currently installed product doesn't match the requested one, the exception will be thrown. If the requested version is null, the currently installed identity with the requested name will be returned. If the product name was not recognized among the registered ones, a new installed identity with the requested name will be created and returned. (This is because the patching system is not aware of how many and what the patching streams there are expected). @param productName @param productVersion @return @throws PatchingException
[ "This", "method", "returns", "the", "installed", "identity", "with", "the", "requested", "name", "and", "version", ".", "If", "the", "product", "name", "is", "null", "the", "default", "identity", "will", "be", "returned", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/installation/InstallationManagerImpl.java#L69-L114
159,002
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/installation/InstallationManagerImpl.java
InstallationManagerImpl.getInstalledIdentities
@Override public List<InstalledIdentity> getInstalledIdentities() throws PatchingException { List<InstalledIdentity> installedIdentities; final File metadataDir = installedImage.getInstallationMetadata(); if(!metadataDir.exists()) { installedIdentities = Collections.singletonList(defaultIdentity); } else { final String defaultConf = defaultIdentity.getIdentity().getName() + Constants.DOT_CONF; final File[] identityConfs = metadataDir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return pathname.isFile() && pathname.getName().endsWith(Constants.DOT_CONF) && !pathname.getName().equals(defaultConf); } }); if(identityConfs == null || identityConfs.length == 0) { installedIdentities = Collections.singletonList(defaultIdentity); } else { installedIdentities = new ArrayList<InstalledIdentity>(identityConfs.length + 1); installedIdentities.add(defaultIdentity); for(File conf : identityConfs) { final Properties props = loadProductConf(conf); String productName = conf.getName(); productName = productName.substring(0, productName.length() - Constants.DOT_CONF.length()); final String productVersion = props.getProperty(Constants.CURRENT_VERSION); InstalledIdentity identity; try { identity = LayersFactory.load(installedImage, new ProductConfig(productName, productVersion, null), moduleRoots, bundleRoots); } catch (IOException e) { throw new PatchingException(PatchLogger.ROOT_LOGGER.failedToLoadInfo(productName), e); } installedIdentities.add(identity); } } } return installedIdentities; }
java
@Override public List<InstalledIdentity> getInstalledIdentities() throws PatchingException { List<InstalledIdentity> installedIdentities; final File metadataDir = installedImage.getInstallationMetadata(); if(!metadataDir.exists()) { installedIdentities = Collections.singletonList(defaultIdentity); } else { final String defaultConf = defaultIdentity.getIdentity().getName() + Constants.DOT_CONF; final File[] identityConfs = metadataDir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return pathname.isFile() && pathname.getName().endsWith(Constants.DOT_CONF) && !pathname.getName().equals(defaultConf); } }); if(identityConfs == null || identityConfs.length == 0) { installedIdentities = Collections.singletonList(defaultIdentity); } else { installedIdentities = new ArrayList<InstalledIdentity>(identityConfs.length + 1); installedIdentities.add(defaultIdentity); for(File conf : identityConfs) { final Properties props = loadProductConf(conf); String productName = conf.getName(); productName = productName.substring(0, productName.length() - Constants.DOT_CONF.length()); final String productVersion = props.getProperty(Constants.CURRENT_VERSION); InstalledIdentity identity; try { identity = LayersFactory.load(installedImage, new ProductConfig(productName, productVersion, null), moduleRoots, bundleRoots); } catch (IOException e) { throw new PatchingException(PatchLogger.ROOT_LOGGER.failedToLoadInfo(productName), e); } installedIdentities.add(identity); } } } return installedIdentities; }
[ "@", "Override", "public", "List", "<", "InstalledIdentity", ">", "getInstalledIdentities", "(", ")", "throws", "PatchingException", "{", "List", "<", "InstalledIdentity", ">", "installedIdentities", ";", "final", "File", "metadataDir", "=", "installedImage", ".", "getInstallationMetadata", "(", ")", ";", "if", "(", "!", "metadataDir", ".", "exists", "(", ")", ")", "{", "installedIdentities", "=", "Collections", ".", "singletonList", "(", "defaultIdentity", ")", ";", "}", "else", "{", "final", "String", "defaultConf", "=", "defaultIdentity", ".", "getIdentity", "(", ")", ".", "getName", "(", ")", "+", "Constants", ".", "DOT_CONF", ";", "final", "File", "[", "]", "identityConfs", "=", "metadataDir", ".", "listFiles", "(", "new", "FileFilter", "(", ")", "{", "@", "Override", "public", "boolean", "accept", "(", "File", "pathname", ")", "{", "return", "pathname", ".", "isFile", "(", ")", "&&", "pathname", ".", "getName", "(", ")", ".", "endsWith", "(", "Constants", ".", "DOT_CONF", ")", "&&", "!", "pathname", ".", "getName", "(", ")", ".", "equals", "(", "defaultConf", ")", ";", "}", "}", ")", ";", "if", "(", "identityConfs", "==", "null", "||", "identityConfs", ".", "length", "==", "0", ")", "{", "installedIdentities", "=", "Collections", ".", "singletonList", "(", "defaultIdentity", ")", ";", "}", "else", "{", "installedIdentities", "=", "new", "ArrayList", "<", "InstalledIdentity", ">", "(", "identityConfs", ".", "length", "+", "1", ")", ";", "installedIdentities", ".", "add", "(", "defaultIdentity", ")", ";", "for", "(", "File", "conf", ":", "identityConfs", ")", "{", "final", "Properties", "props", "=", "loadProductConf", "(", "conf", ")", ";", "String", "productName", "=", "conf", ".", "getName", "(", ")", ";", "productName", "=", "productName", ".", "substring", "(", "0", ",", "productName", ".", "length", "(", ")", "-", "Constants", ".", "DOT_CONF", ".", "length", "(", ")", ")", ";", "final", "String", "productVersion", "=", "props", ".", "getProperty", "(", "Constants", ".", "CURRENT_VERSION", ")", ";", "InstalledIdentity", "identity", ";", "try", "{", "identity", "=", "LayersFactory", ".", "load", "(", "installedImage", ",", "new", "ProductConfig", "(", "productName", ",", "productVersion", ",", "null", ")", ",", "moduleRoots", ",", "bundleRoots", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "PatchingException", "(", "PatchLogger", ".", "ROOT_LOGGER", ".", "failedToLoadInfo", "(", "productName", ")", ",", "e", ")", ";", "}", "installedIdentities", ".", "add", "(", "identity", ")", ";", "}", "}", "}", "return", "installedIdentities", ";", "}" ]
This method will return a list of installed identities for which the corresponding .conf file exists under .installation directory. The list will also include the default identity even if the .conf file has not been created for it.
[ "This", "method", "will", "return", "a", "list", "of", "installed", "identities", "for", "which", "the", "corresponding", ".", "conf", "file", "exists", "under", ".", "installation", "directory", ".", "The", "list", "will", "also", "include", "the", "default", "identity", "even", "if", "the", ".", "conf", "file", "has", "not", "been", "created", "for", "it", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/installation/InstallationManagerImpl.java#L148-L188
159,003
wildfly/wildfly-core
launcher/src/main/java/org/wildfly/core/launcher/StandaloneCommandBuilder.java
StandaloneCommandBuilder.setDebug
public StandaloneCommandBuilder setDebug(final boolean suspend, final int port) { debugArg = String.format(DEBUG_FORMAT, (suspend ? "y" : "n"), port); return this; }
java
public StandaloneCommandBuilder setDebug(final boolean suspend, final int port) { debugArg = String.format(DEBUG_FORMAT, (suspend ? "y" : "n"), port); return this; }
[ "public", "StandaloneCommandBuilder", "setDebug", "(", "final", "boolean", "suspend", ",", "final", "int", "port", ")", "{", "debugArg", "=", "String", ".", "format", "(", "DEBUG_FORMAT", ",", "(", "suspend", "?", "\"y\"", ":", "\"n\"", ")", ",", "port", ")", ";", "return", "this", ";", "}" ]
Sets the debug JPDA remote socket debugging argument. @param suspend {@code true} to suspend otherwise {@code false} @param port the port to listen on @return the builder
[ "Sets", "the", "debug", "JPDA", "remote", "socket", "debugging", "argument", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/StandaloneCommandBuilder.java#L233-L236
159,004
wildfly/wildfly-core
launcher/src/main/java/org/wildfly/core/launcher/StandaloneCommandBuilder.java
StandaloneCommandBuilder.addSecurityProperty
public StandaloneCommandBuilder addSecurityProperty(final String key, final String value) { securityProperties.put(key, value); return this; }
java
public StandaloneCommandBuilder addSecurityProperty(final String key, final String value) { securityProperties.put(key, value); return this; }
[ "public", "StandaloneCommandBuilder", "addSecurityProperty", "(", "final", "String", "key", ",", "final", "String", "value", ")", "{", "securityProperties", ".", "put", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Adds a security property to be passed to the server. @param key the property key @param value the property value @return the builder
[ "Adds", "a", "security", "property", "to", "be", "passed", "to", "the", "server", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/StandaloneCommandBuilder.java#L390-L393
159,005
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java
AbstractAttributeDefinitionBuilder.addAccessConstraint
@SuppressWarnings("deprecation") public BUILDER addAccessConstraint(final AccessConstraintDefinition accessConstraint) { if (accessConstraints == null) { accessConstraints = new AccessConstraintDefinition[] {accessConstraint}; } else { accessConstraints = Arrays.copyOf(accessConstraints, accessConstraints.length + 1); accessConstraints[accessConstraints.length - 1] = accessConstraint; } return (BUILDER) this; }
java
@SuppressWarnings("deprecation") public BUILDER addAccessConstraint(final AccessConstraintDefinition accessConstraint) { if (accessConstraints == null) { accessConstraints = new AccessConstraintDefinition[] {accessConstraint}; } else { accessConstraints = Arrays.copyOf(accessConstraints, accessConstraints.length + 1); accessConstraints[accessConstraints.length - 1] = accessConstraint; } return (BUILDER) this; }
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "public", "BUILDER", "addAccessConstraint", "(", "final", "AccessConstraintDefinition", "accessConstraint", ")", "{", "if", "(", "accessConstraints", "==", "null", ")", "{", "accessConstraints", "=", "new", "AccessConstraintDefinition", "[", "]", "{", "accessConstraint", "}", ";", "}", "else", "{", "accessConstraints", "=", "Arrays", ".", "copyOf", "(", "accessConstraints", ",", "accessConstraints", ".", "length", "+", "1", ")", ";", "accessConstraints", "[", "accessConstraints", ".", "length", "-", "1", "]", "=", "accessConstraint", ";", "}", "return", "(", "BUILDER", ")", "this", ";", "}" ]
Adds an access constraint to the set used with the attribute @param accessConstraint the constraint @return a builder that can be used to continue building the attribute definition
[ "Adds", "an", "access", "constraint", "to", "the", "set", "used", "with", "the", "attribute" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java#L745-L754
159,006
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java
AbstractAttributeDefinitionBuilder.setAttributeGroup
public BUILDER setAttributeGroup(String attributeGroup) { assert attributeGroup == null || attributeGroup.length() > 0; //noinspection deprecation this.attributeGroup = attributeGroup; return (BUILDER) this; }
java
public BUILDER setAttributeGroup(String attributeGroup) { assert attributeGroup == null || attributeGroup.length() > 0; //noinspection deprecation this.attributeGroup = attributeGroup; return (BUILDER) this; }
[ "public", "BUILDER", "setAttributeGroup", "(", "String", "attributeGroup", ")", "{", "assert", "attributeGroup", "==", "null", "||", "attributeGroup", ".", "length", "(", ")", ">", "0", ";", "//noinspection deprecation", "this", ".", "attributeGroup", "=", "attributeGroup", ";", "return", "(", "BUILDER", ")", "this", ";", "}" ]
Sets the name of the attribute group with which this attribute is associated. @param attributeGroup the attribute group name. Cannot be an empty string but can be {@code null} if the attribute is not associated with a group. @return a builder that can be used to continue building the attribute definition
[ "Sets", "the", "name", "of", "the", "attribute", "group", "with", "which", "this", "attribute", "is", "associated", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java#L788-L793
159,007
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java
AbstractAttributeDefinitionBuilder.setAllowedValues
@SuppressWarnings("deprecation") public BUILDER setAllowedValues(String ... allowedValues) { assert allowedValues!= null; this.allowedValues = new ModelNode[allowedValues.length]; for (int i = 0; i < allowedValues.length; i++) { this.allowedValues[i] = new ModelNode(allowedValues[i]); } return (BUILDER) this; }
java
@SuppressWarnings("deprecation") public BUILDER setAllowedValues(String ... allowedValues) { assert allowedValues!= null; this.allowedValues = new ModelNode[allowedValues.length]; for (int i = 0; i < allowedValues.length; i++) { this.allowedValues[i] = new ModelNode(allowedValues[i]); } return (BUILDER) this; }
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "public", "BUILDER", "setAllowedValues", "(", "String", "...", "allowedValues", ")", "{", "assert", "allowedValues", "!=", "null", ";", "this", ".", "allowedValues", "=", "new", "ModelNode", "[", "allowedValues", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "allowedValues", ".", "length", ";", "i", "++", ")", "{", "this", ".", "allowedValues", "[", "i", "]", "=", "new", "ModelNode", "(", "allowedValues", "[", "i", "]", ")", ";", "}", "return", "(", "BUILDER", ")", "this", ";", "}" ]
Sets allowed values for attribute @param allowedValues values that are legal as part in this attribute @return a builder that can be used to continue building the attribute definition
[ "Sets", "allowed", "values", "for", "attribute" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java#L814-L822
159,008
wildfly/wildfly-core
logging/src/main/java/org/jboss/as/logging/LoggingProfileContextSelector.java
LoggingProfileContextSelector.getOrCreate
protected LogContext getOrCreate(final String loggingProfile) { LogContext result = profileContexts.get(loggingProfile); if (result == null) { result = LogContext.create(); final LogContext current = profileContexts.putIfAbsent(loggingProfile, result); if (current != null) { result = current; } } return result; }
java
protected LogContext getOrCreate(final String loggingProfile) { LogContext result = profileContexts.get(loggingProfile); if (result == null) { result = LogContext.create(); final LogContext current = profileContexts.putIfAbsent(loggingProfile, result); if (current != null) { result = current; } } return result; }
[ "protected", "LogContext", "getOrCreate", "(", "final", "String", "loggingProfile", ")", "{", "LogContext", "result", "=", "profileContexts", ".", "get", "(", "loggingProfile", ")", ";", "if", "(", "result", "==", "null", ")", "{", "result", "=", "LogContext", ".", "create", "(", ")", ";", "final", "LogContext", "current", "=", "profileContexts", ".", "putIfAbsent", "(", "loggingProfile", ",", "result", ")", ";", "if", "(", "current", "!=", "null", ")", "{", "result", "=", "current", ";", "}", "}", "return", "result", ";", "}" ]
Get or create the log context based on the logging profile. @param loggingProfile the logging profile to get or create the log context for @return the log context that was found or a new log context
[ "Get", "or", "create", "the", "log", "context", "based", "on", "the", "logging", "profile", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/logging/src/main/java/org/jboss/as/logging/LoggingProfileContextSelector.java#L53-L63
159,009
wildfly/wildfly-core
host-controller/src/main/java/org/jboss/as/host/controller/discovery/DomainControllerData.java
DomainControllerData.writeTo
public void writeTo(DataOutput outstream) throws Exception { S3Util.writeString(host, outstream); outstream.writeInt(port); S3Util.writeString(protocol, outstream); }
java
public void writeTo(DataOutput outstream) throws Exception { S3Util.writeString(host, outstream); outstream.writeInt(port); S3Util.writeString(protocol, outstream); }
[ "public", "void", "writeTo", "(", "DataOutput", "outstream", ")", "throws", "Exception", "{", "S3Util", ".", "writeString", "(", "host", ",", "outstream", ")", ";", "outstream", ".", "writeInt", "(", "port", ")", ";", "S3Util", ".", "writeString", "(", "protocol", ",", "outstream", ")", ";", "}" ]
Write the domain controller's data to an output stream. @param outstream the output stream @throws Exception
[ "Write", "the", "domain", "controller", "s", "data", "to", "an", "output", "stream", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/discovery/DomainControllerData.java#L87-L91
159,010
wildfly/wildfly-core
host-controller/src/main/java/org/jboss/as/host/controller/discovery/DomainControllerData.java
DomainControllerData.readFrom
public void readFrom(DataInput instream) throws Exception { host = S3Util.readString(instream); port = instream.readInt(); protocol = S3Util.readString(instream); }
java
public void readFrom(DataInput instream) throws Exception { host = S3Util.readString(instream); port = instream.readInt(); protocol = S3Util.readString(instream); }
[ "public", "void", "readFrom", "(", "DataInput", "instream", ")", "throws", "Exception", "{", "host", "=", "S3Util", ".", "readString", "(", "instream", ")", ";", "port", "=", "instream", ".", "readInt", "(", ")", ";", "protocol", "=", "S3Util", ".", "readString", "(", "instream", ")", ";", "}" ]
Read the domain controller's data from an input stream. @param instream the input stream @throws Exception
[ "Read", "the", "domain", "controller", "s", "data", "from", "an", "input", "stream", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/discovery/DomainControllerData.java#L99-L103
159,011
wildfly/wildfly-core
cli/src/main/java/org/jboss/as/cli/operation/OperationRequestCompleter.java
OperationRequestCompleter.complete
protected int complete(CommandContext ctx, ParsedCommandLine parsedCmd, OperationCandidatesProvider candidatesProvider, final String buffer, int cursor, List<String> candidates) { if(parsedCmd.isRequestComplete()) { return -1; } // Headers completion if(parsedCmd.endsOnHeaderListStart() || parsedCmd.hasHeaders()) { return completeHeaders(ctx, parsedCmd, candidatesProvider, buffer, cursor, candidates); } // Completed. if(parsedCmd.endsOnPropertyListEnd()) { return buffer.length(); } // Complete properties if (parsedCmd.hasProperties() || parsedCmd.endsOnPropertyListStart() || parsedCmd.endsOnNotOperator()) { return completeProperties(ctx, parsedCmd, candidatesProvider, buffer, candidates); } // Complete Operation name if (parsedCmd.hasOperationName() || parsedCmd.endsOnAddressOperationNameSeparator()) { return completeOperationName(ctx, parsedCmd, candidatesProvider, buffer, candidates); } // Finally Complete address return completeAddress(ctx, parsedCmd, candidatesProvider, buffer, candidates); }
java
protected int complete(CommandContext ctx, ParsedCommandLine parsedCmd, OperationCandidatesProvider candidatesProvider, final String buffer, int cursor, List<String> candidates) { if(parsedCmd.isRequestComplete()) { return -1; } // Headers completion if(parsedCmd.endsOnHeaderListStart() || parsedCmd.hasHeaders()) { return completeHeaders(ctx, parsedCmd, candidatesProvider, buffer, cursor, candidates); } // Completed. if(parsedCmd.endsOnPropertyListEnd()) { return buffer.length(); } // Complete properties if (parsedCmd.hasProperties() || parsedCmd.endsOnPropertyListStart() || parsedCmd.endsOnNotOperator()) { return completeProperties(ctx, parsedCmd, candidatesProvider, buffer, candidates); } // Complete Operation name if (parsedCmd.hasOperationName() || parsedCmd.endsOnAddressOperationNameSeparator()) { return completeOperationName(ctx, parsedCmd, candidatesProvider, buffer, candidates); } // Finally Complete address return completeAddress(ctx, parsedCmd, candidatesProvider, buffer, candidates); }
[ "protected", "int", "complete", "(", "CommandContext", "ctx", ",", "ParsedCommandLine", "parsedCmd", ",", "OperationCandidatesProvider", "candidatesProvider", ",", "final", "String", "buffer", ",", "int", "cursor", ",", "List", "<", "String", ">", "candidates", ")", "{", "if", "(", "parsedCmd", ".", "isRequestComplete", "(", ")", ")", "{", "return", "-", "1", ";", "}", "// Headers completion", "if", "(", "parsedCmd", ".", "endsOnHeaderListStart", "(", ")", "||", "parsedCmd", ".", "hasHeaders", "(", ")", ")", "{", "return", "completeHeaders", "(", "ctx", ",", "parsedCmd", ",", "candidatesProvider", ",", "buffer", ",", "cursor", ",", "candidates", ")", ";", "}", "// Completed.", "if", "(", "parsedCmd", ".", "endsOnPropertyListEnd", "(", ")", ")", "{", "return", "buffer", ".", "length", "(", ")", ";", "}", "// Complete properties", "if", "(", "parsedCmd", ".", "hasProperties", "(", ")", "||", "parsedCmd", ".", "endsOnPropertyListStart", "(", ")", "||", "parsedCmd", ".", "endsOnNotOperator", "(", ")", ")", "{", "return", "completeProperties", "(", "ctx", ",", "parsedCmd", ",", "candidatesProvider", ",", "buffer", ",", "candidates", ")", ";", "}", "// Complete Operation name", "if", "(", "parsedCmd", ".", "hasOperationName", "(", ")", "||", "parsedCmd", ".", "endsOnAddressOperationNameSeparator", "(", ")", ")", "{", "return", "completeOperationName", "(", "ctx", ",", "parsedCmd", ",", "candidatesProvider", ",", "buffer", ",", "candidates", ")", ";", "}", "// Finally Complete address", "return", "completeAddress", "(", "ctx", ",", "parsedCmd", ",", "candidatesProvider", ",", "buffer", ",", "candidates", ")", ";", "}" ]
Complete both operations and commands.
[ "Complete", "both", "operations", "and", "commands", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/operation/OperationRequestCompleter.java#L690-L719
159,012
wildfly/wildfly-core
server/src/main/java/org/jboss/as/server/deployment/annotation/CompositeIndexProcessor.java
CompositeIndexProcessor.handleClassPathItems
private Collection<? extends ResourceRoot> handleClassPathItems(final DeploymentUnit deploymentUnit) { final Set<ResourceRoot> additionalRoots = new HashSet<ResourceRoot>(); final ArrayDeque<ResourceRoot> toProcess = new ArrayDeque<ResourceRoot>(); final List<ResourceRoot> resourceRoots = DeploymentUtils.allResourceRoots(deploymentUnit); toProcess.addAll(resourceRoots); final Set<ResourceRoot> processed = new HashSet<ResourceRoot>(resourceRoots); while (!toProcess.isEmpty()) { final ResourceRoot root = toProcess.pop(); final List<ResourceRoot> classPathRoots = root.getAttachmentList(Attachments.CLASS_PATH_RESOURCE_ROOTS); for(ResourceRoot cpRoot : classPathRoots) { if(!processed.contains(cpRoot)) { additionalRoots.add(cpRoot); toProcess.add(cpRoot); processed.add(cpRoot); } } } return additionalRoots; }
java
private Collection<? extends ResourceRoot> handleClassPathItems(final DeploymentUnit deploymentUnit) { final Set<ResourceRoot> additionalRoots = new HashSet<ResourceRoot>(); final ArrayDeque<ResourceRoot> toProcess = new ArrayDeque<ResourceRoot>(); final List<ResourceRoot> resourceRoots = DeploymentUtils.allResourceRoots(deploymentUnit); toProcess.addAll(resourceRoots); final Set<ResourceRoot> processed = new HashSet<ResourceRoot>(resourceRoots); while (!toProcess.isEmpty()) { final ResourceRoot root = toProcess.pop(); final List<ResourceRoot> classPathRoots = root.getAttachmentList(Attachments.CLASS_PATH_RESOURCE_ROOTS); for(ResourceRoot cpRoot : classPathRoots) { if(!processed.contains(cpRoot)) { additionalRoots.add(cpRoot); toProcess.add(cpRoot); processed.add(cpRoot); } } } return additionalRoots; }
[ "private", "Collection", "<", "?", "extends", "ResourceRoot", ">", "handleClassPathItems", "(", "final", "DeploymentUnit", "deploymentUnit", ")", "{", "final", "Set", "<", "ResourceRoot", ">", "additionalRoots", "=", "new", "HashSet", "<", "ResourceRoot", ">", "(", ")", ";", "final", "ArrayDeque", "<", "ResourceRoot", ">", "toProcess", "=", "new", "ArrayDeque", "<", "ResourceRoot", ">", "(", ")", ";", "final", "List", "<", "ResourceRoot", ">", "resourceRoots", "=", "DeploymentUtils", ".", "allResourceRoots", "(", "deploymentUnit", ")", ";", "toProcess", ".", "addAll", "(", "resourceRoots", ")", ";", "final", "Set", "<", "ResourceRoot", ">", "processed", "=", "new", "HashSet", "<", "ResourceRoot", ">", "(", "resourceRoots", ")", ";", "while", "(", "!", "toProcess", ".", "isEmpty", "(", ")", ")", "{", "final", "ResourceRoot", "root", "=", "toProcess", ".", "pop", "(", ")", ";", "final", "List", "<", "ResourceRoot", ">", "classPathRoots", "=", "root", ".", "getAttachmentList", "(", "Attachments", ".", "CLASS_PATH_RESOURCE_ROOTS", ")", ";", "for", "(", "ResourceRoot", "cpRoot", ":", "classPathRoots", ")", "{", "if", "(", "!", "processed", ".", "contains", "(", "cpRoot", ")", ")", "{", "additionalRoots", ".", "add", "(", "cpRoot", ")", ";", "toProcess", ".", "add", "(", "cpRoot", ")", ";", "processed", ".", "add", "(", "cpRoot", ")", ";", "}", "}", "}", "return", "additionalRoots", ";", "}" ]
Loops through all resource roots that have been made available transitively via Class-Path entries, and adds them to the list of roots to be processed.
[ "Loops", "through", "all", "resource", "roots", "that", "have", "been", "made", "available", "transitively", "via", "Class", "-", "Path", "entries", "and", "adds", "them", "to", "the", "list", "of", "roots", "to", "be", "processed", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/annotation/CompositeIndexProcessor.java#L149-L168
159,013
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/ObjectListAttributeDefinition.java
ObjectListAttributeDefinition.resolveValue
@Override public ModelNode resolveValue(ExpressionResolver resolver, ModelNode value) throws OperationFailedException { // Pass non-LIST values through the superclass so it can reject weird values and, in the odd chance // that's how this object is set up, turn undefined into a default list value. ModelNode superResult = value.getType() == ModelType.LIST ? value : super.resolveValue(resolver, value); // If it's not a LIST (almost certainly UNDEFINED), then nothing more we can do if (superResult.getType() != ModelType.LIST) { return superResult; } // Resolve each element. // Don't mess with the original value ModelNode clone = superResult == value ? value.clone() : superResult; ModelNode result = new ModelNode(); result.setEmptyList(); for (ModelNode element : clone.asList()) { result.add(valueType.resolveValue(resolver, element)); } // Validate the entire list getValidator().validateParameter(getName(), result); return result; }
java
@Override public ModelNode resolveValue(ExpressionResolver resolver, ModelNode value) throws OperationFailedException { // Pass non-LIST values through the superclass so it can reject weird values and, in the odd chance // that's how this object is set up, turn undefined into a default list value. ModelNode superResult = value.getType() == ModelType.LIST ? value : super.resolveValue(resolver, value); // If it's not a LIST (almost certainly UNDEFINED), then nothing more we can do if (superResult.getType() != ModelType.LIST) { return superResult; } // Resolve each element. // Don't mess with the original value ModelNode clone = superResult == value ? value.clone() : superResult; ModelNode result = new ModelNode(); result.setEmptyList(); for (ModelNode element : clone.asList()) { result.add(valueType.resolveValue(resolver, element)); } // Validate the entire list getValidator().validateParameter(getName(), result); return result; }
[ "@", "Override", "public", "ModelNode", "resolveValue", "(", "ExpressionResolver", "resolver", ",", "ModelNode", "value", ")", "throws", "OperationFailedException", "{", "// Pass non-LIST values through the superclass so it can reject weird values and, in the odd chance", "// that's how this object is set up, turn undefined into a default list value.", "ModelNode", "superResult", "=", "value", ".", "getType", "(", ")", "==", "ModelType", ".", "LIST", "?", "value", ":", "super", ".", "resolveValue", "(", "resolver", ",", "value", ")", ";", "// If it's not a LIST (almost certainly UNDEFINED), then nothing more we can do", "if", "(", "superResult", ".", "getType", "(", ")", "!=", "ModelType", ".", "LIST", ")", "{", "return", "superResult", ";", "}", "// Resolve each element.", "// Don't mess with the original value", "ModelNode", "clone", "=", "superResult", "==", "value", "?", "value", ".", "clone", "(", ")", ":", "superResult", ";", "ModelNode", "result", "=", "new", "ModelNode", "(", ")", ";", "result", ".", "setEmptyList", "(", ")", ";", "for", "(", "ModelNode", "element", ":", "clone", ".", "asList", "(", ")", ")", "{", "result", ".", "add", "(", "valueType", ".", "resolveValue", "(", "resolver", ",", "element", ")", ")", ";", "}", "// Validate the entire list", "getValidator", "(", ")", ".", "validateParameter", "(", "getName", "(", ")", ",", "result", ")", ";", "return", "result", ";", "}" ]
Overrides the superclass implementation to allow the value type's AttributeDefinition to in turn resolve each element. {@inheritDoc}
[ "Overrides", "the", "superclass", "implementation", "to", "allow", "the", "value", "type", "s", "AttributeDefinition", "to", "in", "turn", "resolve", "each", "element", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/ObjectListAttributeDefinition.java#L133-L155
159,014
wildfly/wildfly-core
logging/src/main/java/org/jboss/as/logging/LoggingExtension.java
LoggingExtension.getResourceDescriptionResolver
public static ResourceDescriptionResolver getResourceDescriptionResolver(final String... keyPrefix) { StringBuilder prefix = new StringBuilder(SUBSYSTEM_NAME); for (String kp : keyPrefix) { prefix.append('.').append(kp); } return new StandardResourceDescriptionResolver(prefix.toString(), RESOURCE_NAME, LoggingExtension.class.getClassLoader(), true, false) { @Override public String getOperationParameterDescription(final String operationName, final String paramName, final Locale locale, final ResourceBundle bundle) { if (DELEGATE_DESC_OPTS.contains(operationName)) { return getResourceAttributeDescription(paramName, locale, bundle); } return super.getOperationParameterDescription(operationName, paramName, locale, bundle); } @Override public String getOperationParameterValueTypeDescription(final String operationName, final String paramName, final Locale locale, final ResourceBundle bundle, final String... suffixes) { if (DELEGATE_DESC_OPTS.contains(operationName)) { return getResourceAttributeDescription(paramName, locale, bundle); } return super.getOperationParameterValueTypeDescription(operationName, paramName, locale, bundle, suffixes); } @Override public String getOperationParameterDeprecatedDescription(final String operationName, final String paramName, final Locale locale, final ResourceBundle bundle) { if (DELEGATE_DESC_OPTS.contains(operationName)) { return getResourceAttributeDeprecatedDescription(paramName, locale, bundle); } return super.getOperationParameterDeprecatedDescription(operationName, paramName, locale, bundle); } }; }
java
public static ResourceDescriptionResolver getResourceDescriptionResolver(final String... keyPrefix) { StringBuilder prefix = new StringBuilder(SUBSYSTEM_NAME); for (String kp : keyPrefix) { prefix.append('.').append(kp); } return new StandardResourceDescriptionResolver(prefix.toString(), RESOURCE_NAME, LoggingExtension.class.getClassLoader(), true, false) { @Override public String getOperationParameterDescription(final String operationName, final String paramName, final Locale locale, final ResourceBundle bundle) { if (DELEGATE_DESC_OPTS.contains(operationName)) { return getResourceAttributeDescription(paramName, locale, bundle); } return super.getOperationParameterDescription(operationName, paramName, locale, bundle); } @Override public String getOperationParameterValueTypeDescription(final String operationName, final String paramName, final Locale locale, final ResourceBundle bundle, final String... suffixes) { if (DELEGATE_DESC_OPTS.contains(operationName)) { return getResourceAttributeDescription(paramName, locale, bundle); } return super.getOperationParameterValueTypeDescription(operationName, paramName, locale, bundle, suffixes); } @Override public String getOperationParameterDeprecatedDescription(final String operationName, final String paramName, final Locale locale, final ResourceBundle bundle) { if (DELEGATE_DESC_OPTS.contains(operationName)) { return getResourceAttributeDeprecatedDescription(paramName, locale, bundle); } return super.getOperationParameterDeprecatedDescription(operationName, paramName, locale, bundle); } }; }
[ "public", "static", "ResourceDescriptionResolver", "getResourceDescriptionResolver", "(", "final", "String", "...", "keyPrefix", ")", "{", "StringBuilder", "prefix", "=", "new", "StringBuilder", "(", "SUBSYSTEM_NAME", ")", ";", "for", "(", "String", "kp", ":", "keyPrefix", ")", "{", "prefix", ".", "append", "(", "'", "'", ")", ".", "append", "(", "kp", ")", ";", "}", "return", "new", "StandardResourceDescriptionResolver", "(", "prefix", ".", "toString", "(", ")", ",", "RESOURCE_NAME", ",", "LoggingExtension", ".", "class", ".", "getClassLoader", "(", ")", ",", "true", ",", "false", ")", "{", "@", "Override", "public", "String", "getOperationParameterDescription", "(", "final", "String", "operationName", ",", "final", "String", "paramName", ",", "final", "Locale", "locale", ",", "final", "ResourceBundle", "bundle", ")", "{", "if", "(", "DELEGATE_DESC_OPTS", ".", "contains", "(", "operationName", ")", ")", "{", "return", "getResourceAttributeDescription", "(", "paramName", ",", "locale", ",", "bundle", ")", ";", "}", "return", "super", ".", "getOperationParameterDescription", "(", "operationName", ",", "paramName", ",", "locale", ",", "bundle", ")", ";", "}", "@", "Override", "public", "String", "getOperationParameterValueTypeDescription", "(", "final", "String", "operationName", ",", "final", "String", "paramName", ",", "final", "Locale", "locale", ",", "final", "ResourceBundle", "bundle", ",", "final", "String", "...", "suffixes", ")", "{", "if", "(", "DELEGATE_DESC_OPTS", ".", "contains", "(", "operationName", ")", ")", "{", "return", "getResourceAttributeDescription", "(", "paramName", ",", "locale", ",", "bundle", ")", ";", "}", "return", "super", ".", "getOperationParameterValueTypeDescription", "(", "operationName", ",", "paramName", ",", "locale", ",", "bundle", ",", "suffixes", ")", ";", "}", "@", "Override", "public", "String", "getOperationParameterDeprecatedDescription", "(", "final", "String", "operationName", ",", "final", "String", "paramName", ",", "final", "Locale", "locale", ",", "final", "ResourceBundle", "bundle", ")", "{", "if", "(", "DELEGATE_DESC_OPTS", ".", "contains", "(", "operationName", ")", ")", "{", "return", "getResourceAttributeDeprecatedDescription", "(", "paramName", ",", "locale", ",", "bundle", ")", ";", "}", "return", "super", ".", "getOperationParameterDeprecatedDescription", "(", "operationName", ",", "paramName", ",", "locale", ",", "bundle", ")", ";", "}", "}", ";", "}" ]
Returns a resource description resolver that uses common descriptions for some attributes. @param keyPrefix the prefix to be appended to the {@link LoggingExtension#SUBSYSTEM_NAME} @return the resolver
[ "Returns", "a", "resource", "description", "resolver", "that", "uses", "common", "descriptions", "for", "some", "attributes", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/logging/src/main/java/org/jboss/as/logging/LoggingExtension.java#L130-L161
159,015
wildfly/wildfly-core
remoting/subsystem/src/main/java/org/jboss/as/remoting/RemotingSubsystem10Parser.java
RemotingSubsystem10Parser.parseWorkerThreadPool
void parseWorkerThreadPool(final XMLExtendedStreamReader reader, final ModelNode subsystemAdd) throws XMLStreamException { final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case WORKER_READ_THREADS: if (subsystemAdd.hasDefined(CommonAttributes.WORKER_READ_THREADS)) { throw duplicateAttribute(reader, CommonAttributes.WORKER_READ_THREADS); } RemotingSubsystemRootResource.WORKER_READ_THREADS.parseAndSetParameter(value, subsystemAdd, reader); break; case WORKER_TASK_CORE_THREADS: if (subsystemAdd.hasDefined(CommonAttributes.WORKER_TASK_CORE_THREADS)) { throw duplicateAttribute(reader, CommonAttributes.WORKER_TASK_CORE_THREADS); } RemotingSubsystemRootResource.WORKER_TASK_CORE_THREADS.parseAndSetParameter(value, subsystemAdd, reader); break; case WORKER_TASK_KEEPALIVE: if (subsystemAdd.hasDefined(CommonAttributes.WORKER_TASK_KEEPALIVE)) { throw duplicateAttribute(reader, CommonAttributes.WORKER_TASK_KEEPALIVE); } RemotingSubsystemRootResource.WORKER_TASK_KEEPALIVE.parseAndSetParameter(value, subsystemAdd, reader); break; case WORKER_TASK_LIMIT: if (subsystemAdd.hasDefined(CommonAttributes.WORKER_TASK_LIMIT)) { throw duplicateAttribute(reader, CommonAttributes.WORKER_TASK_LIMIT); } RemotingSubsystemRootResource.WORKER_TASK_LIMIT.parseAndSetParameter(value, subsystemAdd, reader); break; case WORKER_TASK_MAX_THREADS: if (subsystemAdd.hasDefined(CommonAttributes.WORKER_TASK_MAX_THREADS)) { throw duplicateAttribute(reader, CommonAttributes.WORKER_TASK_MAX_THREADS); } RemotingSubsystemRootResource.WORKER_TASK_MAX_THREADS.parseAndSetParameter(value, subsystemAdd, reader); break; case WORKER_WRITE_THREADS: if (subsystemAdd.hasDefined(CommonAttributes.WORKER_WRITE_THREADS)) { throw duplicateAttribute(reader, CommonAttributes.WORKER_WRITE_THREADS); } RemotingSubsystemRootResource.WORKER_WRITE_THREADS.parseAndSetParameter(value, subsystemAdd, reader); break; default: throw unexpectedAttribute(reader, i); } } requireNoContent(reader); }
java
void parseWorkerThreadPool(final XMLExtendedStreamReader reader, final ModelNode subsystemAdd) throws XMLStreamException { final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case WORKER_READ_THREADS: if (subsystemAdd.hasDefined(CommonAttributes.WORKER_READ_THREADS)) { throw duplicateAttribute(reader, CommonAttributes.WORKER_READ_THREADS); } RemotingSubsystemRootResource.WORKER_READ_THREADS.parseAndSetParameter(value, subsystemAdd, reader); break; case WORKER_TASK_CORE_THREADS: if (subsystemAdd.hasDefined(CommonAttributes.WORKER_TASK_CORE_THREADS)) { throw duplicateAttribute(reader, CommonAttributes.WORKER_TASK_CORE_THREADS); } RemotingSubsystemRootResource.WORKER_TASK_CORE_THREADS.parseAndSetParameter(value, subsystemAdd, reader); break; case WORKER_TASK_KEEPALIVE: if (subsystemAdd.hasDefined(CommonAttributes.WORKER_TASK_KEEPALIVE)) { throw duplicateAttribute(reader, CommonAttributes.WORKER_TASK_KEEPALIVE); } RemotingSubsystemRootResource.WORKER_TASK_KEEPALIVE.parseAndSetParameter(value, subsystemAdd, reader); break; case WORKER_TASK_LIMIT: if (subsystemAdd.hasDefined(CommonAttributes.WORKER_TASK_LIMIT)) { throw duplicateAttribute(reader, CommonAttributes.WORKER_TASK_LIMIT); } RemotingSubsystemRootResource.WORKER_TASK_LIMIT.parseAndSetParameter(value, subsystemAdd, reader); break; case WORKER_TASK_MAX_THREADS: if (subsystemAdd.hasDefined(CommonAttributes.WORKER_TASK_MAX_THREADS)) { throw duplicateAttribute(reader, CommonAttributes.WORKER_TASK_MAX_THREADS); } RemotingSubsystemRootResource.WORKER_TASK_MAX_THREADS.parseAndSetParameter(value, subsystemAdd, reader); break; case WORKER_WRITE_THREADS: if (subsystemAdd.hasDefined(CommonAttributes.WORKER_WRITE_THREADS)) { throw duplicateAttribute(reader, CommonAttributes.WORKER_WRITE_THREADS); } RemotingSubsystemRootResource.WORKER_WRITE_THREADS.parseAndSetParameter(value, subsystemAdd, reader); break; default: throw unexpectedAttribute(reader, i); } } requireNoContent(reader); }
[ "void", "parseWorkerThreadPool", "(", "final", "XMLExtendedStreamReader", "reader", ",", "final", "ModelNode", "subsystemAdd", ")", "throws", "XMLStreamException", "{", "final", "int", "count", "=", "reader", ".", "getAttributeCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "requireNoNamespaceAttribute", "(", "reader", ",", "i", ")", ";", "final", "String", "value", "=", "reader", ".", "getAttributeValue", "(", "i", ")", ";", "final", "Attribute", "attribute", "=", "Attribute", ".", "forName", "(", "reader", ".", "getAttributeLocalName", "(", "i", ")", ")", ";", "switch", "(", "attribute", ")", "{", "case", "WORKER_READ_THREADS", ":", "if", "(", "subsystemAdd", ".", "hasDefined", "(", "CommonAttributes", ".", "WORKER_READ_THREADS", ")", ")", "{", "throw", "duplicateAttribute", "(", "reader", ",", "CommonAttributes", ".", "WORKER_READ_THREADS", ")", ";", "}", "RemotingSubsystemRootResource", ".", "WORKER_READ_THREADS", ".", "parseAndSetParameter", "(", "value", ",", "subsystemAdd", ",", "reader", ")", ";", "break", ";", "case", "WORKER_TASK_CORE_THREADS", ":", "if", "(", "subsystemAdd", ".", "hasDefined", "(", "CommonAttributes", ".", "WORKER_TASK_CORE_THREADS", ")", ")", "{", "throw", "duplicateAttribute", "(", "reader", ",", "CommonAttributes", ".", "WORKER_TASK_CORE_THREADS", ")", ";", "}", "RemotingSubsystemRootResource", ".", "WORKER_TASK_CORE_THREADS", ".", "parseAndSetParameter", "(", "value", ",", "subsystemAdd", ",", "reader", ")", ";", "break", ";", "case", "WORKER_TASK_KEEPALIVE", ":", "if", "(", "subsystemAdd", ".", "hasDefined", "(", "CommonAttributes", ".", "WORKER_TASK_KEEPALIVE", ")", ")", "{", "throw", "duplicateAttribute", "(", "reader", ",", "CommonAttributes", ".", "WORKER_TASK_KEEPALIVE", ")", ";", "}", "RemotingSubsystemRootResource", ".", "WORKER_TASK_KEEPALIVE", ".", "parseAndSetParameter", "(", "value", ",", "subsystemAdd", ",", "reader", ")", ";", "break", ";", "case", "WORKER_TASK_LIMIT", ":", "if", "(", "subsystemAdd", ".", "hasDefined", "(", "CommonAttributes", ".", "WORKER_TASK_LIMIT", ")", ")", "{", "throw", "duplicateAttribute", "(", "reader", ",", "CommonAttributes", ".", "WORKER_TASK_LIMIT", ")", ";", "}", "RemotingSubsystemRootResource", ".", "WORKER_TASK_LIMIT", ".", "parseAndSetParameter", "(", "value", ",", "subsystemAdd", ",", "reader", ")", ";", "break", ";", "case", "WORKER_TASK_MAX_THREADS", ":", "if", "(", "subsystemAdd", ".", "hasDefined", "(", "CommonAttributes", ".", "WORKER_TASK_MAX_THREADS", ")", ")", "{", "throw", "duplicateAttribute", "(", "reader", ",", "CommonAttributes", ".", "WORKER_TASK_MAX_THREADS", ")", ";", "}", "RemotingSubsystemRootResource", ".", "WORKER_TASK_MAX_THREADS", ".", "parseAndSetParameter", "(", "value", ",", "subsystemAdd", ",", "reader", ")", ";", "break", ";", "case", "WORKER_WRITE_THREADS", ":", "if", "(", "subsystemAdd", ".", "hasDefined", "(", "CommonAttributes", ".", "WORKER_WRITE_THREADS", ")", ")", "{", "throw", "duplicateAttribute", "(", "reader", ",", "CommonAttributes", ".", "WORKER_WRITE_THREADS", ")", ";", "}", "RemotingSubsystemRootResource", ".", "WORKER_WRITE_THREADS", ".", "parseAndSetParameter", "(", "value", ",", "subsystemAdd", ",", "reader", ")", ";", "break", ";", "default", ":", "throw", "unexpectedAttribute", "(", "reader", ",", "i", ")", ";", "}", "}", "requireNoContent", "(", "reader", ")", ";", "}" ]
Adds the worker thread pool attributes to the subysystem add method
[ "Adds", "the", "worker", "thread", "pool", "attributes", "to", "the", "subysystem", "add", "method" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/remoting/subsystem/src/main/java/org/jboss/as/remoting/RemotingSubsystem10Parser.java#L82-L130
159,016
wildfly/wildfly-core
host-controller/src/main/java/org/jboss/as/domain/controller/operations/coordination/ServerRequireRestartTask.java
ServerRequireRestartTask.createOperation
private static ModelNode createOperation(ServerIdentity identity) { // The server address final ModelNode address = new ModelNode(); address.add(ModelDescriptionConstants.HOST, identity.getHostName()); address.add(ModelDescriptionConstants.RUNNING_SERVER, identity.getServerName()); // final ModelNode operation = OPERATION.clone(); operation.get(ModelDescriptionConstants.OP_ADDR).set(address); return operation; }
java
private static ModelNode createOperation(ServerIdentity identity) { // The server address final ModelNode address = new ModelNode(); address.add(ModelDescriptionConstants.HOST, identity.getHostName()); address.add(ModelDescriptionConstants.RUNNING_SERVER, identity.getServerName()); // final ModelNode operation = OPERATION.clone(); operation.get(ModelDescriptionConstants.OP_ADDR).set(address); return operation; }
[ "private", "static", "ModelNode", "createOperation", "(", "ServerIdentity", "identity", ")", "{", "// The server address", "final", "ModelNode", "address", "=", "new", "ModelNode", "(", ")", ";", "address", ".", "add", "(", "ModelDescriptionConstants", ".", "HOST", ",", "identity", ".", "getHostName", "(", ")", ")", ";", "address", ".", "add", "(", "ModelDescriptionConstants", ".", "RUNNING_SERVER", ",", "identity", ".", "getServerName", "(", ")", ")", ";", "//", "final", "ModelNode", "operation", "=", "OPERATION", ".", "clone", "(", ")", ";", "operation", ".", "get", "(", "ModelDescriptionConstants", ".", "OP_ADDR", ")", ".", "set", "(", "address", ")", ";", "return", "operation", ";", "}" ]
Transform the operation into something the proxy controller understands. @param identity the server identity @return the transformed operation
[ "Transform", "the", "operation", "into", "something", "the", "proxy", "controller", "understands", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/operations/coordination/ServerRequireRestartTask.java#L114-L123
159,017
wildfly/wildfly-core
domain-management/src/main/java/org/jboss/as/domain/management/security/adduser/PropertyFileFinder.java
PropertyFileFinder.buildDirPath
private File buildDirPath(final String serverConfigUserDirPropertyName, final String suppliedConfigDir, final String serverConfigDirPropertyName, final String serverBaseDirPropertyName, final String defaultBaseDir) { String propertyDir = System.getProperty(serverConfigUserDirPropertyName); if (propertyDir != null) { return new File(propertyDir); } if (suppliedConfigDir != null) { return new File(suppliedConfigDir); } propertyDir = System.getProperty(serverConfigDirPropertyName); if (propertyDir != null) { return new File(propertyDir); } propertyDir = System.getProperty(serverBaseDirPropertyName); if (propertyDir != null) { return new File(propertyDir); } return new File(new File(stateValues.getOptions().getJBossHome(), defaultBaseDir), "configuration"); }
java
private File buildDirPath(final String serverConfigUserDirPropertyName, final String suppliedConfigDir, final String serverConfigDirPropertyName, final String serverBaseDirPropertyName, final String defaultBaseDir) { String propertyDir = System.getProperty(serverConfigUserDirPropertyName); if (propertyDir != null) { return new File(propertyDir); } if (suppliedConfigDir != null) { return new File(suppliedConfigDir); } propertyDir = System.getProperty(serverConfigDirPropertyName); if (propertyDir != null) { return new File(propertyDir); } propertyDir = System.getProperty(serverBaseDirPropertyName); if (propertyDir != null) { return new File(propertyDir); } return new File(new File(stateValues.getOptions().getJBossHome(), defaultBaseDir), "configuration"); }
[ "private", "File", "buildDirPath", "(", "final", "String", "serverConfigUserDirPropertyName", ",", "final", "String", "suppliedConfigDir", ",", "final", "String", "serverConfigDirPropertyName", ",", "final", "String", "serverBaseDirPropertyName", ",", "final", "String", "defaultBaseDir", ")", "{", "String", "propertyDir", "=", "System", ".", "getProperty", "(", "serverConfigUserDirPropertyName", ")", ";", "if", "(", "propertyDir", "!=", "null", ")", "{", "return", "new", "File", "(", "propertyDir", ")", ";", "}", "if", "(", "suppliedConfigDir", "!=", "null", ")", "{", "return", "new", "File", "(", "suppliedConfigDir", ")", ";", "}", "propertyDir", "=", "System", ".", "getProperty", "(", "serverConfigDirPropertyName", ")", ";", "if", "(", "propertyDir", "!=", "null", ")", "{", "return", "new", "File", "(", "propertyDir", ")", ";", "}", "propertyDir", "=", "System", ".", "getProperty", "(", "serverBaseDirPropertyName", ")", ";", "if", "(", "propertyDir", "!=", "null", ")", "{", "return", "new", "File", "(", "propertyDir", ")", ";", "}", "return", "new", "File", "(", "new", "File", "(", "stateValues", ".", "getOptions", "(", ")", ".", "getJBossHome", "(", ")", ",", "defaultBaseDir", ")", ",", "\"configuration\"", ")", ";", "}" ]
This method attempts to locate a suitable directory by checking a number of different configuration sources. 1 - serverConfigUserDirPropertyName - This value is used to check it a matching system property has been set. 2 - suppliedConfigDir - If a path was specified on the command line it is expected to be passed in as this parameter. 3 - serverConfigDirPropertyName - This is a second system property to check. And finally if none of these match defaultBaseDir specifies the configuration being searched and is appended to the JBoss Home value discovered when the utility started.
[ "This", "method", "attempts", "to", "locate", "a", "suitable", "directory", "by", "checking", "a", "number", "of", "different", "configuration", "sources", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/domain-management/src/main/java/org/jboss/as/domain/management/security/adduser/PropertyFileFinder.java#L261-L281
159,018
wildfly/wildfly-core
domain-management/src/main/java/org/jboss/as/domain/management/security/adduser/PropertyFileFinder.java
PropertyFileFinder.validatePermissions
private void validatePermissions(final File dirPath, final File file) { // Check execute and read permissions for parent dirPath if( !dirPath.canExecute() || !dirPath.canRead() ) { validFilePermissions = false; filePermissionsProblemPath = dirPath.getAbsolutePath(); return; } // Check read and write permissions for properties file if( !file.canRead() || !file.canWrite() ) { validFilePermissions = false; filePermissionsProblemPath = dirPath.getAbsolutePath(); } }
java
private void validatePermissions(final File dirPath, final File file) { // Check execute and read permissions for parent dirPath if( !dirPath.canExecute() || !dirPath.canRead() ) { validFilePermissions = false; filePermissionsProblemPath = dirPath.getAbsolutePath(); return; } // Check read and write permissions for properties file if( !file.canRead() || !file.canWrite() ) { validFilePermissions = false; filePermissionsProblemPath = dirPath.getAbsolutePath(); } }
[ "private", "void", "validatePermissions", "(", "final", "File", "dirPath", ",", "final", "File", "file", ")", "{", "// Check execute and read permissions for parent dirPath", "if", "(", "!", "dirPath", ".", "canExecute", "(", ")", "||", "!", "dirPath", ".", "canRead", "(", ")", ")", "{", "validFilePermissions", "=", "false", ";", "filePermissionsProblemPath", "=", "dirPath", ".", "getAbsolutePath", "(", ")", ";", "return", ";", "}", "// Check read and write permissions for properties file", "if", "(", "!", "file", ".", "canRead", "(", ")", "||", "!", "file", ".", "canWrite", "(", ")", ")", "{", "validFilePermissions", "=", "false", ";", "filePermissionsProblemPath", "=", "dirPath", ".", "getAbsolutePath", "(", ")", ";", "}", "}" ]
This method performs a series of permissions checks given a directory and properties file path. 1 - Check whether the parent directory dirPath has proper execute and read permissions 2 - Check whether properties file path is readable and writable If either of the permissions checks fail, update validFilePermissions and filePermissionsProblemPath appropriately.
[ "This", "method", "performs", "a", "series", "of", "permissions", "checks", "given", "a", "directory", "and", "properties", "file", "path", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/domain-management/src/main/java/org/jboss/as/domain/management/security/adduser/PropertyFileFinder.java#L293-L308
159,019
wildfly/wildfly-core
launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java
AbstractCommandBuilder.normalizePath
protected Path normalizePath(final Path parent, final String path) { return parent.resolve(path).toAbsolutePath().normalize(); }
java
protected Path normalizePath(final Path parent, final String path) { return parent.resolve(path).toAbsolutePath().normalize(); }
[ "protected", "Path", "normalizePath", "(", "final", "Path", "parent", ",", "final", "String", "path", ")", "{", "return", "parent", ".", "resolve", "(", "path", ")", ".", "toAbsolutePath", "(", ")", ".", "normalize", "(", ")", ";", "}" ]
Resolves the path relative to the parent and normalizes it. @param parent the parent path @param path the path @return the normalized path
[ "Resolves", "the", "path", "relative", "to", "the", "parent", "and", "normalizes", "it", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java#L564-L566
159,020
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/ContainerStateMonitor.java
ContainerStateMonitor.awaitStabilityUninterruptibly
void awaitStabilityUninterruptibly(long timeout, TimeUnit timeUnit) throws TimeoutException { boolean interrupted = false; try { long toWait = timeUnit.toMillis(timeout); long msTimeout = System.currentTimeMillis() + toWait; while (true) { if (interrupted) { toWait = msTimeout - System.currentTimeMillis(); } try { if (toWait <= 0 || !monitor.awaitStability(toWait, TimeUnit.MILLISECONDS, failed, problems)) { throw new TimeoutException(); } break; } catch (InterruptedException e) { interrupted = true; } } } finally { if (interrupted) { Thread.currentThread().interrupt(); } } }
java
void awaitStabilityUninterruptibly(long timeout, TimeUnit timeUnit) throws TimeoutException { boolean interrupted = false; try { long toWait = timeUnit.toMillis(timeout); long msTimeout = System.currentTimeMillis() + toWait; while (true) { if (interrupted) { toWait = msTimeout - System.currentTimeMillis(); } try { if (toWait <= 0 || !monitor.awaitStability(toWait, TimeUnit.MILLISECONDS, failed, problems)) { throw new TimeoutException(); } break; } catch (InterruptedException e) { interrupted = true; } } } finally { if (interrupted) { Thread.currentThread().interrupt(); } } }
[ "void", "awaitStabilityUninterruptibly", "(", "long", "timeout", ",", "TimeUnit", "timeUnit", ")", "throws", "TimeoutException", "{", "boolean", "interrupted", "=", "false", ";", "try", "{", "long", "toWait", "=", "timeUnit", ".", "toMillis", "(", "timeout", ")", ";", "long", "msTimeout", "=", "System", ".", "currentTimeMillis", "(", ")", "+", "toWait", ";", "while", "(", "true", ")", "{", "if", "(", "interrupted", ")", "{", "toWait", "=", "msTimeout", "-", "System", ".", "currentTimeMillis", "(", ")", ";", "}", "try", "{", "if", "(", "toWait", "<=", "0", "||", "!", "monitor", ".", "awaitStability", "(", "toWait", ",", "TimeUnit", ".", "MILLISECONDS", ",", "failed", ",", "problems", ")", ")", "{", "throw", "new", "TimeoutException", "(", ")", ";", "}", "break", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "interrupted", "=", "true", ";", "}", "}", "}", "finally", "{", "if", "(", "interrupted", ")", "{", "Thread", ".", "currentThread", "(", ")", ".", "interrupt", "(", ")", ";", "}", "}", "}" ]
Await service container stability ignoring thread interruption. @param timeout maximum period to wait for service container stability @param timeUnit unit in which {@code timeout} is expressed @throws java.util.concurrent.TimeoutException if service container stability is not reached before the specified timeout
[ "Await", "service", "container", "stability", "ignoring", "thread", "interruption", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/ContainerStateMonitor.java#L89-L112
159,021
wildfly/wildfly-core
server/src/main/java/org/jboss/as/server/ServerService.java
ServerService.addService
public static void addService(final ServiceTarget serviceTarget, final Bootstrap.Configuration configuration, final ControlledProcessState processState, final BootstrapListener bootstrapListener, final RunningModeControl runningModeControl, final AbstractVaultReader vaultReader, final ManagedAuditLogger auditLogger, final DelegatingConfigurableAuthorizer authorizer, final ManagementSecurityIdentitySupplier securityIdentitySupplier, final SuspendController suspendController) { // Install Executor services final ThreadGroup threadGroup = new ThreadGroup("ServerService ThreadGroup"); final String namePattern = "ServerService Thread Pool -- %t"; final ThreadFactory threadFactory = doPrivileged(new PrivilegedAction<ThreadFactory>() { public ThreadFactory run() { return new JBossThreadFactory(threadGroup, Boolean.FALSE, null, namePattern, null, null); } }); // TODO determine why QueuelessThreadPoolService makes boot take > 35 secs // final QueuelessThreadPoolService serverExecutorService = new QueuelessThreadPoolService(Integer.MAX_VALUE, false, new TimeSpec(TimeUnit.SECONDS, 5)); // serverExecutorService.getThreadFactoryInjector().inject(threadFactory); final boolean forDomain = ProcessType.DOMAIN_SERVER == getProcessType(configuration.getServerEnvironment()); final ServerExecutorService serverExecutorService = new ServerExecutorService(threadFactory, forDomain); serviceTarget.addService(MANAGEMENT_EXECUTOR, serverExecutorService) .addAliases(Services.JBOSS_SERVER_EXECUTOR, ManagementRemotingServices.SHUTDOWN_EXECUTOR_NAME) // Use this executor for mgmt shutdown for now .install(); final ServerScheduledExecutorService serverScheduledExecutorService = new ServerScheduledExecutorService(threadFactory); serviceTarget.addService(JBOSS_SERVER_SCHEDULED_EXECUTOR, serverScheduledExecutorService) .addAliases(JBOSS_SERVER_SCHEDULED_EXECUTOR) .addDependency(MANAGEMENT_EXECUTOR, ExecutorService.class, serverScheduledExecutorService.executorInjector) .install(); final CapabilityRegistry capabilityRegistry = configuration.getCapabilityRegistry(); ServerService service = new ServerService(configuration, processState, null, bootstrapListener, new ServerDelegatingResourceDefinition(), runningModeControl, vaultReader, auditLogger, authorizer, securityIdentitySupplier, capabilityRegistry, suspendController); ExternalManagementRequestExecutor.install(serviceTarget, threadGroup, EXECUTOR_CAPABILITY.getCapabilityServiceName(), service.getStabilityMonitor()); ServiceBuilder<?> serviceBuilder = serviceTarget.addService(Services.JBOSS_SERVER_CONTROLLER, service); serviceBuilder.addDependency(DeploymentMountProvider.SERVICE_NAME,DeploymentMountProvider.class, service.injectedDeploymentRepository); serviceBuilder.addDependency(ContentRepository.SERVICE_NAME, ContentRepository.class, service.injectedContentRepository); serviceBuilder.addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ServiceModuleLoader.class, service.injectedModuleLoader); serviceBuilder.addDependency(Services.JBOSS_EXTERNAL_MODULE_SERVICE, ExternalModuleService.class, service.injectedExternalModuleService); serviceBuilder.addDependency(PATH_MANAGER_CAPABILITY.getCapabilityServiceName(), PathManager.class, service.injectedPathManagerService); if (configuration.getServerEnvironment().isAllowModelControllerExecutor()) { serviceBuilder.addDependency(MANAGEMENT_EXECUTOR, ExecutorService.class, service.getExecutorServiceInjector()); } if (configuration.getServerEnvironment().getLaunchType() == ServerEnvironment.LaunchType.DOMAIN) { serviceBuilder.addDependency(HostControllerConnectionService.SERVICE_NAME, ControllerInstabilityListener.class, service.getContainerInstabilityInjector()); } serviceBuilder.install(); }
java
public static void addService(final ServiceTarget serviceTarget, final Bootstrap.Configuration configuration, final ControlledProcessState processState, final BootstrapListener bootstrapListener, final RunningModeControl runningModeControl, final AbstractVaultReader vaultReader, final ManagedAuditLogger auditLogger, final DelegatingConfigurableAuthorizer authorizer, final ManagementSecurityIdentitySupplier securityIdentitySupplier, final SuspendController suspendController) { // Install Executor services final ThreadGroup threadGroup = new ThreadGroup("ServerService ThreadGroup"); final String namePattern = "ServerService Thread Pool -- %t"; final ThreadFactory threadFactory = doPrivileged(new PrivilegedAction<ThreadFactory>() { public ThreadFactory run() { return new JBossThreadFactory(threadGroup, Boolean.FALSE, null, namePattern, null, null); } }); // TODO determine why QueuelessThreadPoolService makes boot take > 35 secs // final QueuelessThreadPoolService serverExecutorService = new QueuelessThreadPoolService(Integer.MAX_VALUE, false, new TimeSpec(TimeUnit.SECONDS, 5)); // serverExecutorService.getThreadFactoryInjector().inject(threadFactory); final boolean forDomain = ProcessType.DOMAIN_SERVER == getProcessType(configuration.getServerEnvironment()); final ServerExecutorService serverExecutorService = new ServerExecutorService(threadFactory, forDomain); serviceTarget.addService(MANAGEMENT_EXECUTOR, serverExecutorService) .addAliases(Services.JBOSS_SERVER_EXECUTOR, ManagementRemotingServices.SHUTDOWN_EXECUTOR_NAME) // Use this executor for mgmt shutdown for now .install(); final ServerScheduledExecutorService serverScheduledExecutorService = new ServerScheduledExecutorService(threadFactory); serviceTarget.addService(JBOSS_SERVER_SCHEDULED_EXECUTOR, serverScheduledExecutorService) .addAliases(JBOSS_SERVER_SCHEDULED_EXECUTOR) .addDependency(MANAGEMENT_EXECUTOR, ExecutorService.class, serverScheduledExecutorService.executorInjector) .install(); final CapabilityRegistry capabilityRegistry = configuration.getCapabilityRegistry(); ServerService service = new ServerService(configuration, processState, null, bootstrapListener, new ServerDelegatingResourceDefinition(), runningModeControl, vaultReader, auditLogger, authorizer, securityIdentitySupplier, capabilityRegistry, suspendController); ExternalManagementRequestExecutor.install(serviceTarget, threadGroup, EXECUTOR_CAPABILITY.getCapabilityServiceName(), service.getStabilityMonitor()); ServiceBuilder<?> serviceBuilder = serviceTarget.addService(Services.JBOSS_SERVER_CONTROLLER, service); serviceBuilder.addDependency(DeploymentMountProvider.SERVICE_NAME,DeploymentMountProvider.class, service.injectedDeploymentRepository); serviceBuilder.addDependency(ContentRepository.SERVICE_NAME, ContentRepository.class, service.injectedContentRepository); serviceBuilder.addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ServiceModuleLoader.class, service.injectedModuleLoader); serviceBuilder.addDependency(Services.JBOSS_EXTERNAL_MODULE_SERVICE, ExternalModuleService.class, service.injectedExternalModuleService); serviceBuilder.addDependency(PATH_MANAGER_CAPABILITY.getCapabilityServiceName(), PathManager.class, service.injectedPathManagerService); if (configuration.getServerEnvironment().isAllowModelControllerExecutor()) { serviceBuilder.addDependency(MANAGEMENT_EXECUTOR, ExecutorService.class, service.getExecutorServiceInjector()); } if (configuration.getServerEnvironment().getLaunchType() == ServerEnvironment.LaunchType.DOMAIN) { serviceBuilder.addDependency(HostControllerConnectionService.SERVICE_NAME, ControllerInstabilityListener.class, service.getContainerInstabilityInjector()); } serviceBuilder.install(); }
[ "public", "static", "void", "addService", "(", "final", "ServiceTarget", "serviceTarget", ",", "final", "Bootstrap", ".", "Configuration", "configuration", ",", "final", "ControlledProcessState", "processState", ",", "final", "BootstrapListener", "bootstrapListener", ",", "final", "RunningModeControl", "runningModeControl", ",", "final", "AbstractVaultReader", "vaultReader", ",", "final", "ManagedAuditLogger", "auditLogger", ",", "final", "DelegatingConfigurableAuthorizer", "authorizer", ",", "final", "ManagementSecurityIdentitySupplier", "securityIdentitySupplier", ",", "final", "SuspendController", "suspendController", ")", "{", "// Install Executor services", "final", "ThreadGroup", "threadGroup", "=", "new", "ThreadGroup", "(", "\"ServerService ThreadGroup\"", ")", ";", "final", "String", "namePattern", "=", "\"ServerService Thread Pool -- %t\"", ";", "final", "ThreadFactory", "threadFactory", "=", "doPrivileged", "(", "new", "PrivilegedAction", "<", "ThreadFactory", ">", "(", ")", "{", "public", "ThreadFactory", "run", "(", ")", "{", "return", "new", "JBossThreadFactory", "(", "threadGroup", ",", "Boolean", ".", "FALSE", ",", "null", ",", "namePattern", ",", "null", ",", "null", ")", ";", "}", "}", ")", ";", "// TODO determine why QueuelessThreadPoolService makes boot take > 35 secs", "// final QueuelessThreadPoolService serverExecutorService = new QueuelessThreadPoolService(Integer.MAX_VALUE, false, new TimeSpec(TimeUnit.SECONDS, 5));", "// serverExecutorService.getThreadFactoryInjector().inject(threadFactory);", "final", "boolean", "forDomain", "=", "ProcessType", ".", "DOMAIN_SERVER", "==", "getProcessType", "(", "configuration", ".", "getServerEnvironment", "(", ")", ")", ";", "final", "ServerExecutorService", "serverExecutorService", "=", "new", "ServerExecutorService", "(", "threadFactory", ",", "forDomain", ")", ";", "serviceTarget", ".", "addService", "(", "MANAGEMENT_EXECUTOR", ",", "serverExecutorService", ")", ".", "addAliases", "(", "Services", ".", "JBOSS_SERVER_EXECUTOR", ",", "ManagementRemotingServices", ".", "SHUTDOWN_EXECUTOR_NAME", ")", "// Use this executor for mgmt shutdown for now", ".", "install", "(", ")", ";", "final", "ServerScheduledExecutorService", "serverScheduledExecutorService", "=", "new", "ServerScheduledExecutorService", "(", "threadFactory", ")", ";", "serviceTarget", ".", "addService", "(", "JBOSS_SERVER_SCHEDULED_EXECUTOR", ",", "serverScheduledExecutorService", ")", ".", "addAliases", "(", "JBOSS_SERVER_SCHEDULED_EXECUTOR", ")", ".", "addDependency", "(", "MANAGEMENT_EXECUTOR", ",", "ExecutorService", ".", "class", ",", "serverScheduledExecutorService", ".", "executorInjector", ")", ".", "install", "(", ")", ";", "final", "CapabilityRegistry", "capabilityRegistry", "=", "configuration", ".", "getCapabilityRegistry", "(", ")", ";", "ServerService", "service", "=", "new", "ServerService", "(", "configuration", ",", "processState", ",", "null", ",", "bootstrapListener", ",", "new", "ServerDelegatingResourceDefinition", "(", ")", ",", "runningModeControl", ",", "vaultReader", ",", "auditLogger", ",", "authorizer", ",", "securityIdentitySupplier", ",", "capabilityRegistry", ",", "suspendController", ")", ";", "ExternalManagementRequestExecutor", ".", "install", "(", "serviceTarget", ",", "threadGroup", ",", "EXECUTOR_CAPABILITY", ".", "getCapabilityServiceName", "(", ")", ",", "service", ".", "getStabilityMonitor", "(", ")", ")", ";", "ServiceBuilder", "<", "?", ">", "serviceBuilder", "=", "serviceTarget", ".", "addService", "(", "Services", ".", "JBOSS_SERVER_CONTROLLER", ",", "service", ")", ";", "serviceBuilder", ".", "addDependency", "(", "DeploymentMountProvider", ".", "SERVICE_NAME", ",", "DeploymentMountProvider", ".", "class", ",", "service", ".", "injectedDeploymentRepository", ")", ";", "serviceBuilder", ".", "addDependency", "(", "ContentRepository", ".", "SERVICE_NAME", ",", "ContentRepository", ".", "class", ",", "service", ".", "injectedContentRepository", ")", ";", "serviceBuilder", ".", "addDependency", "(", "Services", ".", "JBOSS_SERVICE_MODULE_LOADER", ",", "ServiceModuleLoader", ".", "class", ",", "service", ".", "injectedModuleLoader", ")", ";", "serviceBuilder", ".", "addDependency", "(", "Services", ".", "JBOSS_EXTERNAL_MODULE_SERVICE", ",", "ExternalModuleService", ".", "class", ",", "service", ".", "injectedExternalModuleService", ")", ";", "serviceBuilder", ".", "addDependency", "(", "PATH_MANAGER_CAPABILITY", ".", "getCapabilityServiceName", "(", ")", ",", "PathManager", ".", "class", ",", "service", ".", "injectedPathManagerService", ")", ";", "if", "(", "configuration", ".", "getServerEnvironment", "(", ")", ".", "isAllowModelControllerExecutor", "(", ")", ")", "{", "serviceBuilder", ".", "addDependency", "(", "MANAGEMENT_EXECUTOR", ",", "ExecutorService", ".", "class", ",", "service", ".", "getExecutorServiceInjector", "(", ")", ")", ";", "}", "if", "(", "configuration", ".", "getServerEnvironment", "(", ")", ".", "getLaunchType", "(", ")", "==", "ServerEnvironment", ".", "LaunchType", ".", "DOMAIN", ")", "{", "serviceBuilder", ".", "addDependency", "(", "HostControllerConnectionService", ".", "SERVICE_NAME", ",", "ControllerInstabilityListener", ".", "class", ",", "service", ".", "getContainerInstabilityInjector", "(", ")", ")", ";", "}", "serviceBuilder", ".", "install", "(", ")", ";", "}" ]
Add this service to the given service target. @param serviceTarget the service target @param configuration the bootstrap configuration
[ "Add", "this", "service", "to", "the", "given", "service", "target", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/ServerService.java#L216-L267
159,022
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/tool/PatchOperationTarget.java
PatchOperationTarget.createLocal
public static final PatchOperationTarget createLocal(final File jbossHome, List<File> moduleRoots, List<File> bundlesRoots) throws IOException { final PatchTool tool = PatchTool.Factory.createLocalTool(jbossHome, moduleRoots, bundlesRoots); return new LocalPatchOperationTarget(tool); }
java
public static final PatchOperationTarget createLocal(final File jbossHome, List<File> moduleRoots, List<File> bundlesRoots) throws IOException { final PatchTool tool = PatchTool.Factory.createLocalTool(jbossHome, moduleRoots, bundlesRoots); return new LocalPatchOperationTarget(tool); }
[ "public", "static", "final", "PatchOperationTarget", "createLocal", "(", "final", "File", "jbossHome", ",", "List", "<", "File", ">", "moduleRoots", ",", "List", "<", "File", ">", "bundlesRoots", ")", "throws", "IOException", "{", "final", "PatchTool", "tool", "=", "PatchTool", ".", "Factory", ".", "createLocalTool", "(", "jbossHome", ",", "moduleRoots", ",", "bundlesRoots", ")", ";", "return", "new", "LocalPatchOperationTarget", "(", "tool", ")", ";", "}" ]
Create a local target. @param jbossHome the jboss home @param moduleRoots the module roots @param bundlesRoots the bundle roots @return the local target @throws IOException
[ "Create", "a", "local", "target", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/tool/PatchOperationTarget.java#L76-L79
159,023
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/tool/PatchOperationTarget.java
PatchOperationTarget.createStandalone
public static final PatchOperationTarget createStandalone(final ModelControllerClient controllerClient) { final PathAddress address = PathAddress.EMPTY_ADDRESS.append(CORE_SERVICES); return new RemotePatchOperationTarget(address, controllerClient); }
java
public static final PatchOperationTarget createStandalone(final ModelControllerClient controllerClient) { final PathAddress address = PathAddress.EMPTY_ADDRESS.append(CORE_SERVICES); return new RemotePatchOperationTarget(address, controllerClient); }
[ "public", "static", "final", "PatchOperationTarget", "createStandalone", "(", "final", "ModelControllerClient", "controllerClient", ")", "{", "final", "PathAddress", "address", "=", "PathAddress", ".", "EMPTY_ADDRESS", ".", "append", "(", "CORE_SERVICES", ")", ";", "return", "new", "RemotePatchOperationTarget", "(", "address", ",", "controllerClient", ")", ";", "}" ]
Create a standalone target. @param controllerClient the connected controller client to a standalone instance. @return the remote target
[ "Create", "a", "standalone", "target", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/tool/PatchOperationTarget.java#L87-L90
159,024
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/tool/PatchOperationTarget.java
PatchOperationTarget.createHost
public static final PatchOperationTarget createHost(final String hostName, final ModelControllerClient client) { final PathElement host = PathElement.pathElement(HOST, hostName); final PathAddress address = PathAddress.EMPTY_ADDRESS.append(host, CORE_SERVICES); return new RemotePatchOperationTarget(address, client); }
java
public static final PatchOperationTarget createHost(final String hostName, final ModelControllerClient client) { final PathElement host = PathElement.pathElement(HOST, hostName); final PathAddress address = PathAddress.EMPTY_ADDRESS.append(host, CORE_SERVICES); return new RemotePatchOperationTarget(address, client); }
[ "public", "static", "final", "PatchOperationTarget", "createHost", "(", "final", "String", "hostName", ",", "final", "ModelControllerClient", "client", ")", "{", "final", "PathElement", "host", "=", "PathElement", ".", "pathElement", "(", "HOST", ",", "hostName", ")", ";", "final", "PathAddress", "address", "=", "PathAddress", ".", "EMPTY_ADDRESS", ".", "append", "(", "host", ",", "CORE_SERVICES", ")", ";", "return", "new", "RemotePatchOperationTarget", "(", "address", ",", "client", ")", ";", "}" ]
Create a host target. @param hostName the host name @param client the connected controller client to the master host. @return the remote target
[ "Create", "a", "host", "target", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/tool/PatchOperationTarget.java#L99-L103
159,025
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/registry/OperationTransformerRegistry.java
OperationTransformerRegistry.resolveResourceTransformer
public ResourceTransformerEntry resolveResourceTransformer(final PathAddress address, final PlaceholderResolver placeholderResolver) { return resolveResourceTransformer(address.iterator(), null, placeholderResolver); }
java
public ResourceTransformerEntry resolveResourceTransformer(final PathAddress address, final PlaceholderResolver placeholderResolver) { return resolveResourceTransformer(address.iterator(), null, placeholderResolver); }
[ "public", "ResourceTransformerEntry", "resolveResourceTransformer", "(", "final", "PathAddress", "address", ",", "final", "PlaceholderResolver", "placeholderResolver", ")", "{", "return", "resolveResourceTransformer", "(", "address", ".", "iterator", "(", ")", ",", "null", ",", "placeholderResolver", ")", ";", "}" ]
Resolve a resource transformer for a given address. @param address the address @param placeholderResolver a placeholder resolver used to resolve children of a placeholder registration @return the resource transformer
[ "Resolve", "a", "resource", "transformer", "for", "a", "given", "address", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/registry/OperationTransformerRegistry.java#L95-L97
159,026
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/registry/OperationTransformerRegistry.java
OperationTransformerRegistry.resolveOperationTransformer
public OperationTransformerEntry resolveOperationTransformer(final PathAddress address, final String operationName, PlaceholderResolver placeholderResolver) { final Iterator<PathElement> iterator = address.iterator(); final OperationTransformerEntry entry = resolveOperationTransformer(iterator, operationName, placeholderResolver); if(entry != null) { return entry; } // Default is forward unchanged return FORWARD; }
java
public OperationTransformerEntry resolveOperationTransformer(final PathAddress address, final String operationName, PlaceholderResolver placeholderResolver) { final Iterator<PathElement> iterator = address.iterator(); final OperationTransformerEntry entry = resolveOperationTransformer(iterator, operationName, placeholderResolver); if(entry != null) { return entry; } // Default is forward unchanged return FORWARD; }
[ "public", "OperationTransformerEntry", "resolveOperationTransformer", "(", "final", "PathAddress", "address", ",", "final", "String", "operationName", ",", "PlaceholderResolver", "placeholderResolver", ")", "{", "final", "Iterator", "<", "PathElement", ">", "iterator", "=", "address", ".", "iterator", "(", ")", ";", "final", "OperationTransformerEntry", "entry", "=", "resolveOperationTransformer", "(", "iterator", ",", "operationName", ",", "placeholderResolver", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "return", "entry", ";", "}", "// Default is forward unchanged", "return", "FORWARD", ";", "}" ]
Resolve an operation transformer entry. @param address the address @param operationName the operation name @param placeholderResolver a placeholder resolver used to resolve children of a placeholder registration @return the transformer entry
[ "Resolve", "an", "operation", "transformer", "entry", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/registry/OperationTransformerRegistry.java#L107-L115
159,027
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/registry/OperationTransformerRegistry.java
OperationTransformerRegistry.mergeSubsystem
public void mergeSubsystem(final GlobalTransformerRegistry registry, String subsystemName, ModelVersion version) { final PathElement element = PathElement.pathElement(SUBSYSTEM, subsystemName); registry.mergeSubtree(this, PathAddress.EMPTY_ADDRESS.append(element), version); }
java
public void mergeSubsystem(final GlobalTransformerRegistry registry, String subsystemName, ModelVersion version) { final PathElement element = PathElement.pathElement(SUBSYSTEM, subsystemName); registry.mergeSubtree(this, PathAddress.EMPTY_ADDRESS.append(element), version); }
[ "public", "void", "mergeSubsystem", "(", "final", "GlobalTransformerRegistry", "registry", ",", "String", "subsystemName", ",", "ModelVersion", "version", ")", "{", "final", "PathElement", "element", "=", "PathElement", ".", "pathElement", "(", "SUBSYSTEM", ",", "subsystemName", ")", ";", "registry", ".", "mergeSubtree", "(", "this", ",", "PathAddress", ".", "EMPTY_ADDRESS", ".", "append", "(", "element", ")", ",", "version", ")", ";", "}" ]
Merge a new subsystem from the global registration. @param registry the global registry @param subsystemName the subsystem name @param version the subsystem version
[ "Merge", "a", "new", "subsystem", "from", "the", "global", "registration", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/registry/OperationTransformerRegistry.java#L124-L127
159,028
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/registry/OperationTransformerRegistry.java
OperationTransformerRegistry.getPathTransformations
public List<PathAddressTransformer> getPathTransformations(final PathAddress address, PlaceholderResolver placeholderResolver) { final List<PathAddressTransformer> list = new ArrayList<PathAddressTransformer>(); final Iterator<PathElement> iterator = address.iterator(); resolvePathTransformers(iterator, list, placeholderResolver); if(iterator.hasNext()) { while(iterator.hasNext()) { iterator.next(); list.add(PathAddressTransformer.DEFAULT); } } return list; }
java
public List<PathAddressTransformer> getPathTransformations(final PathAddress address, PlaceholderResolver placeholderResolver) { final List<PathAddressTransformer> list = new ArrayList<PathAddressTransformer>(); final Iterator<PathElement> iterator = address.iterator(); resolvePathTransformers(iterator, list, placeholderResolver); if(iterator.hasNext()) { while(iterator.hasNext()) { iterator.next(); list.add(PathAddressTransformer.DEFAULT); } } return list; }
[ "public", "List", "<", "PathAddressTransformer", ">", "getPathTransformations", "(", "final", "PathAddress", "address", ",", "PlaceholderResolver", "placeholderResolver", ")", "{", "final", "List", "<", "PathAddressTransformer", ">", "list", "=", "new", "ArrayList", "<", "PathAddressTransformer", ">", "(", ")", ";", "final", "Iterator", "<", "PathElement", ">", "iterator", "=", "address", ".", "iterator", "(", ")", ";", "resolvePathTransformers", "(", "iterator", ",", "list", ",", "placeholderResolver", ")", ";", "if", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "iterator", ".", "next", "(", ")", ";", "list", ".", "add", "(", "PathAddressTransformer", ".", "DEFAULT", ")", ";", "}", "}", "return", "list", ";", "}" ]
Get a list of path transformers for a given address. @param address the path address @param placeholderResolver a placeholder resolver used to resolve children of a placeholder registration @return a list of path transformations
[ "Get", "a", "list", "of", "path", "transformers", "for", "a", "given", "address", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/registry/OperationTransformerRegistry.java#L136-L147
159,029
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.addContentModification
public T addContentModification(final ContentModification modification) { if (itemFilter.accepts(modification.getItem())) { internalAddModification(modification); } return returnThis(); }
java
public T addContentModification(final ContentModification modification) { if (itemFilter.accepts(modification.getItem())) { internalAddModification(modification); } return returnThis(); }
[ "public", "T", "addContentModification", "(", "final", "ContentModification", "modification", ")", "{", "if", "(", "itemFilter", ".", "accepts", "(", "modification", ".", "getItem", "(", ")", ")", ")", "{", "internalAddModification", "(", "modification", ")", ";", "}", "return", "returnThis", "(", ")", ";", "}" ]
Add a content modification. @param modification the content modification
[ "Add", "a", "content", "modification", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L57-L62
159,030
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.addBundle
public T addBundle(final String moduleName, final String slot, final byte[] newHash) { final ContentItem item = createBundleItem(moduleName, slot, newHash); addContentModification(createContentModification(item, ModificationType.ADD, NO_CONTENT)); return returnThis(); }
java
public T addBundle(final String moduleName, final String slot, final byte[] newHash) { final ContentItem item = createBundleItem(moduleName, slot, newHash); addContentModification(createContentModification(item, ModificationType.ADD, NO_CONTENT)); return returnThis(); }
[ "public", "T", "addBundle", "(", "final", "String", "moduleName", ",", "final", "String", "slot", ",", "final", "byte", "[", "]", "newHash", ")", "{", "final", "ContentItem", "item", "=", "createBundleItem", "(", "moduleName", ",", "slot", ",", "newHash", ")", ";", "addContentModification", "(", "createContentModification", "(", "item", ",", "ModificationType", ".", "ADD", ",", "NO_CONTENT", ")", ")", ";", "return", "returnThis", "(", ")", ";", "}" ]
Add a bundle. @param moduleName the module name @param slot the module slot @param newHash the new hash of the added content @return the builder
[ "Add", "a", "bundle", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L72-L76
159,031
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.modifyBundle
public T modifyBundle(final String moduleName, final String slot, final byte[] existingHash, final byte[] newHash) { final ContentItem item = createBundleItem(moduleName, slot, newHash); addContentModification(createContentModification(item, ModificationType.MODIFY, existingHash)); return returnThis(); }
java
public T modifyBundle(final String moduleName, final String slot, final byte[] existingHash, final byte[] newHash) { final ContentItem item = createBundleItem(moduleName, slot, newHash); addContentModification(createContentModification(item, ModificationType.MODIFY, existingHash)); return returnThis(); }
[ "public", "T", "modifyBundle", "(", "final", "String", "moduleName", ",", "final", "String", "slot", ",", "final", "byte", "[", "]", "existingHash", ",", "final", "byte", "[", "]", "newHash", ")", "{", "final", "ContentItem", "item", "=", "createBundleItem", "(", "moduleName", ",", "slot", ",", "newHash", ")", ";", "addContentModification", "(", "createContentModification", "(", "item", ",", "ModificationType", ".", "MODIFY", ",", "existingHash", ")", ")", ";", "return", "returnThis", "(", ")", ";", "}" ]
Modify a bundle. @param moduleName the module name @param slot the module slot @param existingHash the existing hash @param newHash the new hash of the modified content @return the builder
[ "Modify", "a", "bundle", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L87-L91
159,032
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.removeBundle
public T removeBundle(final String moduleName, final String slot, final byte[] existingHash) { final ContentItem item = createBundleItem(moduleName, slot, NO_CONTENT); addContentModification(createContentModification(item, ModificationType.REMOVE, existingHash)); return returnThis(); }
java
public T removeBundle(final String moduleName, final String slot, final byte[] existingHash) { final ContentItem item = createBundleItem(moduleName, slot, NO_CONTENT); addContentModification(createContentModification(item, ModificationType.REMOVE, existingHash)); return returnThis(); }
[ "public", "T", "removeBundle", "(", "final", "String", "moduleName", ",", "final", "String", "slot", ",", "final", "byte", "[", "]", "existingHash", ")", "{", "final", "ContentItem", "item", "=", "createBundleItem", "(", "moduleName", ",", "slot", ",", "NO_CONTENT", ")", ";", "addContentModification", "(", "createContentModification", "(", "item", ",", "ModificationType", ".", "REMOVE", ",", "existingHash", ")", ")", ";", "return", "returnThis", "(", ")", ";", "}" ]
Remove a bundle. @param moduleName the module name @param slot the module slot @param existingHash the existing hash @return the builder
[ "Remove", "a", "bundle", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L101-L105
159,033
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.addFile
public T addFile(final String name, final List<String> path, final byte[] newHash, final boolean isDirectory) { return addFile(name, path, newHash, isDirectory, null); }
java
public T addFile(final String name, final List<String> path, final byte[] newHash, final boolean isDirectory) { return addFile(name, path, newHash, isDirectory, null); }
[ "public", "T", "addFile", "(", "final", "String", "name", ",", "final", "List", "<", "String", ">", "path", ",", "final", "byte", "[", "]", "newHash", ",", "final", "boolean", "isDirectory", ")", "{", "return", "addFile", "(", "name", ",", "path", ",", "newHash", ",", "isDirectory", ",", "null", ")", ";", "}" ]
Add a misc file. @param name the file name @param path the relative path @param newHash the new hash of the added content @param isDirectory whether the file is a directory or not @return the builder
[ "Add", "a", "misc", "file", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L116-L118
159,034
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.modifyFile
public T modifyFile(final String name, final List<String> path, final byte[] existingHash, final byte[] newHash, final boolean isDirectory) { return modifyFile(name, path, existingHash, newHash, isDirectory, null); }
java
public T modifyFile(final String name, final List<String> path, final byte[] existingHash, final byte[] newHash, final boolean isDirectory) { return modifyFile(name, path, existingHash, newHash, isDirectory, null); }
[ "public", "T", "modifyFile", "(", "final", "String", "name", ",", "final", "List", "<", "String", ">", "path", ",", "final", "byte", "[", "]", "existingHash", ",", "final", "byte", "[", "]", "newHash", ",", "final", "boolean", "isDirectory", ")", "{", "return", "modifyFile", "(", "name", ",", "path", ",", "existingHash", ",", "newHash", ",", "isDirectory", ",", "null", ")", ";", "}" ]
Modify a misc file. @param name the file name @param path the relative path @param existingHash the existing hash @param newHash the new hash of the modified content @param isDirectory whether the file is a directory or not @return the builder
[ "Modify", "a", "misc", "file", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L136-L138
159,035
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.removeFile
public T removeFile(final String name, final List<String> path, final byte[] existingHash, final boolean isDirectory) { return removeFile(name, path, existingHash, isDirectory, null); }
java
public T removeFile(final String name, final List<String> path, final byte[] existingHash, final boolean isDirectory) { return removeFile(name, path, existingHash, isDirectory, null); }
[ "public", "T", "removeFile", "(", "final", "String", "name", ",", "final", "List", "<", "String", ">", "path", ",", "final", "byte", "[", "]", "existingHash", ",", "final", "boolean", "isDirectory", ")", "{", "return", "removeFile", "(", "name", ",", "path", ",", "existingHash", ",", "isDirectory", ",", "null", ")", ";", "}" ]
Remove a misc file. @param name the file name @param path the relative path @param existingHash the existing hash @param isDirectory whether the file is a directory or not @return the builder
[ "Remove", "a", "misc", "file", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L155-L157
159,036
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.addModule
public T addModule(final String moduleName, final String slot, final byte[] newHash) { final ContentItem item = createModuleItem(moduleName, slot, newHash); addContentModification(createContentModification(item, ModificationType.ADD, NO_CONTENT)); return returnThis(); }
java
public T addModule(final String moduleName, final String slot, final byte[] newHash) { final ContentItem item = createModuleItem(moduleName, slot, newHash); addContentModification(createContentModification(item, ModificationType.ADD, NO_CONTENT)); return returnThis(); }
[ "public", "T", "addModule", "(", "final", "String", "moduleName", ",", "final", "String", "slot", ",", "final", "byte", "[", "]", "newHash", ")", "{", "final", "ContentItem", "item", "=", "createModuleItem", "(", "moduleName", ",", "slot", ",", "newHash", ")", ";", "addContentModification", "(", "createContentModification", "(", "item", ",", "ModificationType", ".", "ADD", ",", "NO_CONTENT", ")", ")", ";", "return", "returnThis", "(", ")", ";", "}" ]
Add a module. @param moduleName the module name @param slot the module slot @param newHash the new hash of the added content @return the builder
[ "Add", "a", "module", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L174-L178
159,037
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.modifyModule
public T modifyModule(final String moduleName, final String slot, final byte[] existingHash, final byte[] newHash) { final ContentItem item = createModuleItem(moduleName, slot, newHash); addContentModification(createContentModification(item, ModificationType.MODIFY, existingHash)); return returnThis(); }
java
public T modifyModule(final String moduleName, final String slot, final byte[] existingHash, final byte[] newHash) { final ContentItem item = createModuleItem(moduleName, slot, newHash); addContentModification(createContentModification(item, ModificationType.MODIFY, existingHash)); return returnThis(); }
[ "public", "T", "modifyModule", "(", "final", "String", "moduleName", ",", "final", "String", "slot", ",", "final", "byte", "[", "]", "existingHash", ",", "final", "byte", "[", "]", "newHash", ")", "{", "final", "ContentItem", "item", "=", "createModuleItem", "(", "moduleName", ",", "slot", ",", "newHash", ")", ";", "addContentModification", "(", "createContentModification", "(", "item", ",", "ModificationType", ".", "MODIFY", ",", "existingHash", ")", ")", ";", "return", "returnThis", "(", ")", ";", "}" ]
Modify a module. @param moduleName the module name @param slot the module slot @param existingHash the existing hash @param newHash the new hash of the modified content @return the builder
[ "Modify", "a", "module", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L189-L193
159,038
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.removeModule
public T removeModule(final String moduleName, final String slot, final byte[] existingHash) { final ContentItem item = createModuleItem(moduleName, slot, NO_CONTENT); addContentModification(createContentModification(item, ModificationType.REMOVE, existingHash)); return returnThis(); }
java
public T removeModule(final String moduleName, final String slot, final byte[] existingHash) { final ContentItem item = createModuleItem(moduleName, slot, NO_CONTENT); addContentModification(createContentModification(item, ModificationType.REMOVE, existingHash)); return returnThis(); }
[ "public", "T", "removeModule", "(", "final", "String", "moduleName", ",", "final", "String", "slot", ",", "final", "byte", "[", "]", "existingHash", ")", "{", "final", "ContentItem", "item", "=", "createModuleItem", "(", "moduleName", ",", "slot", ",", "NO_CONTENT", ")", ";", "addContentModification", "(", "createContentModification", "(", "item", ",", "ModificationType", ".", "REMOVE", ",", "existingHash", ")", ")", ";", "return", "returnThis", "(", ")", ";", "}" ]
Remove a module. @param moduleName the module name @param slot the module slot @param existingHash the existing hash @return the builder
[ "Remove", "a", "module", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L203-L207
159,039
wildfly/wildfly-core
logging/src/main/java/org/jboss/as/logging/loggers/LoggerOperations.java
LoggerOperations.getLogManagerLoggerName
private static String getLogManagerLoggerName(final String name) { return (name.equals(RESOURCE_NAME) ? CommonAttributes.ROOT_LOGGER_NAME : name); }
java
private static String getLogManagerLoggerName(final String name) { return (name.equals(RESOURCE_NAME) ? CommonAttributes.ROOT_LOGGER_NAME : name); }
[ "private", "static", "String", "getLogManagerLoggerName", "(", "final", "String", "name", ")", "{", "return", "(", "name", ".", "equals", "(", "RESOURCE_NAME", ")", "?", "CommonAttributes", ".", "ROOT_LOGGER_NAME", ":", "name", ")", ";", "}" ]
Returns the logger name that should be used in the log manager. @param name the name of the logger from the resource @return the name of the logger
[ "Returns", "the", "logger", "name", "that", "should", "be", "used", "in", "the", "log", "manager", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/logging/src/main/java/org/jboss/as/logging/loggers/LoggerOperations.java#L302-L304
159,040
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java
ParseUtils.unexpectedEndElement
public static XMLStreamException unexpectedEndElement(final XMLExtendedStreamReader reader) { return ControllerLogger.ROOT_LOGGER.unexpectedEndElement(reader.getName(), reader.getLocation()); }
java
public static XMLStreamException unexpectedEndElement(final XMLExtendedStreamReader reader) { return ControllerLogger.ROOT_LOGGER.unexpectedEndElement(reader.getName(), reader.getLocation()); }
[ "public", "static", "XMLStreamException", "unexpectedEndElement", "(", "final", "XMLExtendedStreamReader", "reader", ")", "{", "return", "ControllerLogger", ".", "ROOT_LOGGER", ".", "unexpectedEndElement", "(", "reader", ".", "getName", "(", ")", ",", "reader", ".", "getLocation", "(", ")", ")", ";", "}" ]
Get an exception reporting an unexpected end tag for an XML element. @param reader the stream reader @return the exception
[ "Get", "an", "exception", "reporting", "an", "unexpected", "end", "tag", "for", "an", "XML", "element", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java#L124-L126
159,041
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java
ParseUtils.missingRequiredElement
public static XMLStreamException missingRequiredElement(final XMLExtendedStreamReader reader, final Set<?> required) { final StringBuilder b = new StringBuilder(); Iterator<?> iterator = required.iterator(); while (iterator.hasNext()) { final Object o = iterator.next(); b.append(o.toString()); if (iterator.hasNext()) { b.append(", "); } } final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.missingRequiredElements(b, reader.getLocation()); Set<String> set = new HashSet<>(); for (Object o : required) { String toString = o.toString(); set.add(toString); } return new XMLStreamValidationException(ex.getMessage(), ValidationError.from(ex, ErrorType.REQUIRED_ELEMENTS_MISSING) .element(reader.getName()) .alternatives(set), ex); }
java
public static XMLStreamException missingRequiredElement(final XMLExtendedStreamReader reader, final Set<?> required) { final StringBuilder b = new StringBuilder(); Iterator<?> iterator = required.iterator(); while (iterator.hasNext()) { final Object o = iterator.next(); b.append(o.toString()); if (iterator.hasNext()) { b.append(", "); } } final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.missingRequiredElements(b, reader.getLocation()); Set<String> set = new HashSet<>(); for (Object o : required) { String toString = o.toString(); set.add(toString); } return new XMLStreamValidationException(ex.getMessage(), ValidationError.from(ex, ErrorType.REQUIRED_ELEMENTS_MISSING) .element(reader.getName()) .alternatives(set), ex); }
[ "public", "static", "XMLStreamException", "missingRequiredElement", "(", "final", "XMLExtendedStreamReader", "reader", ",", "final", "Set", "<", "?", ">", "required", ")", "{", "final", "StringBuilder", "b", "=", "new", "StringBuilder", "(", ")", ";", "Iterator", "<", "?", ">", "iterator", "=", "required", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "final", "Object", "o", "=", "iterator", ".", "next", "(", ")", ";", "b", ".", "append", "(", "o", ".", "toString", "(", ")", ")", ";", "if", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "b", ".", "append", "(", "\", \"", ")", ";", "}", "}", "final", "XMLStreamException", "ex", "=", "ControllerLogger", ".", "ROOT_LOGGER", ".", "missingRequiredElements", "(", "b", ",", "reader", ".", "getLocation", "(", ")", ")", ";", "Set", "<", "String", ">", "set", "=", "new", "HashSet", "<>", "(", ")", ";", "for", "(", "Object", "o", ":", "required", ")", "{", "String", "toString", "=", "o", ".", "toString", "(", ")", ";", "set", ".", "add", "(", "toString", ")", ";", "}", "return", "new", "XMLStreamValidationException", "(", "ex", ".", "getMessage", "(", ")", ",", "ValidationError", ".", "from", "(", "ex", ",", "ErrorType", ".", "REQUIRED_ELEMENTS_MISSING", ")", ".", "element", "(", "reader", ".", "getName", "(", ")", ")", ".", "alternatives", "(", "set", ")", ",", "ex", ")", ";", "}" ]
Get an exception reporting a missing, required XML child element. @param reader the stream reader @param required a set of enums whose toString method returns the attribute name @return the exception
[ "Get", "an", "exception", "reporting", "a", "missing", "required", "XML", "child", "element", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java#L246-L268
159,042
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java
ParseUtils.requireNamespace
public static void requireNamespace(final XMLExtendedStreamReader reader, final Namespace requiredNs) throws XMLStreamException { Namespace actualNs = Namespace.forUri(reader.getNamespaceURI()); if (actualNs != requiredNs) { throw unexpectedElement(reader); } }
java
public static void requireNamespace(final XMLExtendedStreamReader reader, final Namespace requiredNs) throws XMLStreamException { Namespace actualNs = Namespace.forUri(reader.getNamespaceURI()); if (actualNs != requiredNs) { throw unexpectedElement(reader); } }
[ "public", "static", "void", "requireNamespace", "(", "final", "XMLExtendedStreamReader", "reader", ",", "final", "Namespace", "requiredNs", ")", "throws", "XMLStreamException", "{", "Namespace", "actualNs", "=", "Namespace", ".", "forUri", "(", "reader", ".", "getNamespaceURI", "(", ")", ")", ";", "if", "(", "actualNs", "!=", "requiredNs", ")", "{", "throw", "unexpectedElement", "(", "reader", ")", ";", "}", "}" ]
Require that the namespace of the current element matches the required namespace. @param reader the reader @param requiredNs the namespace required @throws XMLStreamException if the current namespace does not match the required namespace
[ "Require", "that", "the", "namespace", "of", "the", "current", "element", "matches", "the", "required", "namespace", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java#L333-L338
159,043
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java
ParseUtils.readBooleanAttributeElement
public static boolean readBooleanAttributeElement(final XMLExtendedStreamReader reader, final String attributeName) throws XMLStreamException { requireSingleAttribute(reader, attributeName); final boolean value = Boolean.parseBoolean(reader.getAttributeValue(0)); requireNoContent(reader); return value; }
java
public static boolean readBooleanAttributeElement(final XMLExtendedStreamReader reader, final String attributeName) throws XMLStreamException { requireSingleAttribute(reader, attributeName); final boolean value = Boolean.parseBoolean(reader.getAttributeValue(0)); requireNoContent(reader); return value; }
[ "public", "static", "boolean", "readBooleanAttributeElement", "(", "final", "XMLExtendedStreamReader", "reader", ",", "final", "String", "attributeName", ")", "throws", "XMLStreamException", "{", "requireSingleAttribute", "(", "reader", ",", "attributeName", ")", ";", "final", "boolean", "value", "=", "Boolean", ".", "parseBoolean", "(", "reader", ".", "getAttributeValue", "(", "0", ")", ")", ";", "requireNoContent", "(", "reader", ")", ";", "return", "value", ";", "}" ]
Read an element which contains only a single boolean attribute. @param reader the reader @param attributeName the attribute name, usually "value" @return the boolean value @throws javax.xml.stream.XMLStreamException if an error occurs or if the element does not contain the specified attribute, contains other attributes, or contains child elements.
[ "Read", "an", "element", "which", "contains", "only", "a", "single", "boolean", "attribute", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java#L384-L390
159,044
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java
ParseUtils.readListAttributeElement
@SuppressWarnings({"unchecked", "WeakerAccess"}) public static <T> List<T> readListAttributeElement(final XMLExtendedStreamReader reader, final String attributeName, final Class<T> type) throws XMLStreamException { requireSingleAttribute(reader, attributeName); // todo: fix this when this method signature is corrected final List<T> value = (List<T>) reader.getListAttributeValue(0, type); requireNoContent(reader); return value; }
java
@SuppressWarnings({"unchecked", "WeakerAccess"}) public static <T> List<T> readListAttributeElement(final XMLExtendedStreamReader reader, final String attributeName, final Class<T> type) throws XMLStreamException { requireSingleAttribute(reader, attributeName); // todo: fix this when this method signature is corrected final List<T> value = (List<T>) reader.getListAttributeValue(0, type); requireNoContent(reader); return value; }
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"WeakerAccess\"", "}", ")", "public", "static", "<", "T", ">", "List", "<", "T", ">", "readListAttributeElement", "(", "final", "XMLExtendedStreamReader", "reader", ",", "final", "String", "attributeName", ",", "final", "Class", "<", "T", ">", "type", ")", "throws", "XMLStreamException", "{", "requireSingleAttribute", "(", "reader", ",", "attributeName", ")", ";", "// todo: fix this when this method signature is corrected", "final", "List", "<", "T", ">", "value", "=", "(", "List", "<", "T", ">", ")", "reader", ".", "getListAttributeValue", "(", "0", ",", "type", ")", ";", "requireNoContent", "(", "reader", ")", ";", "return", "value", ";", "}" ]
Read an element which contains only a single list attribute of a given type. @param reader the reader @param attributeName the attribute name, usually "value" @param type the value type class @param <T> the value type @return the value list @throws javax.xml.stream.XMLStreamException if an error occurs or if the element does not contain the specified attribute, contains other attributes, or contains child elements.
[ "Read", "an", "element", "which", "contains", "only", "a", "single", "list", "attribute", "of", "a", "given", "type", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java#L421-L429
159,045
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java
ParseUtils.readArrayAttributeElement
@SuppressWarnings({ "unchecked" }) public static <T> T[] readArrayAttributeElement(final XMLExtendedStreamReader reader, final String attributeName, final Class<T> type) throws XMLStreamException { final List<T> list = readListAttributeElement(reader, attributeName, type); return list.toArray((T[]) Array.newInstance(type, list.size())); }
java
@SuppressWarnings({ "unchecked" }) public static <T> T[] readArrayAttributeElement(final XMLExtendedStreamReader reader, final String attributeName, final Class<T> type) throws XMLStreamException { final List<T> list = readListAttributeElement(reader, attributeName, type); return list.toArray((T[]) Array.newInstance(type, list.size())); }
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", "}", ")", "public", "static", "<", "T", ">", "T", "[", "]", "readArrayAttributeElement", "(", "final", "XMLExtendedStreamReader", "reader", ",", "final", "String", "attributeName", ",", "final", "Class", "<", "T", ">", "type", ")", "throws", "XMLStreamException", "{", "final", "List", "<", "T", ">", "list", "=", "readListAttributeElement", "(", "reader", ",", "attributeName", ",", "type", ")", ";", "return", "list", ".", "toArray", "(", "(", "T", "[", "]", ")", "Array", ".", "newInstance", "(", "type", ",", "list", ".", "size", "(", ")", ")", ")", ";", "}" ]
Read an element which contains only a single list attribute of a given type, returning it as an array. @param reader the reader @param attributeName the attribute name, usually "value" @param type the value type class @param <T> the value type @return the value list as an array @throws javax.xml.stream.XMLStreamException if an error occurs or if the element does not contain the specified attribute, contains other attributes, or contains child elements.
[ "Read", "an", "element", "which", "contains", "only", "a", "single", "list", "attribute", "of", "a", "given", "type", "returning", "it", "as", "an", "array", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java#L478-L483
159,046
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/ObjectTypeAttributeDefinition.java
ObjectTypeAttributeDefinition.resolveValue
@Override public ModelNode resolveValue(ExpressionResolver resolver, ModelNode value) throws OperationFailedException { // Pass non-OBJECT values through the superclass so it can reject weird values and, in the odd chance // that's how this object is set up, turn undefined into a default list value. ModelNode superResult = value.getType() == ModelType.OBJECT ? value : super.resolveValue(resolver, value); // If it's not an OBJECT (almost certainly UNDEFINED), then nothing more we can do if (superResult.getType() != ModelType.OBJECT) { return superResult; } // Resolve each field. // Don't mess with the original value ModelNode clone = superResult == value ? value.clone() : superResult; ModelNode result = new ModelNode(); for (AttributeDefinition field : valueTypes) { String fieldName = field.getName(); if (clone.has(fieldName)) { result.get(fieldName).set(field.resolveValue(resolver, clone.get(fieldName))); } else { // Input doesn't have a child for this field. // Don't create one in the output unless the AD produces a default value. // TBH this doesn't make a ton of sense, since any object should have // all of its fields, just some may be undefined. But doing it this // way may avoid breaking some code that is incorrectly checking node.has("xxx") // instead of node.hasDefined("xxx") ModelNode val = field.resolveValue(resolver, new ModelNode()); if (val.isDefined()) { result.get(fieldName).set(val); } } } // Validate the entire object getValidator().validateParameter(getName(), result); return result; }
java
@Override public ModelNode resolveValue(ExpressionResolver resolver, ModelNode value) throws OperationFailedException { // Pass non-OBJECT values through the superclass so it can reject weird values and, in the odd chance // that's how this object is set up, turn undefined into a default list value. ModelNode superResult = value.getType() == ModelType.OBJECT ? value : super.resolveValue(resolver, value); // If it's not an OBJECT (almost certainly UNDEFINED), then nothing more we can do if (superResult.getType() != ModelType.OBJECT) { return superResult; } // Resolve each field. // Don't mess with the original value ModelNode clone = superResult == value ? value.clone() : superResult; ModelNode result = new ModelNode(); for (AttributeDefinition field : valueTypes) { String fieldName = field.getName(); if (clone.has(fieldName)) { result.get(fieldName).set(field.resolveValue(resolver, clone.get(fieldName))); } else { // Input doesn't have a child for this field. // Don't create one in the output unless the AD produces a default value. // TBH this doesn't make a ton of sense, since any object should have // all of its fields, just some may be undefined. But doing it this // way may avoid breaking some code that is incorrectly checking node.has("xxx") // instead of node.hasDefined("xxx") ModelNode val = field.resolveValue(resolver, new ModelNode()); if (val.isDefined()) { result.get(fieldName).set(val); } } } // Validate the entire object getValidator().validateParameter(getName(), result); return result; }
[ "@", "Override", "public", "ModelNode", "resolveValue", "(", "ExpressionResolver", "resolver", ",", "ModelNode", "value", ")", "throws", "OperationFailedException", "{", "// Pass non-OBJECT values through the superclass so it can reject weird values and, in the odd chance", "// that's how this object is set up, turn undefined into a default list value.", "ModelNode", "superResult", "=", "value", ".", "getType", "(", ")", "==", "ModelType", ".", "OBJECT", "?", "value", ":", "super", ".", "resolveValue", "(", "resolver", ",", "value", ")", ";", "// If it's not an OBJECT (almost certainly UNDEFINED), then nothing more we can do", "if", "(", "superResult", ".", "getType", "(", ")", "!=", "ModelType", ".", "OBJECT", ")", "{", "return", "superResult", ";", "}", "// Resolve each field.", "// Don't mess with the original value", "ModelNode", "clone", "=", "superResult", "==", "value", "?", "value", ".", "clone", "(", ")", ":", "superResult", ";", "ModelNode", "result", "=", "new", "ModelNode", "(", ")", ";", "for", "(", "AttributeDefinition", "field", ":", "valueTypes", ")", "{", "String", "fieldName", "=", "field", ".", "getName", "(", ")", ";", "if", "(", "clone", ".", "has", "(", "fieldName", ")", ")", "{", "result", ".", "get", "(", "fieldName", ")", ".", "set", "(", "field", ".", "resolveValue", "(", "resolver", ",", "clone", ".", "get", "(", "fieldName", ")", ")", ")", ";", "}", "else", "{", "// Input doesn't have a child for this field.", "// Don't create one in the output unless the AD produces a default value.", "// TBH this doesn't make a ton of sense, since any object should have", "// all of its fields, just some may be undefined. But doing it this", "// way may avoid breaking some code that is incorrectly checking node.has(\"xxx\")", "// instead of node.hasDefined(\"xxx\")", "ModelNode", "val", "=", "field", ".", "resolveValue", "(", "resolver", ",", "new", "ModelNode", "(", ")", ")", ";", "if", "(", "val", ".", "isDefined", "(", ")", ")", "{", "result", ".", "get", "(", "fieldName", ")", ".", "set", "(", "val", ")", ";", "}", "}", "}", "// Validate the entire object", "getValidator", "(", ")", ".", "validateParameter", "(", "getName", "(", ")", ",", "result", ")", ";", "return", "result", ";", "}" ]
Overrides the superclass implementation to allow the AttributeDefinition for each field in the object to in turn resolve that field. {@inheritDoc}
[ "Overrides", "the", "superclass", "implementation", "to", "allow", "the", "AttributeDefinition", "for", "each", "field", "in", "the", "object", "to", "in", "turn", "resolve", "that", "field", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/ObjectTypeAttributeDefinition.java#L202-L238
159,047
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/remote/ResponseAttachmentInputStreamSupport.java
ResponseAttachmentInputStreamSupport.handleDomainOperationResponseStreams
public static void handleDomainOperationResponseStreams(final OperationContext context, final ModelNode responseNode, final List<OperationResponse.StreamEntry> streams) { if (responseNode.hasDefined(RESPONSE_HEADERS)) { ModelNode responseHeaders = responseNode.get(RESPONSE_HEADERS); // Strip out any stream header as the header created by this process is what counts responseHeaders.remove(ATTACHED_STREAMS); if (responseHeaders.asInt() == 0) { responseNode.remove(RESPONSE_HEADERS); } } for (OperationResponse.StreamEntry streamEntry : streams) { context.attachResultStream(streamEntry.getUUID(), streamEntry.getMimeType(), streamEntry.getStream()); } }
java
public static void handleDomainOperationResponseStreams(final OperationContext context, final ModelNode responseNode, final List<OperationResponse.StreamEntry> streams) { if (responseNode.hasDefined(RESPONSE_HEADERS)) { ModelNode responseHeaders = responseNode.get(RESPONSE_HEADERS); // Strip out any stream header as the header created by this process is what counts responseHeaders.remove(ATTACHED_STREAMS); if (responseHeaders.asInt() == 0) { responseNode.remove(RESPONSE_HEADERS); } } for (OperationResponse.StreamEntry streamEntry : streams) { context.attachResultStream(streamEntry.getUUID(), streamEntry.getMimeType(), streamEntry.getStream()); } }
[ "public", "static", "void", "handleDomainOperationResponseStreams", "(", "final", "OperationContext", "context", ",", "final", "ModelNode", "responseNode", ",", "final", "List", "<", "OperationResponse", ".", "StreamEntry", ">", "streams", ")", "{", "if", "(", "responseNode", ".", "hasDefined", "(", "RESPONSE_HEADERS", ")", ")", "{", "ModelNode", "responseHeaders", "=", "responseNode", ".", "get", "(", "RESPONSE_HEADERS", ")", ";", "// Strip out any stream header as the header created by this process is what counts", "responseHeaders", ".", "remove", "(", "ATTACHED_STREAMS", ")", ";", "if", "(", "responseHeaders", ".", "asInt", "(", ")", "==", "0", ")", "{", "responseNode", ".", "remove", "(", "RESPONSE_HEADERS", ")", ";", "}", "}", "for", "(", "OperationResponse", ".", "StreamEntry", "streamEntry", ":", "streams", ")", "{", "context", ".", "attachResultStream", "(", "streamEntry", ".", "getUUID", "(", ")", ",", "streamEntry", ".", "getMimeType", "(", ")", ",", "streamEntry", ".", "getStream", "(", ")", ")", ";", "}", "}" ]
Deal with streams attached to an operation response from a proxied domain process. @param context the context of the operation @param responseNode the DMR response from the proxied process @param streams the streams associated with the response
[ "Deal", "with", "streams", "attached", "to", "an", "operation", "response", "from", "a", "proxied", "domain", "process", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/remote/ResponseAttachmentInputStreamSupport.java#L75-L91
159,048
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/remote/ResponseAttachmentInputStreamSupport.java
ResponseAttachmentInputStreamSupport.shutdown
public final synchronized void shutdown() { // synchronize on 'this' to avoid races with registerStreams stopped = true; // If the cleanup task is running tell it to stop looping, and then remove it from the scheduled executor if (cleanupTaskFuture != null) { cleanupTaskFuture.cancel(false); } // Close remaining streams for (Map.Entry<InputStreamKey, TimedStreamEntry> entry : streamMap.entrySet()) { InputStreamKey key = entry.getKey(); TimedStreamEntry timedStreamEntry = entry.getValue(); //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (timedStreamEntry) { // ensure there's no race with a request that got a ref before we removed it closeStreamEntry(timedStreamEntry, key.requestId, key.index); } } }
java
public final synchronized void shutdown() { // synchronize on 'this' to avoid races with registerStreams stopped = true; // If the cleanup task is running tell it to stop looping, and then remove it from the scheduled executor if (cleanupTaskFuture != null) { cleanupTaskFuture.cancel(false); } // Close remaining streams for (Map.Entry<InputStreamKey, TimedStreamEntry> entry : streamMap.entrySet()) { InputStreamKey key = entry.getKey(); TimedStreamEntry timedStreamEntry = entry.getValue(); //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (timedStreamEntry) { // ensure there's no race with a request that got a ref before we removed it closeStreamEntry(timedStreamEntry, key.requestId, key.index); } } }
[ "public", "final", "synchronized", "void", "shutdown", "(", ")", "{", "// synchronize on 'this' to avoid races with registerStreams", "stopped", "=", "true", ";", "// If the cleanup task is running tell it to stop looping, and then remove it from the scheduled executor", "if", "(", "cleanupTaskFuture", "!=", "null", ")", "{", "cleanupTaskFuture", ".", "cancel", "(", "false", ")", ";", "}", "// Close remaining streams", "for", "(", "Map", ".", "Entry", "<", "InputStreamKey", ",", "TimedStreamEntry", ">", "entry", ":", "streamMap", ".", "entrySet", "(", ")", ")", "{", "InputStreamKey", "key", "=", "entry", ".", "getKey", "(", ")", ";", "TimedStreamEntry", "timedStreamEntry", "=", "entry", ".", "getValue", "(", ")", ";", "//noinspection SynchronizationOnLocalVariableOrMethodParameter", "synchronized", "(", "timedStreamEntry", ")", "{", "// ensure there's no race with a request that got a ref before we removed it", "closeStreamEntry", "(", "timedStreamEntry", ",", "key", ".", "requestId", ",", "key", ".", "index", ")", ";", "}", "}", "}" ]
Closes any registered stream entries that have not yet been consumed
[ "Closes", "any", "registered", "stream", "entries", "that", "have", "not", "yet", "been", "consumed" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/remote/ResponseAttachmentInputStreamSupport.java#L184-L200
159,049
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/remote/ResponseAttachmentInputStreamSupport.java
ResponseAttachmentInputStreamSupport.gc
void gc() { if (stopped) { return; } long expirationTime = System.currentTimeMillis() - timeout; for (Iterator<Map.Entry<InputStreamKey, TimedStreamEntry>> iter = streamMap.entrySet().iterator(); iter.hasNext();) { if (stopped) { return; } Map.Entry<InputStreamKey, TimedStreamEntry> entry = iter.next(); TimedStreamEntry timedStreamEntry = entry.getValue(); if (timedStreamEntry.timestamp.get() <= expirationTime) { iter.remove(); InputStreamKey key = entry.getKey(); //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (timedStreamEntry) { // ensure there's no race with a request that got a ref before we removed it closeStreamEntry(timedStreamEntry, key.requestId, key.index); } } } }
java
void gc() { if (stopped) { return; } long expirationTime = System.currentTimeMillis() - timeout; for (Iterator<Map.Entry<InputStreamKey, TimedStreamEntry>> iter = streamMap.entrySet().iterator(); iter.hasNext();) { if (stopped) { return; } Map.Entry<InputStreamKey, TimedStreamEntry> entry = iter.next(); TimedStreamEntry timedStreamEntry = entry.getValue(); if (timedStreamEntry.timestamp.get() <= expirationTime) { iter.remove(); InputStreamKey key = entry.getKey(); //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (timedStreamEntry) { // ensure there's no race with a request that got a ref before we removed it closeStreamEntry(timedStreamEntry, key.requestId, key.index); } } } }
[ "void", "gc", "(", ")", "{", "if", "(", "stopped", ")", "{", "return", ";", "}", "long", "expirationTime", "=", "System", ".", "currentTimeMillis", "(", ")", "-", "timeout", ";", "for", "(", "Iterator", "<", "Map", ".", "Entry", "<", "InputStreamKey", ",", "TimedStreamEntry", ">", ">", "iter", "=", "streamMap", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "if", "(", "stopped", ")", "{", "return", ";", "}", "Map", ".", "Entry", "<", "InputStreamKey", ",", "TimedStreamEntry", ">", "entry", "=", "iter", ".", "next", "(", ")", ";", "TimedStreamEntry", "timedStreamEntry", "=", "entry", ".", "getValue", "(", ")", ";", "if", "(", "timedStreamEntry", ".", "timestamp", ".", "get", "(", ")", "<=", "expirationTime", ")", "{", "iter", ".", "remove", "(", ")", ";", "InputStreamKey", "key", "=", "entry", ".", "getKey", "(", ")", ";", "//noinspection SynchronizationOnLocalVariableOrMethodParameter", "synchronized", "(", "timedStreamEntry", ")", "{", "// ensure there's no race with a request that got a ref before we removed it", "closeStreamEntry", "(", "timedStreamEntry", ",", "key", ".", "requestId", ",", "key", ".", "index", ")", ";", "}", "}", "}", "}" ]
Close and remove expired streams. Package protected to allow unit tests to invoke it.
[ "Close", "and", "remove", "expired", "streams", ".", "Package", "protected", "to", "allow", "unit", "tests", "to", "invoke", "it", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/remote/ResponseAttachmentInputStreamSupport.java#L203-L223
159,050
wildfly/wildfly-core
security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerSubsystemAdd.java
SecurityManagerSubsystemAdd.retrievePermissionSet
private List<PermissionFactory> retrievePermissionSet(final OperationContext context, final ModelNode node) throws OperationFailedException { final List<PermissionFactory> permissions = new ArrayList<>(); if (node != null && node.isDefined()) { for (ModelNode permissionNode : node.asList()) { String permissionClass = CLASS.resolveModelAttribute(context, permissionNode).asString(); String permissionName = null; if (permissionNode.hasDefined(PERMISSION_NAME)) permissionName = NAME.resolveModelAttribute(context, permissionNode).asString(); String permissionActions = null; if (permissionNode.hasDefined(PERMISSION_ACTIONS)) permissionActions = ACTIONS.resolveModelAttribute(context, permissionNode).asString(); String moduleName = null; if(permissionNode.hasDefined(PERMISSION_MODULE)) { moduleName = MODULE.resolveModelAttribute(context, permissionNode).asString(); } ClassLoader cl = WildFlySecurityManager.getClassLoaderPrivileged(this.getClass()); if(moduleName != null) { try { cl = Module.getBootModuleLoader().loadModule(ModuleIdentifier.fromString(moduleName)).getClassLoader(); } catch (ModuleLoadException e) { throw new OperationFailedException(e); } } permissions.add(new LoadedPermissionFactory(cl, permissionClass, permissionName, permissionActions)); } } return permissions; }
java
private List<PermissionFactory> retrievePermissionSet(final OperationContext context, final ModelNode node) throws OperationFailedException { final List<PermissionFactory> permissions = new ArrayList<>(); if (node != null && node.isDefined()) { for (ModelNode permissionNode : node.asList()) { String permissionClass = CLASS.resolveModelAttribute(context, permissionNode).asString(); String permissionName = null; if (permissionNode.hasDefined(PERMISSION_NAME)) permissionName = NAME.resolveModelAttribute(context, permissionNode).asString(); String permissionActions = null; if (permissionNode.hasDefined(PERMISSION_ACTIONS)) permissionActions = ACTIONS.resolveModelAttribute(context, permissionNode).asString(); String moduleName = null; if(permissionNode.hasDefined(PERMISSION_MODULE)) { moduleName = MODULE.resolveModelAttribute(context, permissionNode).asString(); } ClassLoader cl = WildFlySecurityManager.getClassLoaderPrivileged(this.getClass()); if(moduleName != null) { try { cl = Module.getBootModuleLoader().loadModule(ModuleIdentifier.fromString(moduleName)).getClassLoader(); } catch (ModuleLoadException e) { throw new OperationFailedException(e); } } permissions.add(new LoadedPermissionFactory(cl, permissionClass, permissionName, permissionActions)); } } return permissions; }
[ "private", "List", "<", "PermissionFactory", ">", "retrievePermissionSet", "(", "final", "OperationContext", "context", ",", "final", "ModelNode", "node", ")", "throws", "OperationFailedException", "{", "final", "List", "<", "PermissionFactory", ">", "permissions", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "node", "!=", "null", "&&", "node", ".", "isDefined", "(", ")", ")", "{", "for", "(", "ModelNode", "permissionNode", ":", "node", ".", "asList", "(", ")", ")", "{", "String", "permissionClass", "=", "CLASS", ".", "resolveModelAttribute", "(", "context", ",", "permissionNode", ")", ".", "asString", "(", ")", ";", "String", "permissionName", "=", "null", ";", "if", "(", "permissionNode", ".", "hasDefined", "(", "PERMISSION_NAME", ")", ")", "permissionName", "=", "NAME", ".", "resolveModelAttribute", "(", "context", ",", "permissionNode", ")", ".", "asString", "(", ")", ";", "String", "permissionActions", "=", "null", ";", "if", "(", "permissionNode", ".", "hasDefined", "(", "PERMISSION_ACTIONS", ")", ")", "permissionActions", "=", "ACTIONS", ".", "resolveModelAttribute", "(", "context", ",", "permissionNode", ")", ".", "asString", "(", ")", ";", "String", "moduleName", "=", "null", ";", "if", "(", "permissionNode", ".", "hasDefined", "(", "PERMISSION_MODULE", ")", ")", "{", "moduleName", "=", "MODULE", ".", "resolveModelAttribute", "(", "context", ",", "permissionNode", ")", ".", "asString", "(", ")", ";", "}", "ClassLoader", "cl", "=", "WildFlySecurityManager", ".", "getClassLoaderPrivileged", "(", "this", ".", "getClass", "(", ")", ")", ";", "if", "(", "moduleName", "!=", "null", ")", "{", "try", "{", "cl", "=", "Module", ".", "getBootModuleLoader", "(", ")", ".", "loadModule", "(", "ModuleIdentifier", ".", "fromString", "(", "moduleName", ")", ")", ".", "getClassLoader", "(", ")", ";", "}", "catch", "(", "ModuleLoadException", "e", ")", "{", "throw", "new", "OperationFailedException", "(", "e", ")", ";", "}", "}", "permissions", ".", "add", "(", "new", "LoadedPermissionFactory", "(", "cl", ",", "permissionClass", ",", "permissionName", ",", "permissionActions", ")", ")", ";", "}", "}", "return", "permissions", ";", "}" ]
This method retrieves all security permissions contained within the specified node. @param context the {@link OperationContext} used to resolve the permission attributes. @param node the {@link ModelNode} that might contain security permissions metadata. @return a {@link List} containing the retrieved permissions. They are wrapped as {@link PermissionFactory} instances. @throws OperationFailedException if an error occurs while retrieving the security permissions.
[ "This", "method", "retrieves", "all", "security", "permissions", "contained", "within", "the", "specified", "node", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerSubsystemAdd.java#L128-L159
159,051
wildfly/wildfly-core
deployment-scanner/src/main/java/org/jboss/as/server/deployment/scanner/DeploymentScannerService.java
DeploymentScannerService.addService
public static ServiceController<DeploymentScanner> addService(final OperationContext context, final PathAddress resourceAddress, final String relativeTo, final String path, final int scanInterval, TimeUnit unit, final boolean autoDeployZip, final boolean autoDeployExploded, final boolean autoDeployXml, final boolean scanEnabled, final long deploymentTimeout, boolean rollbackOnRuntimeFailure, final FileSystemDeploymentService bootTimeService, final ScheduledExecutorService scheduledExecutorService) { final DeploymentScannerService service = new DeploymentScannerService(resourceAddress, relativeTo, path, scanInterval, unit, autoDeployZip, autoDeployExploded, autoDeployXml, scanEnabled, deploymentTimeout, rollbackOnRuntimeFailure, bootTimeService); final ServiceName serviceName = getServiceName(resourceAddress.getLastElement().getValue()); service.scheduledExecutorValue.inject(scheduledExecutorService); final ServiceBuilder<DeploymentScanner> sb = context.getServiceTarget().addService(serviceName, service); sb.addDependency(context.getCapabilityServiceName(PATH_MANAGER_CAPABILITY, PathManager.class), PathManager.class, service.pathManagerValue); sb.addDependency(context.getCapabilityServiceName("org.wildfly.management.notification-handler-registry", null), NotificationHandlerRegistry.class, service.notificationRegistryValue); sb.addDependency(context.getCapabilityServiceName("org.wildfly.management.model-controller-client-factory", null), ModelControllerClientFactory.class, service.clientFactoryValue); sb.requires(org.jboss.as.server.deployment.Services.JBOSS_DEPLOYMENT_CHAINS); sb.addDependency(ControlledProcessStateService.SERVICE_NAME, ControlledProcessStateService.class, service.controlledProcessStateServiceValue); return sb.install(); }
java
public static ServiceController<DeploymentScanner> addService(final OperationContext context, final PathAddress resourceAddress, final String relativeTo, final String path, final int scanInterval, TimeUnit unit, final boolean autoDeployZip, final boolean autoDeployExploded, final boolean autoDeployXml, final boolean scanEnabled, final long deploymentTimeout, boolean rollbackOnRuntimeFailure, final FileSystemDeploymentService bootTimeService, final ScheduledExecutorService scheduledExecutorService) { final DeploymentScannerService service = new DeploymentScannerService(resourceAddress, relativeTo, path, scanInterval, unit, autoDeployZip, autoDeployExploded, autoDeployXml, scanEnabled, deploymentTimeout, rollbackOnRuntimeFailure, bootTimeService); final ServiceName serviceName = getServiceName(resourceAddress.getLastElement().getValue()); service.scheduledExecutorValue.inject(scheduledExecutorService); final ServiceBuilder<DeploymentScanner> sb = context.getServiceTarget().addService(serviceName, service); sb.addDependency(context.getCapabilityServiceName(PATH_MANAGER_CAPABILITY, PathManager.class), PathManager.class, service.pathManagerValue); sb.addDependency(context.getCapabilityServiceName("org.wildfly.management.notification-handler-registry", null), NotificationHandlerRegistry.class, service.notificationRegistryValue); sb.addDependency(context.getCapabilityServiceName("org.wildfly.management.model-controller-client-factory", null), ModelControllerClientFactory.class, service.clientFactoryValue); sb.requires(org.jboss.as.server.deployment.Services.JBOSS_DEPLOYMENT_CHAINS); sb.addDependency(ControlledProcessStateService.SERVICE_NAME, ControlledProcessStateService.class, service.controlledProcessStateServiceValue); return sb.install(); }
[ "public", "static", "ServiceController", "<", "DeploymentScanner", ">", "addService", "(", "final", "OperationContext", "context", ",", "final", "PathAddress", "resourceAddress", ",", "final", "String", "relativeTo", ",", "final", "String", "path", ",", "final", "int", "scanInterval", ",", "TimeUnit", "unit", ",", "final", "boolean", "autoDeployZip", ",", "final", "boolean", "autoDeployExploded", ",", "final", "boolean", "autoDeployXml", ",", "final", "boolean", "scanEnabled", ",", "final", "long", "deploymentTimeout", ",", "boolean", "rollbackOnRuntimeFailure", ",", "final", "FileSystemDeploymentService", "bootTimeService", ",", "final", "ScheduledExecutorService", "scheduledExecutorService", ")", "{", "final", "DeploymentScannerService", "service", "=", "new", "DeploymentScannerService", "(", "resourceAddress", ",", "relativeTo", ",", "path", ",", "scanInterval", ",", "unit", ",", "autoDeployZip", ",", "autoDeployExploded", ",", "autoDeployXml", ",", "scanEnabled", ",", "deploymentTimeout", ",", "rollbackOnRuntimeFailure", ",", "bootTimeService", ")", ";", "final", "ServiceName", "serviceName", "=", "getServiceName", "(", "resourceAddress", ".", "getLastElement", "(", ")", ".", "getValue", "(", ")", ")", ";", "service", ".", "scheduledExecutorValue", ".", "inject", "(", "scheduledExecutorService", ")", ";", "final", "ServiceBuilder", "<", "DeploymentScanner", ">", "sb", "=", "context", ".", "getServiceTarget", "(", ")", ".", "addService", "(", "serviceName", ",", "service", ")", ";", "sb", ".", "addDependency", "(", "context", ".", "getCapabilityServiceName", "(", "PATH_MANAGER_CAPABILITY", ",", "PathManager", ".", "class", ")", ",", "PathManager", ".", "class", ",", "service", ".", "pathManagerValue", ")", ";", "sb", ".", "addDependency", "(", "context", ".", "getCapabilityServiceName", "(", "\"org.wildfly.management.notification-handler-registry\"", ",", "null", ")", ",", "NotificationHandlerRegistry", ".", "class", ",", "service", ".", "notificationRegistryValue", ")", ";", "sb", ".", "addDependency", "(", "context", ".", "getCapabilityServiceName", "(", "\"org.wildfly.management.model-controller-client-factory\"", ",", "null", ")", ",", "ModelControllerClientFactory", ".", "class", ",", "service", ".", "clientFactoryValue", ")", ";", "sb", ".", "requires", "(", "org", ".", "jboss", ".", "as", ".", "server", ".", "deployment", ".", "Services", ".", "JBOSS_DEPLOYMENT_CHAINS", ")", ";", "sb", ".", "addDependency", "(", "ControlledProcessStateService", ".", "SERVICE_NAME", ",", "ControlledProcessStateService", ".", "class", ",", "service", ".", "controlledProcessStateServiceValue", ")", ";", "return", "sb", ".", "install", "(", ")", ";", "}" ]
Add the deployment scanner service to a batch. @param context context for the operation that is adding this service @param resourceAddress the address of the resource that manages the service @param relativeTo the relative to @param path the path @param scanInterval the scan interval @param unit the unit of {@code scanInterval} @param autoDeployZip whether zipped content should be auto-deployed @param autoDeployExploded whether exploded content should be auto-deployed @param autoDeployXml whether xml content should be auto-deployed @param scanEnabled scan enabled @param deploymentTimeout the deployment timeout @param rollbackOnRuntimeFailure rollback on runtime failures @param bootTimeService the deployment scanner used in the boot time scan @param scheduledExecutorService executor to use for asynchronous tasks @return the controller for the deployment scanner service
[ "Add", "the", "deployment", "scanner", "service", "to", "a", "batch", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/deployment-scanner/src/main/java/org/jboss/as/server/deployment/scanner/DeploymentScannerService.java#L129-L146
159,052
wildfly/wildfly-core
cli/src/main/java/org/jboss/as/cli/gui/ManagementModel.java
ManagementModel.findNode
public ManagementModelNode findNode(String address) { ManagementModelNode root = (ManagementModelNode)tree.getModel().getRoot(); Enumeration<javax.swing.tree.TreeNode> allNodes = root.depthFirstEnumeration(); while (allNodes.hasMoreElements()) { ManagementModelNode node = (ManagementModelNode)allNodes.nextElement(); if (node.addressPath().equals(address)) return node; } return null; }
java
public ManagementModelNode findNode(String address) { ManagementModelNode root = (ManagementModelNode)tree.getModel().getRoot(); Enumeration<javax.swing.tree.TreeNode> allNodes = root.depthFirstEnumeration(); while (allNodes.hasMoreElements()) { ManagementModelNode node = (ManagementModelNode)allNodes.nextElement(); if (node.addressPath().equals(address)) return node; } return null; }
[ "public", "ManagementModelNode", "findNode", "(", "String", "address", ")", "{", "ManagementModelNode", "root", "=", "(", "ManagementModelNode", ")", "tree", ".", "getModel", "(", ")", ".", "getRoot", "(", ")", ";", "Enumeration", "<", "javax", ".", "swing", ".", "tree", ".", "TreeNode", ">", "allNodes", "=", "root", ".", "depthFirstEnumeration", "(", ")", ";", "while", "(", "allNodes", ".", "hasMoreElements", "(", ")", ")", "{", "ManagementModelNode", "node", "=", "(", "ManagementModelNode", ")", "allNodes", ".", "nextElement", "(", ")", ";", "if", "(", "node", ".", "addressPath", "(", ")", ".", "equals", "(", "address", ")", ")", "return", "node", ";", "}", "return", "null", ";", "}" ]
Find a node in the tree. The node must be "visible" to be found. @param address The full address of the node matching ManagementModelNode.addressPath() @return The node, or null if not found.
[ "Find", "a", "node", "in", "the", "tree", ".", "The", "node", "must", "be", "visible", "to", "be", "found", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/gui/ManagementModel.java#L83-L92
159,053
wildfly/wildfly-core
cli/src/main/java/org/jboss/as/cli/gui/ManagementModel.java
ManagementModel.getSelectedNode
public ManagementModelNode getSelectedNode() { if (tree.getSelectionPath() == null) return null; return (ManagementModelNode)tree.getSelectionPath().getLastPathComponent(); }
java
public ManagementModelNode getSelectedNode() { if (tree.getSelectionPath() == null) return null; return (ManagementModelNode)tree.getSelectionPath().getLastPathComponent(); }
[ "public", "ManagementModelNode", "getSelectedNode", "(", ")", "{", "if", "(", "tree", ".", "getSelectionPath", "(", ")", "==", "null", ")", "return", "null", ";", "return", "(", "ManagementModelNode", ")", "tree", ".", "getSelectionPath", "(", ")", ".", "getLastPathComponent", "(", ")", ";", "}" ]
Get the node that has been selected by the user, or null if nothing is selected. @return The node or <code>null</code>
[ "Get", "the", "node", "that", "has", "been", "selected", "by", "the", "user", "or", "null", "if", "nothing", "is", "selected", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/gui/ManagementModel.java#L134-L137
159,054
wildfly/wildfly-core
protocol/src/main/java/org/jboss/as/protocol/ProtocolConnectionUtils.java
ProtocolConnectionUtils.connectSync
public static Connection connectSync(final ProtocolConnectionConfiguration configuration) throws IOException { long timeoutMillis = configuration.getConnectionTimeout(); CallbackHandler handler = configuration.getCallbackHandler(); final CallbackHandler actualHandler; ProtocolTimeoutHandler timeoutHandler = configuration.getTimeoutHandler(); // Note: If a client supplies a ProtocolTimeoutHandler it is taking on full responsibility for timeout management. if (timeoutHandler == null) { GeneralTimeoutHandler defaultTimeoutHandler = new GeneralTimeoutHandler(); // No point wrapping our AnonymousCallbackHandler. actualHandler = handler != null ? new WrapperCallbackHandler(defaultTimeoutHandler, handler) : null; timeoutHandler = defaultTimeoutHandler; } else { actualHandler = handler; } final IoFuture<Connection> future = connect(actualHandler, configuration); IoFuture.Status status = timeoutHandler.await(future, timeoutMillis); if (status == IoFuture.Status.DONE) { return future.get(); } if (status == IoFuture.Status.FAILED) { throw ProtocolLogger.ROOT_LOGGER.failedToConnect(configuration.getUri(), future.getException()); } throw ProtocolLogger.ROOT_LOGGER.couldNotConnect(configuration.getUri()); }
java
public static Connection connectSync(final ProtocolConnectionConfiguration configuration) throws IOException { long timeoutMillis = configuration.getConnectionTimeout(); CallbackHandler handler = configuration.getCallbackHandler(); final CallbackHandler actualHandler; ProtocolTimeoutHandler timeoutHandler = configuration.getTimeoutHandler(); // Note: If a client supplies a ProtocolTimeoutHandler it is taking on full responsibility for timeout management. if (timeoutHandler == null) { GeneralTimeoutHandler defaultTimeoutHandler = new GeneralTimeoutHandler(); // No point wrapping our AnonymousCallbackHandler. actualHandler = handler != null ? new WrapperCallbackHandler(defaultTimeoutHandler, handler) : null; timeoutHandler = defaultTimeoutHandler; } else { actualHandler = handler; } final IoFuture<Connection> future = connect(actualHandler, configuration); IoFuture.Status status = timeoutHandler.await(future, timeoutMillis); if (status == IoFuture.Status.DONE) { return future.get(); } if (status == IoFuture.Status.FAILED) { throw ProtocolLogger.ROOT_LOGGER.failedToConnect(configuration.getUri(), future.getException()); } throw ProtocolLogger.ROOT_LOGGER.couldNotConnect(configuration.getUri()); }
[ "public", "static", "Connection", "connectSync", "(", "final", "ProtocolConnectionConfiguration", "configuration", ")", "throws", "IOException", "{", "long", "timeoutMillis", "=", "configuration", ".", "getConnectionTimeout", "(", ")", ";", "CallbackHandler", "handler", "=", "configuration", ".", "getCallbackHandler", "(", ")", ";", "final", "CallbackHandler", "actualHandler", ";", "ProtocolTimeoutHandler", "timeoutHandler", "=", "configuration", ".", "getTimeoutHandler", "(", ")", ";", "// Note: If a client supplies a ProtocolTimeoutHandler it is taking on full responsibility for timeout management.", "if", "(", "timeoutHandler", "==", "null", ")", "{", "GeneralTimeoutHandler", "defaultTimeoutHandler", "=", "new", "GeneralTimeoutHandler", "(", ")", ";", "// No point wrapping our AnonymousCallbackHandler.", "actualHandler", "=", "handler", "!=", "null", "?", "new", "WrapperCallbackHandler", "(", "defaultTimeoutHandler", ",", "handler", ")", ":", "null", ";", "timeoutHandler", "=", "defaultTimeoutHandler", ";", "}", "else", "{", "actualHandler", "=", "handler", ";", "}", "final", "IoFuture", "<", "Connection", ">", "future", "=", "connect", "(", "actualHandler", ",", "configuration", ")", ";", "IoFuture", ".", "Status", "status", "=", "timeoutHandler", ".", "await", "(", "future", ",", "timeoutMillis", ")", ";", "if", "(", "status", "==", "IoFuture", ".", "Status", ".", "DONE", ")", "{", "return", "future", ".", "get", "(", ")", ";", "}", "if", "(", "status", "==", "IoFuture", ".", "Status", ".", "FAILED", ")", "{", "throw", "ProtocolLogger", ".", "ROOT_LOGGER", ".", "failedToConnect", "(", "configuration", ".", "getUri", "(", ")", ",", "future", ".", "getException", "(", ")", ")", ";", "}", "throw", "ProtocolLogger", ".", "ROOT_LOGGER", ".", "couldNotConnect", "(", "configuration", ".", "getUri", "(", ")", ")", ";", "}" ]
Connect sync. @param configuration the protocol configuration @return the connection @throws IOException
[ "Connect", "sync", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/ProtocolConnectionUtils.java#L105-L131
159,055
wildfly/wildfly-core
cli/src/main/java/org/jboss/as/cli/impl/ReadlineConsole.java
CLITerminalConnection.openBlockingInterruptable
public void openBlockingInterruptable() throws InterruptedException { // We need to thread this call in order to interrupt it (when Ctrl-C occurs). connectionThread = new Thread(() -> { // This thread can't be interrupted from another thread. // Will stay alive until System.exit is called. Thread thr = new Thread(() -> super.openBlocking(), "CLI Terminal Connection (uninterruptable)"); thr.start(); try { thr.join(); } catch (InterruptedException ex) { // XXX OK, interrupted, just leaving. } }, "CLI Terminal Connection (interruptable)"); connectionThread.start(); connectionThread.join(); }
java
public void openBlockingInterruptable() throws InterruptedException { // We need to thread this call in order to interrupt it (when Ctrl-C occurs). connectionThread = new Thread(() -> { // This thread can't be interrupted from another thread. // Will stay alive until System.exit is called. Thread thr = new Thread(() -> super.openBlocking(), "CLI Terminal Connection (uninterruptable)"); thr.start(); try { thr.join(); } catch (InterruptedException ex) { // XXX OK, interrupted, just leaving. } }, "CLI Terminal Connection (interruptable)"); connectionThread.start(); connectionThread.join(); }
[ "public", "void", "openBlockingInterruptable", "(", ")", "throws", "InterruptedException", "{", "// We need to thread this call in order to interrupt it (when Ctrl-C occurs).", "connectionThread", "=", "new", "Thread", "(", "(", ")", "->", "{", "// This thread can't be interrupted from another thread.", "// Will stay alive until System.exit is called.", "Thread", "thr", "=", "new", "Thread", "(", "(", ")", "->", "super", ".", "openBlocking", "(", ")", ",", "\"CLI Terminal Connection (uninterruptable)\"", ")", ";", "thr", ".", "start", "(", ")", ";", "try", "{", "thr", ".", "join", "(", ")", ";", "}", "catch", "(", "InterruptedException", "ex", ")", "{", "// XXX OK, interrupted, just leaving.", "}", "}", ",", "\"CLI Terminal Connection (interruptable)\"", ")", ";", "connectionThread", ".", "start", "(", ")", ";", "connectionThread", ".", "join", "(", ")", ";", "}" ]
Required to close the connection reading on the terminal, otherwise it can't be interrupted. @throws InterruptedException
[ "Required", "to", "close", "the", "connection", "reading", "on", "the", "terminal", "otherwise", "it", "can", "t", "be", "interrupted", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/impl/ReadlineConsole.java#L186-L203
159,056
wildfly/wildfly-core
protocol/src/main/java/org/jboss/as/protocol/mgmt/ManagementProtocolHeader.java
ManagementProtocolHeader.validateSignature
protected static void validateSignature(final DataInput input) throws IOException { final byte[] signatureBytes = new byte[4]; input.readFully(signatureBytes); if (!Arrays.equals(ManagementProtocol.SIGNATURE, signatureBytes)) { throw ProtocolLogger.ROOT_LOGGER.invalidSignature(Arrays.toString(signatureBytes)); } }
java
protected static void validateSignature(final DataInput input) throws IOException { final byte[] signatureBytes = new byte[4]; input.readFully(signatureBytes); if (!Arrays.equals(ManagementProtocol.SIGNATURE, signatureBytes)) { throw ProtocolLogger.ROOT_LOGGER.invalidSignature(Arrays.toString(signatureBytes)); } }
[ "protected", "static", "void", "validateSignature", "(", "final", "DataInput", "input", ")", "throws", "IOException", "{", "final", "byte", "[", "]", "signatureBytes", "=", "new", "byte", "[", "4", "]", ";", "input", ".", "readFully", "(", "signatureBytes", ")", ";", "if", "(", "!", "Arrays", ".", "equals", "(", "ManagementProtocol", ".", "SIGNATURE", ",", "signatureBytes", ")", ")", "{", "throw", "ProtocolLogger", ".", "ROOT_LOGGER", ".", "invalidSignature", "(", "Arrays", ".", "toString", "(", "signatureBytes", ")", ")", ";", "}", "}" ]
Validate the header signature. @param input The input to read the signature from @throws IOException If any read problems occur
[ "Validate", "the", "header", "signature", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/ManagementProtocolHeader.java#L90-L96
159,057
wildfly/wildfly-core
protocol/src/main/java/org/jboss/as/protocol/mgmt/ManagementProtocolHeader.java
ManagementProtocolHeader.parse
public static ManagementProtocolHeader parse(DataInput input) throws IOException { validateSignature(input); expectHeader(input, ManagementProtocol.VERSION_FIELD); int version = input.readInt(); expectHeader(input, ManagementProtocol.TYPE); byte type = input.readByte(); switch (type) { case ManagementProtocol.TYPE_REQUEST: return new ManagementRequestHeader(version, input); case ManagementProtocol.TYPE_RESPONSE: return new ManagementResponseHeader(version, input); case ManagementProtocol.TYPE_BYE_BYE: return new ManagementByeByeHeader(version); case ManagementProtocol.TYPE_PING: return new ManagementPingHeader(version); case ManagementProtocol.TYPE_PONG: return new ManagementPongHeader(version); default: throw ProtocolLogger.ROOT_LOGGER.invalidType("0x" + Integer.toHexString(type)); } }
java
public static ManagementProtocolHeader parse(DataInput input) throws IOException { validateSignature(input); expectHeader(input, ManagementProtocol.VERSION_FIELD); int version = input.readInt(); expectHeader(input, ManagementProtocol.TYPE); byte type = input.readByte(); switch (type) { case ManagementProtocol.TYPE_REQUEST: return new ManagementRequestHeader(version, input); case ManagementProtocol.TYPE_RESPONSE: return new ManagementResponseHeader(version, input); case ManagementProtocol.TYPE_BYE_BYE: return new ManagementByeByeHeader(version); case ManagementProtocol.TYPE_PING: return new ManagementPingHeader(version); case ManagementProtocol.TYPE_PONG: return new ManagementPongHeader(version); default: throw ProtocolLogger.ROOT_LOGGER.invalidType("0x" + Integer.toHexString(type)); } }
[ "public", "static", "ManagementProtocolHeader", "parse", "(", "DataInput", "input", ")", "throws", "IOException", "{", "validateSignature", "(", "input", ")", ";", "expectHeader", "(", "input", ",", "ManagementProtocol", ".", "VERSION_FIELD", ")", ";", "int", "version", "=", "input", ".", "readInt", "(", ")", ";", "expectHeader", "(", "input", ",", "ManagementProtocol", ".", "TYPE", ")", ";", "byte", "type", "=", "input", ".", "readByte", "(", ")", ";", "switch", "(", "type", ")", "{", "case", "ManagementProtocol", ".", "TYPE_REQUEST", ":", "return", "new", "ManagementRequestHeader", "(", "version", ",", "input", ")", ";", "case", "ManagementProtocol", ".", "TYPE_RESPONSE", ":", "return", "new", "ManagementResponseHeader", "(", "version", ",", "input", ")", ";", "case", "ManagementProtocol", ".", "TYPE_BYE_BYE", ":", "return", "new", "ManagementByeByeHeader", "(", "version", ")", ";", "case", "ManagementProtocol", ".", "TYPE_PING", ":", "return", "new", "ManagementPingHeader", "(", "version", ")", ";", "case", "ManagementProtocol", ".", "TYPE_PONG", ":", "return", "new", "ManagementPongHeader", "(", "version", ")", ";", "default", ":", "throw", "ProtocolLogger", ".", "ROOT_LOGGER", ".", "invalidType", "(", "\"0x\"", "+", "Integer", ".", "toHexString", "(", "type", ")", ")", ";", "}", "}" ]
Parses the input stream to read the header @param input data input to read from @return the parsed protocol header @throws IOException
[ "Parses", "the", "input", "stream", "to", "read", "the", "header" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/ManagementProtocolHeader.java#L109-L129
159,058
wildfly/wildfly-core
domain-management/src/main/java/org/jboss/as/domain/management/security/password/simple/SimplePasswordStrengthChecker.java
SimplePasswordStrengthChecker.checkConsecutiveAlpha
protected void checkConsecutiveAlpha() { Pattern symbolsPatter = Pattern.compile(REGEX_ALPHA_UC + "+"); Matcher matcher = symbolsPatter.matcher(this.password); int met = 0; while (matcher.find()) { int start = matcher.start(); int end = matcher.end(); if (start == end) { continue; } int diff = end - start; if (diff >= 3) { met += diff; } } this.result.negative(met * CONSECUTIVE_ALPHA_WEIGHT); // alpha lower case symbolsPatter = Pattern.compile(REGEX_ALPHA_LC + "+"); matcher = symbolsPatter.matcher(this.password); met = 0; while (matcher.find()) { int start = matcher.start(); int end = matcher.end(); if (start == end) { continue; } int diff = end - start; if (diff >= 3) { met += diff; } } this.result.negative(met * CONSECUTIVE_ALPHA_WEIGHT); }
java
protected void checkConsecutiveAlpha() { Pattern symbolsPatter = Pattern.compile(REGEX_ALPHA_UC + "+"); Matcher matcher = symbolsPatter.matcher(this.password); int met = 0; while (matcher.find()) { int start = matcher.start(); int end = matcher.end(); if (start == end) { continue; } int diff = end - start; if (diff >= 3) { met += diff; } } this.result.negative(met * CONSECUTIVE_ALPHA_WEIGHT); // alpha lower case symbolsPatter = Pattern.compile(REGEX_ALPHA_LC + "+"); matcher = symbolsPatter.matcher(this.password); met = 0; while (matcher.find()) { int start = matcher.start(); int end = matcher.end(); if (start == end) { continue; } int diff = end - start; if (diff >= 3) { met += diff; } } this.result.negative(met * CONSECUTIVE_ALPHA_WEIGHT); }
[ "protected", "void", "checkConsecutiveAlpha", "(", ")", "{", "Pattern", "symbolsPatter", "=", "Pattern", ".", "compile", "(", "REGEX_ALPHA_UC", "+", "\"+\"", ")", ";", "Matcher", "matcher", "=", "symbolsPatter", ".", "matcher", "(", "this", ".", "password", ")", ";", "int", "met", "=", "0", ";", "while", "(", "matcher", ".", "find", "(", ")", ")", "{", "int", "start", "=", "matcher", ".", "start", "(", ")", ";", "int", "end", "=", "matcher", ".", "end", "(", ")", ";", "if", "(", "start", "==", "end", ")", "{", "continue", ";", "}", "int", "diff", "=", "end", "-", "start", ";", "if", "(", "diff", ">=", "3", ")", "{", "met", "+=", "diff", ";", "}", "}", "this", ".", "result", ".", "negative", "(", "met", "*", "CONSECUTIVE_ALPHA_WEIGHT", ")", ";", "// alpha lower case", "symbolsPatter", "=", "Pattern", ".", "compile", "(", "REGEX_ALPHA_LC", "+", "\"+\"", ")", ";", "matcher", "=", "symbolsPatter", ".", "matcher", "(", "this", ".", "password", ")", ";", "met", "=", "0", ";", "while", "(", "matcher", ".", "find", "(", ")", ")", "{", "int", "start", "=", "matcher", ".", "start", "(", ")", ";", "int", "end", "=", "matcher", ".", "end", "(", ")", ";", "if", "(", "start", "==", "end", ")", "{", "continue", ";", "}", "int", "diff", "=", "end", "-", "start", ";", "if", "(", "diff", ">=", "3", ")", "{", "met", "+=", "diff", ";", "}", "}", "this", ".", "result", ".", "negative", "(", "met", "*", "CONSECUTIVE_ALPHA_WEIGHT", ")", ";", "}" ]
those could be incorporated with above, but that would blurry everything.
[ "those", "could", "be", "incorporated", "with", "above", "but", "that", "would", "blurry", "everything", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/domain-management/src/main/java/org/jboss/as/domain/management/security/password/simple/SimplePasswordStrengthChecker.java#L289-L328
159,059
wildfly/wildfly-core
host-controller/src/main/java/org/jboss/as/host/controller/ManagedServerOperationsFactory.java
ManagedServerOperationsFactory.createBootUpdates
public static ModelNode createBootUpdates(final String serverName, final ModelNode domainModel, final ModelNode hostModel, final DomainController domainController, final ExpressionResolver expressionResolver) { final ManagedServerOperationsFactory factory = new ManagedServerOperationsFactory(serverName, domainModel, hostModel, domainController, expressionResolver); return factory.getBootUpdates(); }
java
public static ModelNode createBootUpdates(final String serverName, final ModelNode domainModel, final ModelNode hostModel, final DomainController domainController, final ExpressionResolver expressionResolver) { final ManagedServerOperationsFactory factory = new ManagedServerOperationsFactory(serverName, domainModel, hostModel, domainController, expressionResolver); return factory.getBootUpdates(); }
[ "public", "static", "ModelNode", "createBootUpdates", "(", "final", "String", "serverName", ",", "final", "ModelNode", "domainModel", ",", "final", "ModelNode", "hostModel", ",", "final", "DomainController", "domainController", ",", "final", "ExpressionResolver", "expressionResolver", ")", "{", "final", "ManagedServerOperationsFactory", "factory", "=", "new", "ManagedServerOperationsFactory", "(", "serverName", ",", "domainModel", ",", "hostModel", ",", "domainController", ",", "expressionResolver", ")", ";", "return", "factory", ".", "getBootUpdates", "(", ")", ";", "}" ]
Create a list of operations required to a boot a managed server. @param serverName the server name @param domainModel the complete domain model @param hostModel the local host model @param domainController the domain controller @return the list of boot operations
[ "Create", "a", "list", "of", "operations", "required", "to", "a", "boot", "a", "managed", "server", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServerOperationsFactory.java#L180-L187
159,060
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/HostServerGroupTracker.java
HostServerGroupTracker.getMappableDomainEffect
private synchronized HostServerGroupEffect getMappableDomainEffect(PathAddress address, String key, Map<String, Set<String>> map, Resource root) { if (requiresMapping) { map(root); requiresMapping = false; } Set<String> mapped = map.get(key); return mapped != null ? HostServerGroupEffect.forDomain(address, mapped) : HostServerGroupEffect.forUnassignedDomain(address); }
java
private synchronized HostServerGroupEffect getMappableDomainEffect(PathAddress address, String key, Map<String, Set<String>> map, Resource root) { if (requiresMapping) { map(root); requiresMapping = false; } Set<String> mapped = map.get(key); return mapped != null ? HostServerGroupEffect.forDomain(address, mapped) : HostServerGroupEffect.forUnassignedDomain(address); }
[ "private", "synchronized", "HostServerGroupEffect", "getMappableDomainEffect", "(", "PathAddress", "address", ",", "String", "key", ",", "Map", "<", "String", ",", "Set", "<", "String", ">", ">", "map", ",", "Resource", "root", ")", "{", "if", "(", "requiresMapping", ")", "{", "map", "(", "root", ")", ";", "requiresMapping", "=", "false", ";", "}", "Set", "<", "String", ">", "mapped", "=", "map", ".", "get", "(", "key", ")", ";", "return", "mapped", "!=", "null", "?", "HostServerGroupEffect", ".", "forDomain", "(", "address", ",", "mapped", ")", ":", "HostServerGroupEffect", ".", "forUnassignedDomain", "(", "address", ")", ";", "}" ]
Creates an appropriate HSGE for a domain-wide resource of a type that is mappable to server groups
[ "Creates", "an", "appropriate", "HSGE", "for", "a", "domain", "-", "wide", "resource", "of", "a", "type", "that", "is", "mappable", "to", "server", "groups" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/HostServerGroupTracker.java#L302-L311
159,061
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/HostServerGroupTracker.java
HostServerGroupTracker.getHostEffect
private synchronized HostServerGroupEffect getHostEffect(PathAddress address, String host, Resource root) { if (requiresMapping) { map(root); requiresMapping = false; } Set<String> mapped = hostsToGroups.get(host); if (mapped == null) { // Unassigned host. Treat like an unassigned profile or socket-binding-group; // i.e. available to all server group scoped roles. // Except -- WFLY-2085 -- the master HC is not open to all s-g-s-rs Resource hostResource = root.getChild(PathElement.pathElement(HOST, host)); if (hostResource != null) { ModelNode dcModel = hostResource.getModel().get(DOMAIN_CONTROLLER); if (!dcModel.hasDefined(REMOTE)) { mapped = Collections.emptySet(); // prevents returning HostServerGroupEffect.forUnassignedHost(address, host) } } } return mapped == null ? HostServerGroupEffect.forUnassignedHost(address, host) : HostServerGroupEffect.forMappedHost(address, mapped, host); }
java
private synchronized HostServerGroupEffect getHostEffect(PathAddress address, String host, Resource root) { if (requiresMapping) { map(root); requiresMapping = false; } Set<String> mapped = hostsToGroups.get(host); if (mapped == null) { // Unassigned host. Treat like an unassigned profile or socket-binding-group; // i.e. available to all server group scoped roles. // Except -- WFLY-2085 -- the master HC is not open to all s-g-s-rs Resource hostResource = root.getChild(PathElement.pathElement(HOST, host)); if (hostResource != null) { ModelNode dcModel = hostResource.getModel().get(DOMAIN_CONTROLLER); if (!dcModel.hasDefined(REMOTE)) { mapped = Collections.emptySet(); // prevents returning HostServerGroupEffect.forUnassignedHost(address, host) } } } return mapped == null ? HostServerGroupEffect.forUnassignedHost(address, host) : HostServerGroupEffect.forMappedHost(address, mapped, host); }
[ "private", "synchronized", "HostServerGroupEffect", "getHostEffect", "(", "PathAddress", "address", ",", "String", "host", ",", "Resource", "root", ")", "{", "if", "(", "requiresMapping", ")", "{", "map", "(", "root", ")", ";", "requiresMapping", "=", "false", ";", "}", "Set", "<", "String", ">", "mapped", "=", "hostsToGroups", ".", "get", "(", "host", ")", ";", "if", "(", "mapped", "==", "null", ")", "{", "// Unassigned host. Treat like an unassigned profile or socket-binding-group;", "// i.e. available to all server group scoped roles.", "// Except -- WFLY-2085 -- the master HC is not open to all s-g-s-rs", "Resource", "hostResource", "=", "root", ".", "getChild", "(", "PathElement", ".", "pathElement", "(", "HOST", ",", "host", ")", ")", ";", "if", "(", "hostResource", "!=", "null", ")", "{", "ModelNode", "dcModel", "=", "hostResource", ".", "getModel", "(", ")", ".", "get", "(", "DOMAIN_CONTROLLER", ")", ";", "if", "(", "!", "dcModel", ".", "hasDefined", "(", "REMOTE", ")", ")", "{", "mapped", "=", "Collections", ".", "emptySet", "(", ")", ";", "// prevents returning HostServerGroupEffect.forUnassignedHost(address, host)", "}", "}", "}", "return", "mapped", "==", "null", "?", "HostServerGroupEffect", ".", "forUnassignedHost", "(", "address", ",", "host", ")", ":", "HostServerGroupEffect", ".", "forMappedHost", "(", "address", ",", "mapped", ",", "host", ")", ";", "}" ]
Creates an appropriate HSGE for resources in the host tree, excluding the server and server-config subtrees
[ "Creates", "an", "appropriate", "HSGE", "for", "resources", "in", "the", "host", "tree", "excluding", "the", "server", "and", "server", "-", "config", "subtrees" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/HostServerGroupTracker.java#L314-L335
159,062
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/HostServerGroupTracker.java
HostServerGroupTracker.map
private void map(Resource root) { for (Resource.ResourceEntry serverGroup : root.getChildren(SERVER_GROUP)) { String serverGroupName = serverGroup.getName(); ModelNode serverGroupModel = serverGroup.getModel(); String profile = serverGroupModel.require(PROFILE).asString(); store(serverGroupName, profile, profilesToGroups); String socketBindingGroup = serverGroupModel.require(SOCKET_BINDING_GROUP).asString(); store(serverGroupName, socketBindingGroup, socketsToGroups); for (Resource.ResourceEntry deployment : serverGroup.getChildren(DEPLOYMENT)) { store(serverGroupName, deployment.getName(), deploymentsToGroups); } for (Resource.ResourceEntry overlay : serverGroup.getChildren(DEPLOYMENT_OVERLAY)) { store(serverGroupName, overlay.getName(), overlaysToGroups); } } for (Resource.ResourceEntry host : root.getChildren(HOST)) { String hostName = host.getPathElement().getValue(); for (Resource.ResourceEntry serverConfig : host.getChildren(SERVER_CONFIG)) { ModelNode serverConfigModel = serverConfig.getModel(); String serverGroupName = serverConfigModel.require(GROUP).asString(); store(serverGroupName, hostName, hostsToGroups); } } }
java
private void map(Resource root) { for (Resource.ResourceEntry serverGroup : root.getChildren(SERVER_GROUP)) { String serverGroupName = serverGroup.getName(); ModelNode serverGroupModel = serverGroup.getModel(); String profile = serverGroupModel.require(PROFILE).asString(); store(serverGroupName, profile, profilesToGroups); String socketBindingGroup = serverGroupModel.require(SOCKET_BINDING_GROUP).asString(); store(serverGroupName, socketBindingGroup, socketsToGroups); for (Resource.ResourceEntry deployment : serverGroup.getChildren(DEPLOYMENT)) { store(serverGroupName, deployment.getName(), deploymentsToGroups); } for (Resource.ResourceEntry overlay : serverGroup.getChildren(DEPLOYMENT_OVERLAY)) { store(serverGroupName, overlay.getName(), overlaysToGroups); } } for (Resource.ResourceEntry host : root.getChildren(HOST)) { String hostName = host.getPathElement().getValue(); for (Resource.ResourceEntry serverConfig : host.getChildren(SERVER_CONFIG)) { ModelNode serverConfigModel = serverConfig.getModel(); String serverGroupName = serverConfigModel.require(GROUP).asString(); store(serverGroupName, hostName, hostsToGroups); } } }
[ "private", "void", "map", "(", "Resource", "root", ")", "{", "for", "(", "Resource", ".", "ResourceEntry", "serverGroup", ":", "root", ".", "getChildren", "(", "SERVER_GROUP", ")", ")", "{", "String", "serverGroupName", "=", "serverGroup", ".", "getName", "(", ")", ";", "ModelNode", "serverGroupModel", "=", "serverGroup", ".", "getModel", "(", ")", ";", "String", "profile", "=", "serverGroupModel", ".", "require", "(", "PROFILE", ")", ".", "asString", "(", ")", ";", "store", "(", "serverGroupName", ",", "profile", ",", "profilesToGroups", ")", ";", "String", "socketBindingGroup", "=", "serverGroupModel", ".", "require", "(", "SOCKET_BINDING_GROUP", ")", ".", "asString", "(", ")", ";", "store", "(", "serverGroupName", ",", "socketBindingGroup", ",", "socketsToGroups", ")", ";", "for", "(", "Resource", ".", "ResourceEntry", "deployment", ":", "serverGroup", ".", "getChildren", "(", "DEPLOYMENT", ")", ")", "{", "store", "(", "serverGroupName", ",", "deployment", ".", "getName", "(", ")", ",", "deploymentsToGroups", ")", ";", "}", "for", "(", "Resource", ".", "ResourceEntry", "overlay", ":", "serverGroup", ".", "getChildren", "(", "DEPLOYMENT_OVERLAY", ")", ")", "{", "store", "(", "serverGroupName", ",", "overlay", ".", "getName", "(", ")", ",", "overlaysToGroups", ")", ";", "}", "}", "for", "(", "Resource", ".", "ResourceEntry", "host", ":", "root", ".", "getChildren", "(", "HOST", ")", ")", "{", "String", "hostName", "=", "host", ".", "getPathElement", "(", ")", ".", "getValue", "(", ")", ";", "for", "(", "Resource", ".", "ResourceEntry", "serverConfig", ":", "host", ".", "getChildren", "(", "SERVER_CONFIG", ")", ")", "{", "ModelNode", "serverConfigModel", "=", "serverConfig", ".", "getModel", "(", ")", ";", "String", "serverGroupName", "=", "serverConfigModel", ".", "require", "(", "GROUP", ")", ".", "asString", "(", ")", ";", "store", "(", "serverGroupName", ",", "hostName", ",", "hostsToGroups", ")", ";", "}", "}", "}" ]
Only call with monitor for 'this' held
[ "Only", "call", "with", "monitor", "for", "this", "held" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/HostServerGroupTracker.java#L338-L366
159,063
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/registry/LegacyResourceDefinition.java
LegacyResourceDefinition.registerAttributes
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { for (AttributeAccess attr : attributes.values()) { resourceRegistration.registerReadOnlyAttribute(attr.getAttributeDefinition(), null); } }
java
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { for (AttributeAccess attr : attributes.values()) { resourceRegistration.registerReadOnlyAttribute(attr.getAttributeDefinition(), null); } }
[ "@", "Override", "public", "void", "registerAttributes", "(", "ManagementResourceRegistration", "resourceRegistration", ")", "{", "for", "(", "AttributeAccess", "attr", ":", "attributes", ".", "values", "(", ")", ")", "{", "resourceRegistration", ".", "registerReadOnlyAttribute", "(", "attr", ".", "getAttributeDefinition", "(", ")", ",", "null", ")", ";", "}", "}" ]
Register operations associated with this resource. @param resourceRegistration a {@link org.jboss.as.controller.registry.ManagementResourceRegistration} created from this definition
[ "Register", "operations", "associated", "with", "this", "resource", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/registry/LegacyResourceDefinition.java#L135-L140
159,064
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/registry/LegacyResourceDefinition.java
LegacyResourceDefinition.registerChildren
@Override public void registerChildren(ManagementResourceRegistration resourceRegistration) { // Register wildcard children last to prevent duplicate registration errors when override definitions exist for (ResourceDefinition rd : singletonChildren) { resourceRegistration.registerSubModel(rd); } for (ResourceDefinition rd : wildcardChildren) { resourceRegistration.registerSubModel(rd); } }
java
@Override public void registerChildren(ManagementResourceRegistration resourceRegistration) { // Register wildcard children last to prevent duplicate registration errors when override definitions exist for (ResourceDefinition rd : singletonChildren) { resourceRegistration.registerSubModel(rd); } for (ResourceDefinition rd : wildcardChildren) { resourceRegistration.registerSubModel(rd); } }
[ "@", "Override", "public", "void", "registerChildren", "(", "ManagementResourceRegistration", "resourceRegistration", ")", "{", "// Register wildcard children last to prevent duplicate registration errors when override definitions exist", "for", "(", "ResourceDefinition", "rd", ":", "singletonChildren", ")", "{", "resourceRegistration", ".", "registerSubModel", "(", "rd", ")", ";", "}", "for", "(", "ResourceDefinition", "rd", ":", "wildcardChildren", ")", "{", "resourceRegistration", ".", "registerSubModel", "(", "rd", ")", ";", "}", "}" ]
Register child resources associated with this resource. @param resourceRegistration a {@link org.jboss.as.controller.registry.ManagementResourceRegistration} created from this definition
[ "Register", "child", "resources", "associated", "with", "this", "resource", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/registry/LegacyResourceDefinition.java#L147-L156
159,065
wildfly/wildfly-core
remoting/subsystem/src/main/java/org/jboss/as/remoting/management/ManagementRemotingServices.java
ManagementRemotingServices.installDomainConnectorServices
public static void installDomainConnectorServices(final OperationContext context, final ServiceTarget serviceTarget, final ServiceName endpointName, final ServiceName networkInterfaceBinding, final int port, final OptionMap options, final ServiceName securityRealm, final ServiceName saslAuthenticationFactory, final ServiceName sslContext) { String sbmCap = "org.wildfly.management.socket-binding-manager"; ServiceName sbmName = context.hasOptionalCapability(sbmCap, NATIVE_MANAGEMENT_RUNTIME_CAPABILITY.getName(), null) ? context.getCapabilityServiceName(sbmCap, SocketBindingManager.class) : null; installConnectorServicesForNetworkInterfaceBinding(serviceTarget, endpointName, MANAGEMENT_CONNECTOR, networkInterfaceBinding, port, options, securityRealm, saslAuthenticationFactory, sslContext, sbmName); }
java
public static void installDomainConnectorServices(final OperationContext context, final ServiceTarget serviceTarget, final ServiceName endpointName, final ServiceName networkInterfaceBinding, final int port, final OptionMap options, final ServiceName securityRealm, final ServiceName saslAuthenticationFactory, final ServiceName sslContext) { String sbmCap = "org.wildfly.management.socket-binding-manager"; ServiceName sbmName = context.hasOptionalCapability(sbmCap, NATIVE_MANAGEMENT_RUNTIME_CAPABILITY.getName(), null) ? context.getCapabilityServiceName(sbmCap, SocketBindingManager.class) : null; installConnectorServicesForNetworkInterfaceBinding(serviceTarget, endpointName, MANAGEMENT_CONNECTOR, networkInterfaceBinding, port, options, securityRealm, saslAuthenticationFactory, sslContext, sbmName); }
[ "public", "static", "void", "installDomainConnectorServices", "(", "final", "OperationContext", "context", ",", "final", "ServiceTarget", "serviceTarget", ",", "final", "ServiceName", "endpointName", ",", "final", "ServiceName", "networkInterfaceBinding", ",", "final", "int", "port", ",", "final", "OptionMap", "options", ",", "final", "ServiceName", "securityRealm", ",", "final", "ServiceName", "saslAuthenticationFactory", ",", "final", "ServiceName", "sslContext", ")", "{", "String", "sbmCap", "=", "\"org.wildfly.management.socket-binding-manager\"", ";", "ServiceName", "sbmName", "=", "context", ".", "hasOptionalCapability", "(", "sbmCap", ",", "NATIVE_MANAGEMENT_RUNTIME_CAPABILITY", ".", "getName", "(", ")", ",", "null", ")", "?", "context", ".", "getCapabilityServiceName", "(", "sbmCap", ",", "SocketBindingManager", ".", "class", ")", ":", "null", ";", "installConnectorServicesForNetworkInterfaceBinding", "(", "serviceTarget", ",", "endpointName", ",", "MANAGEMENT_CONNECTOR", ",", "networkInterfaceBinding", ",", "port", ",", "options", ",", "securityRealm", ",", "saslAuthenticationFactory", ",", "sslContext", ",", "sbmName", ")", ";", "}" ]
Installs a remoting stream server for a domain instance @param serviceTarget the service target to install the services into @param endpointName the name of the endpoint to install the stream server into @param networkInterfaceBinding the network interface binding @param port the port @param securityRealm the security real name @param options the remoting options
[ "Installs", "a", "remoting", "stream", "server", "for", "a", "domain", "instance" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/remoting/subsystem/src/main/java/org/jboss/as/remoting/management/ManagementRemotingServices.java#L89-L103
159,066
wildfly/wildfly-core
remoting/subsystem/src/main/java/org/jboss/as/remoting/management/ManagementRemotingServices.java
ManagementRemotingServices.installManagementChannelServices
public static void installManagementChannelServices( final ServiceTarget serviceTarget, final ServiceName endpointName, final AbstractModelControllerOperationHandlerFactoryService operationHandlerService, final ServiceName modelControllerName, final String channelName, final ServiceName executorServiceName, final ServiceName scheduledExecutorServiceName) { final OptionMap options = OptionMap.EMPTY; final ServiceName operationHandlerName = endpointName.append(channelName).append(ModelControllerClientOperationHandlerFactoryService.OPERATION_HANDLER_NAME_SUFFIX); serviceTarget.addService(operationHandlerName, operationHandlerService) .addDependency(modelControllerName, ModelController.class, operationHandlerService.getModelControllerInjector()) .addDependency(executorServiceName, ExecutorService.class, operationHandlerService.getExecutorInjector()) .addDependency(scheduledExecutorServiceName, ScheduledExecutorService.class, operationHandlerService.getScheduledExecutorInjector()) .setInitialMode(ACTIVE) .install(); installManagementChannelOpenListenerService(serviceTarget, endpointName, channelName, operationHandlerName, options, false); }
java
public static void installManagementChannelServices( final ServiceTarget serviceTarget, final ServiceName endpointName, final AbstractModelControllerOperationHandlerFactoryService operationHandlerService, final ServiceName modelControllerName, final String channelName, final ServiceName executorServiceName, final ServiceName scheduledExecutorServiceName) { final OptionMap options = OptionMap.EMPTY; final ServiceName operationHandlerName = endpointName.append(channelName).append(ModelControllerClientOperationHandlerFactoryService.OPERATION_HANDLER_NAME_SUFFIX); serviceTarget.addService(operationHandlerName, operationHandlerService) .addDependency(modelControllerName, ModelController.class, operationHandlerService.getModelControllerInjector()) .addDependency(executorServiceName, ExecutorService.class, operationHandlerService.getExecutorInjector()) .addDependency(scheduledExecutorServiceName, ScheduledExecutorService.class, operationHandlerService.getScheduledExecutorInjector()) .setInitialMode(ACTIVE) .install(); installManagementChannelOpenListenerService(serviceTarget, endpointName, channelName, operationHandlerName, options, false); }
[ "public", "static", "void", "installManagementChannelServices", "(", "final", "ServiceTarget", "serviceTarget", ",", "final", "ServiceName", "endpointName", ",", "final", "AbstractModelControllerOperationHandlerFactoryService", "operationHandlerService", ",", "final", "ServiceName", "modelControllerName", ",", "final", "String", "channelName", ",", "final", "ServiceName", "executorServiceName", ",", "final", "ServiceName", "scheduledExecutorServiceName", ")", "{", "final", "OptionMap", "options", "=", "OptionMap", ".", "EMPTY", ";", "final", "ServiceName", "operationHandlerName", "=", "endpointName", ".", "append", "(", "channelName", ")", ".", "append", "(", "ModelControllerClientOperationHandlerFactoryService", ".", "OPERATION_HANDLER_NAME_SUFFIX", ")", ";", "serviceTarget", ".", "addService", "(", "operationHandlerName", ",", "operationHandlerService", ")", ".", "addDependency", "(", "modelControllerName", ",", "ModelController", ".", "class", ",", "operationHandlerService", ".", "getModelControllerInjector", "(", ")", ")", ".", "addDependency", "(", "executorServiceName", ",", "ExecutorService", ".", "class", ",", "operationHandlerService", ".", "getExecutorInjector", "(", ")", ")", ".", "addDependency", "(", "scheduledExecutorServiceName", ",", "ScheduledExecutorService", ".", "class", ",", "operationHandlerService", ".", "getScheduledExecutorInjector", "(", ")", ")", ".", "setInitialMode", "(", "ACTIVE", ")", ".", "install", "(", ")", ";", "installManagementChannelOpenListenerService", "(", "serviceTarget", ",", "endpointName", ",", "channelName", ",", "operationHandlerName", ",", "options", ",", "false", ")", ";", "}" ]
Set up the services to create a channel listener and operation handler service. @param serviceTarget the service target to install the services into @param endpointName the endpoint name to install the services into @param channelName the name of the channel @param executorServiceName service name of the executor service to use in the operation handler service @param scheduledExecutorServiceName service name of the scheduled executor service to use in the operation handler service
[ "Set", "up", "the", "services", "to", "create", "a", "channel", "listener", "and", "operation", "handler", "service", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/remoting/subsystem/src/main/java/org/jboss/as/remoting/management/ManagementRemotingServices.java#L145-L165
159,067
wildfly/wildfly-core
remoting/subsystem/src/main/java/org/jboss/as/remoting/management/ManagementRemotingServices.java
ManagementRemotingServices.isManagementResourceRemoveable
public static void isManagementResourceRemoveable(OperationContext context, PathAddress otherManagementEndpoint) throws OperationFailedException { ModelNode remotingConnector; try { remotingConnector = context.readResourceFromRoot( PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, "jmx"), PathElement.pathElement("remoting-connector", "jmx")), false).getModel(); } catch (Resource.NoSuchResourceException ex) { return; } if (!remotingConnector.hasDefined(USE_MGMT_ENDPOINT) || (remotingConnector.hasDefined(USE_MGMT_ENDPOINT) && context.resolveExpressions(remotingConnector.get(USE_MGMT_ENDPOINT)).asBoolean(true))) { try { context.readResourceFromRoot(otherManagementEndpoint, false); } catch (NoSuchElementException ex) { throw RemotingLogger.ROOT_LOGGER.couldNotRemoveResource(context.getCurrentAddress()); } } }
java
public static void isManagementResourceRemoveable(OperationContext context, PathAddress otherManagementEndpoint) throws OperationFailedException { ModelNode remotingConnector; try { remotingConnector = context.readResourceFromRoot( PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, "jmx"), PathElement.pathElement("remoting-connector", "jmx")), false).getModel(); } catch (Resource.NoSuchResourceException ex) { return; } if (!remotingConnector.hasDefined(USE_MGMT_ENDPOINT) || (remotingConnector.hasDefined(USE_MGMT_ENDPOINT) && context.resolveExpressions(remotingConnector.get(USE_MGMT_ENDPOINT)).asBoolean(true))) { try { context.readResourceFromRoot(otherManagementEndpoint, false); } catch (NoSuchElementException ex) { throw RemotingLogger.ROOT_LOGGER.couldNotRemoveResource(context.getCurrentAddress()); } } }
[ "public", "static", "void", "isManagementResourceRemoveable", "(", "OperationContext", "context", ",", "PathAddress", "otherManagementEndpoint", ")", "throws", "OperationFailedException", "{", "ModelNode", "remotingConnector", ";", "try", "{", "remotingConnector", "=", "context", ".", "readResourceFromRoot", "(", "PathAddress", ".", "pathAddress", "(", "PathElement", ".", "pathElement", "(", "SUBSYSTEM", ",", "\"jmx\"", ")", ",", "PathElement", ".", "pathElement", "(", "\"remoting-connector\"", ",", "\"jmx\"", ")", ")", ",", "false", ")", ".", "getModel", "(", ")", ";", "}", "catch", "(", "Resource", ".", "NoSuchResourceException", "ex", ")", "{", "return", ";", "}", "if", "(", "!", "remotingConnector", ".", "hasDefined", "(", "USE_MGMT_ENDPOINT", ")", "||", "(", "remotingConnector", ".", "hasDefined", "(", "USE_MGMT_ENDPOINT", ")", "&&", "context", ".", "resolveExpressions", "(", "remotingConnector", ".", "get", "(", "USE_MGMT_ENDPOINT", ")", ")", ".", "asBoolean", "(", "true", ")", ")", ")", "{", "try", "{", "context", ".", "readResourceFromRoot", "(", "otherManagementEndpoint", ",", "false", ")", ";", "}", "catch", "(", "NoSuchElementException", "ex", ")", "{", "throw", "RemotingLogger", ".", "ROOT_LOGGER", ".", "couldNotRemoveResource", "(", "context", ".", "getCurrentAddress", "(", ")", ")", ";", "}", "}", "}" ]
Manual check because introducing a capability can't be done without a full refactoring. This has to go as soon as the management interfaces are redesigned. @param context the OperationContext @param otherManagementEndpoint : the address to check that may provide an exposed jboss-remoting endpoint. @throws OperationFailedException in case we can't remove the management resource.
[ "Manual", "check", "because", "introducing", "a", "capability", "can", "t", "be", "done", "without", "a", "full", "refactoring", ".", "This", "has", "to", "go", "as", "soon", "as", "the", "management", "interfaces", "are", "redesigned", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/remoting/subsystem/src/main/java/org/jboss/as/remoting/management/ManagementRemotingServices.java#L183-L199
159,068
wildfly/wildfly-core
elytron/src/main/java/org/wildfly/extension/elytron/CertificateChainAttributeDefinitions.java
CertificateChainAttributeDefinitions.writeCertificates
static void writeCertificates(final ModelNode result, final Certificate[] certificates) throws CertificateEncodingException, NoSuchAlgorithmException { if (certificates != null) { for (Certificate current : certificates) { ModelNode certificate = new ModelNode(); writeCertificate(certificate, current); result.add(certificate); } } }
java
static void writeCertificates(final ModelNode result, final Certificate[] certificates) throws CertificateEncodingException, NoSuchAlgorithmException { if (certificates != null) { for (Certificate current : certificates) { ModelNode certificate = new ModelNode(); writeCertificate(certificate, current); result.add(certificate); } } }
[ "static", "void", "writeCertificates", "(", "final", "ModelNode", "result", ",", "final", "Certificate", "[", "]", "certificates", ")", "throws", "CertificateEncodingException", ",", "NoSuchAlgorithmException", "{", "if", "(", "certificates", "!=", "null", ")", "{", "for", "(", "Certificate", "current", ":", "certificates", ")", "{", "ModelNode", "certificate", "=", "new", "ModelNode", "(", ")", ";", "writeCertificate", "(", "certificate", ",", "current", ")", ";", "result", ".", "add", "(", "certificate", ")", ";", "}", "}", "}" ]
Populate the supplied response with the model representation of the certificates. @param result the response to populate. @param certificates the certificates to add to the response. @throws CertificateEncodingException @throws NoSuchAlgorithmException
[ "Populate", "the", "supplied", "response", "with", "the", "model", "representation", "of", "the", "certificates", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/elytron/src/main/java/org/wildfly/extension/elytron/CertificateChainAttributeDefinitions.java#L156-L164
159,069
wildfly/wildfly-core
jmx/src/main/java/org/jboss/as/jmx/model/ModelControllerMBeanHelper.java
ModelControllerMBeanHelper.setQueryExpServer
private static MBeanServer setQueryExpServer(QueryExp query, MBeanServer toSet) { // We assume the QueryExp is a QueryEval subclass or uses the QueryEval thread local // mechanism to store any existing MBeanServer. If that's not the case we have no // way to access the old mbeanserver to let us restore it MBeanServer result = QueryEval.getMBeanServer(); query.setMBeanServer(toSet); return result; }
java
private static MBeanServer setQueryExpServer(QueryExp query, MBeanServer toSet) { // We assume the QueryExp is a QueryEval subclass or uses the QueryEval thread local // mechanism to store any existing MBeanServer. If that's not the case we have no // way to access the old mbeanserver to let us restore it MBeanServer result = QueryEval.getMBeanServer(); query.setMBeanServer(toSet); return result; }
[ "private", "static", "MBeanServer", "setQueryExpServer", "(", "QueryExp", "query", ",", "MBeanServer", "toSet", ")", "{", "// We assume the QueryExp is a QueryEval subclass or uses the QueryEval thread local", "// mechanism to store any existing MBeanServer. If that's not the case we have no", "// way to access the old mbeanserver to let us restore it", "MBeanServer", "result", "=", "QueryEval", ".", "getMBeanServer", "(", ")", ";", "query", ".", "setMBeanServer", "(", "toSet", ")", ";", "return", "result", ";", "}" ]
Set the mbean server on the QueryExp and try and pass back any previously set one
[ "Set", "the", "mbean", "server", "on", "the", "QueryExp", "and", "try", "and", "pass", "back", "any", "previously", "set", "one" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/jmx/src/main/java/org/jboss/as/jmx/model/ModelControllerMBeanHelper.java#L234-L241
159,070
wildfly/wildfly-core
jmx/src/main/java/org/jboss/as/jmx/model/ModelControllerMBeanHelper.java
ModelControllerMBeanHelper.toPathAddress
PathAddress toPathAddress(final ObjectName name) { return ObjectNameAddressUtil.toPathAddress(rootObjectInstance.getObjectName(), getRootResourceAndRegistration().getRegistration(), name); }
java
PathAddress toPathAddress(final ObjectName name) { return ObjectNameAddressUtil.toPathAddress(rootObjectInstance.getObjectName(), getRootResourceAndRegistration().getRegistration(), name); }
[ "PathAddress", "toPathAddress", "(", "final", "ObjectName", "name", ")", "{", "return", "ObjectNameAddressUtil", ".", "toPathAddress", "(", "rootObjectInstance", ".", "getObjectName", "(", ")", ",", "getRootResourceAndRegistration", "(", ")", ".", "getRegistration", "(", ")", ",", "name", ")", ";", "}" ]
Convert an ObjectName to a PathAddress. Patterns are supported: there may not be a resource at the returned PathAddress but a resource model <strong>MUST</strong> must be registered.
[ "Convert", "an", "ObjectName", "to", "a", "PathAddress", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/jmx/src/main/java/org/jboss/as/jmx/model/ModelControllerMBeanHelper.java#L259-L261
159,071
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/remote/TransactionalProtocolHandlers.java
TransactionalProtocolHandlers.createClient
public static TransactionalProtocolClient createClient(final ManagementChannelHandler channelAssociation) { final TransactionalProtocolClientImpl client = new TransactionalProtocolClientImpl(channelAssociation); channelAssociation.addHandlerFactory(client); return client; }
java
public static TransactionalProtocolClient createClient(final ManagementChannelHandler channelAssociation) { final TransactionalProtocolClientImpl client = new TransactionalProtocolClientImpl(channelAssociation); channelAssociation.addHandlerFactory(client); return client; }
[ "public", "static", "TransactionalProtocolClient", "createClient", "(", "final", "ManagementChannelHandler", "channelAssociation", ")", "{", "final", "TransactionalProtocolClientImpl", "client", "=", "new", "TransactionalProtocolClientImpl", "(", "channelAssociation", ")", ";", "channelAssociation", ".", "addHandlerFactory", "(", "client", ")", ";", "return", "client", ";", "}" ]
Create a transactional protocol client. @param channelAssociation the channel handler @return the transactional protocol client
[ "Create", "a", "transactional", "protocol", "client", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/remote/TransactionalProtocolHandlers.java#L47-L51
159,072
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/remote/TransactionalProtocolHandlers.java
TransactionalProtocolHandlers.wrap
public static TransactionalProtocolClient.Operation wrap(final ModelNode operation, final OperationMessageHandler messageHandler, final OperationAttachments attachments) { return new TransactionalOperationImpl(operation, messageHandler, attachments); }
java
public static TransactionalProtocolClient.Operation wrap(final ModelNode operation, final OperationMessageHandler messageHandler, final OperationAttachments attachments) { return new TransactionalOperationImpl(operation, messageHandler, attachments); }
[ "public", "static", "TransactionalProtocolClient", ".", "Operation", "wrap", "(", "final", "ModelNode", "operation", ",", "final", "OperationMessageHandler", "messageHandler", ",", "final", "OperationAttachments", "attachments", ")", "{", "return", "new", "TransactionalOperationImpl", "(", "operation", ",", "messageHandler", ",", "attachments", ")", ";", "}" ]
Wrap an operation's parameters in a simple encapsulating object @param operation the operation @param messageHandler the message handler @param attachments the attachments @return the encapsulating object
[ "Wrap", "an", "operation", "s", "parameters", "in", "a", "simple", "encapsulating", "object" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/remote/TransactionalProtocolHandlers.java#L60-L62
159,073
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/remote/TransactionalProtocolHandlers.java
TransactionalProtocolHandlers.executeBlocking
public static TransactionalProtocolClient.PreparedOperation<TransactionalProtocolClient.Operation> executeBlocking(final ModelNode operation, TransactionalProtocolClient client) throws IOException, InterruptedException { final BlockingQueueOperationListener<TransactionalProtocolClient.Operation> listener = new BlockingQueueOperationListener<>(); client.execute(listener, operation, OperationMessageHandler.DISCARD, OperationAttachments.EMPTY); return listener.retrievePreparedOperation(); }
java
public static TransactionalProtocolClient.PreparedOperation<TransactionalProtocolClient.Operation> executeBlocking(final ModelNode operation, TransactionalProtocolClient client) throws IOException, InterruptedException { final BlockingQueueOperationListener<TransactionalProtocolClient.Operation> listener = new BlockingQueueOperationListener<>(); client.execute(listener, operation, OperationMessageHandler.DISCARD, OperationAttachments.EMPTY); return listener.retrievePreparedOperation(); }
[ "public", "static", "TransactionalProtocolClient", ".", "PreparedOperation", "<", "TransactionalProtocolClient", ".", "Operation", ">", "executeBlocking", "(", "final", "ModelNode", "operation", ",", "TransactionalProtocolClient", "client", ")", "throws", "IOException", ",", "InterruptedException", "{", "final", "BlockingQueueOperationListener", "<", "TransactionalProtocolClient", ".", "Operation", ">", "listener", "=", "new", "BlockingQueueOperationListener", "<>", "(", ")", ";", "client", ".", "execute", "(", "listener", ",", "operation", ",", "OperationMessageHandler", ".", "DISCARD", ",", "OperationAttachments", ".", "EMPTY", ")", ";", "return", "listener", ".", "retrievePreparedOperation", "(", ")", ";", "}" ]
Execute blocking for a prepared result. @param operation the operation to execute @param client the protocol client @return the prepared operation @throws IOException @throws InterruptedException
[ "Execute", "blocking", "for", "a", "prepared", "result", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/remote/TransactionalProtocolHandlers.java#L73-L77
159,074
wildfly/wildfly-core
cli/src/main/java/org/jboss/as/cli/gui/component/ServerLogsTableModel.java
ServerLogsTableModel.init
private void init() { if (initialized.compareAndSet(false, true)) { final RowSorter<? extends TableModel> rowSorter = table.getRowSorter(); rowSorter.toggleSortOrder(1); // sort by date rowSorter.toggleSortOrder(1); // descending final TableColumnModel columnModel = table.getColumnModel(); columnModel.getColumn(1).setCellRenderer(dateRenderer); columnModel.getColumn(2).setCellRenderer(sizeRenderer); } }
java
private void init() { if (initialized.compareAndSet(false, true)) { final RowSorter<? extends TableModel> rowSorter = table.getRowSorter(); rowSorter.toggleSortOrder(1); // sort by date rowSorter.toggleSortOrder(1); // descending final TableColumnModel columnModel = table.getColumnModel(); columnModel.getColumn(1).setCellRenderer(dateRenderer); columnModel.getColumn(2).setCellRenderer(sizeRenderer); } }
[ "private", "void", "init", "(", ")", "{", "if", "(", "initialized", ".", "compareAndSet", "(", "false", ",", "true", ")", ")", "{", "final", "RowSorter", "<", "?", "extends", "TableModel", ">", "rowSorter", "=", "table", ".", "getRowSorter", "(", ")", ";", "rowSorter", ".", "toggleSortOrder", "(", "1", ")", ";", "// sort by date", "rowSorter", ".", "toggleSortOrder", "(", "1", ")", ";", "// descending", "final", "TableColumnModel", "columnModel", "=", "table", ".", "getColumnModel", "(", ")", ";", "columnModel", ".", "getColumn", "(", "1", ")", ".", "setCellRenderer", "(", "dateRenderer", ")", ";", "columnModel", ".", "getColumn", "(", "2", ")", ".", "setCellRenderer", "(", "sizeRenderer", ")", ";", "}", "}" ]
Initializes the model
[ "Initializes", "the", "model" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/gui/component/ServerLogsTableModel.java#L91-L100
159,075
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/management/DeleteOp.java
DeleteOp.execute
public void execute() throws IOException { try { prepare(); boolean commitResult = commit(); if (commitResult == false) { throw PatchLogger.ROOT_LOGGER.failedToDeleteBackup(); } } catch (PrepareException pe){ rollback(); throw PatchLogger.ROOT_LOGGER.failedToDelete(pe.getPath()); } }
java
public void execute() throws IOException { try { prepare(); boolean commitResult = commit(); if (commitResult == false) { throw PatchLogger.ROOT_LOGGER.failedToDeleteBackup(); } } catch (PrepareException pe){ rollback(); throw PatchLogger.ROOT_LOGGER.failedToDelete(pe.getPath()); } }
[ "public", "void", "execute", "(", ")", "throws", "IOException", "{", "try", "{", "prepare", "(", ")", ";", "boolean", "commitResult", "=", "commit", "(", ")", ";", "if", "(", "commitResult", "==", "false", ")", "{", "throw", "PatchLogger", ".", "ROOT_LOGGER", ".", "failedToDeleteBackup", "(", ")", ";", "}", "}", "catch", "(", "PrepareException", "pe", ")", "{", "rollback", "(", ")", ";", "throw", "PatchLogger", ".", "ROOT_LOGGER", ".", "failedToDelete", "(", "pe", ".", "getPath", "(", ")", ")", ";", "}", "}" ]
remove files from directory. All-or-nothing operation - if any of the files fails to be removed, all deleted files are restored. The operation is performed in two steps - first all the files are moved to a backup folder, and afterwards backup folder is removed. If an error occurs in the first step of the operation, all files are restored and the operation ends with status {@code false}. If an error occurs in the second step, the operation ends with status {@code false}, but the files are not rolled back. @throws IOException if an error occurred
[ "remove", "files", "from", "directory", ".", "All", "-", "or", "-", "nothing", "operation", "-", "if", "any", "of", "the", "files", "fails", "to", "be", "removed", "all", "deleted", "files", "are", "restored", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/management/DeleteOp.java#L54-L68
159,076
wildfly/wildfly-core
server/src/main/java/org/jboss/as/server/controller/git/GitRepository.java
GitRepository.rollback
public void rollback() throws GitAPIException { try (Git git = getGit()) { git.reset().setMode(ResetCommand.ResetType.HARD).setRef(HEAD).call(); } }
java
public void rollback() throws GitAPIException { try (Git git = getGit()) { git.reset().setMode(ResetCommand.ResetType.HARD).setRef(HEAD).call(); } }
[ "public", "void", "rollback", "(", ")", "throws", "GitAPIException", "{", "try", "(", "Git", "git", "=", "getGit", "(", ")", ")", "{", "git", ".", "reset", "(", ")", ".", "setMode", "(", "ResetCommand", ".", "ResetType", ".", "HARD", ")", ".", "setRef", "(", "HEAD", ")", ".", "call", "(", ")", ";", "}", "}" ]
Reset hard on HEAD. @throws GitAPIException
[ "Reset", "hard", "on", "HEAD", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/controller/git/GitRepository.java#L294-L298
159,077
wildfly/wildfly-core
server/src/main/java/org/jboss/as/server/controller/git/GitRepository.java
GitRepository.commit
public void commit(String msg) throws GitAPIException { try (Git git = getGit()) { Status status = git.status().call(); if (!status.isClean()) { git.commit().setMessage(msg).setAll(true).setNoVerify(true).call(); } } }
java
public void commit(String msg) throws GitAPIException { try (Git git = getGit()) { Status status = git.status().call(); if (!status.isClean()) { git.commit().setMessage(msg).setAll(true).setNoVerify(true).call(); } } }
[ "public", "void", "commit", "(", "String", "msg", ")", "throws", "GitAPIException", "{", "try", "(", "Git", "git", "=", "getGit", "(", ")", ")", "{", "Status", "status", "=", "git", ".", "status", "(", ")", ".", "call", "(", ")", ";", "if", "(", "!", "status", ".", "isClean", "(", ")", ")", "{", "git", ".", "commit", "(", ")", ".", "setMessage", "(", "msg", ")", ".", "setAll", "(", "true", ")", ".", "setNoVerify", "(", "true", ")", ".", "call", "(", ")", ";", "}", "}", "}" ]
Commit all changes if there are uncommitted changes. @param msg the commit message. @throws GitAPIException
[ "Commit", "all", "changes", "if", "there", "are", "uncommitted", "changes", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/controller/git/GitRepository.java#L306-L313
159,078
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/extension/ExtensionAddHandler.java
ExtensionAddHandler.initializeExtension
static void initializeExtension(ExtensionRegistry extensionRegistry, String module, ManagementResourceRegistration rootRegistration, ExtensionRegistryType extensionRegistryType) { try { boolean unknownModule = false; boolean initialized = false; for (Extension extension : Module.loadServiceFromCallerModuleLoader(module, Extension.class)) { ClassLoader oldTccl = WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(extension.getClass()); try { if (unknownModule || !extensionRegistry.getExtensionModuleNames().contains(module)) { // This extension wasn't handled by the standalone.xml or domain.xml parsing logic, so we // need to initialize its parsers so we can display what XML namespaces it supports extensionRegistry.initializeParsers(extension, module, null); // AS7-6190 - ensure we initialize parsers for other extensions from this module // now that we know the registry was unaware of the module unknownModule = true; } extension.initialize(extensionRegistry.getExtensionContext(module, rootRegistration, extensionRegistryType)); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); } initialized = true; } if (!initialized) { throw ControllerLogger.ROOT_LOGGER.notFound("META-INF/services/", Extension.class.getName(), module); } } catch (ModuleNotFoundException e) { // Treat this as a user mistake, e.g. incorrect module name. // Throw OFE so post-boot it only gets logged at DEBUG. throw ControllerLogger.ROOT_LOGGER.extensionModuleNotFound(e, module); } catch (ModuleLoadException e) { // The module is there but can't be loaded. Treat this as an internal problem. // Throw a runtime exception so it always gets logged at ERROR in the server log with stack trace details. throw ControllerLogger.ROOT_LOGGER.extensionModuleLoadingFailure(e, module); } }
java
static void initializeExtension(ExtensionRegistry extensionRegistry, String module, ManagementResourceRegistration rootRegistration, ExtensionRegistryType extensionRegistryType) { try { boolean unknownModule = false; boolean initialized = false; for (Extension extension : Module.loadServiceFromCallerModuleLoader(module, Extension.class)) { ClassLoader oldTccl = WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(extension.getClass()); try { if (unknownModule || !extensionRegistry.getExtensionModuleNames().contains(module)) { // This extension wasn't handled by the standalone.xml or domain.xml parsing logic, so we // need to initialize its parsers so we can display what XML namespaces it supports extensionRegistry.initializeParsers(extension, module, null); // AS7-6190 - ensure we initialize parsers for other extensions from this module // now that we know the registry was unaware of the module unknownModule = true; } extension.initialize(extensionRegistry.getExtensionContext(module, rootRegistration, extensionRegistryType)); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl); } initialized = true; } if (!initialized) { throw ControllerLogger.ROOT_LOGGER.notFound("META-INF/services/", Extension.class.getName(), module); } } catch (ModuleNotFoundException e) { // Treat this as a user mistake, e.g. incorrect module name. // Throw OFE so post-boot it only gets logged at DEBUG. throw ControllerLogger.ROOT_LOGGER.extensionModuleNotFound(e, module); } catch (ModuleLoadException e) { // The module is there but can't be loaded. Treat this as an internal problem. // Throw a runtime exception so it always gets logged at ERROR in the server log with stack trace details. throw ControllerLogger.ROOT_LOGGER.extensionModuleLoadingFailure(e, module); } }
[ "static", "void", "initializeExtension", "(", "ExtensionRegistry", "extensionRegistry", ",", "String", "module", ",", "ManagementResourceRegistration", "rootRegistration", ",", "ExtensionRegistryType", "extensionRegistryType", ")", "{", "try", "{", "boolean", "unknownModule", "=", "false", ";", "boolean", "initialized", "=", "false", ";", "for", "(", "Extension", "extension", ":", "Module", ".", "loadServiceFromCallerModuleLoader", "(", "module", ",", "Extension", ".", "class", ")", ")", "{", "ClassLoader", "oldTccl", "=", "WildFlySecurityManager", ".", "setCurrentContextClassLoaderPrivileged", "(", "extension", ".", "getClass", "(", ")", ")", ";", "try", "{", "if", "(", "unknownModule", "||", "!", "extensionRegistry", ".", "getExtensionModuleNames", "(", ")", ".", "contains", "(", "module", ")", ")", "{", "// This extension wasn't handled by the standalone.xml or domain.xml parsing logic, so we", "// need to initialize its parsers so we can display what XML namespaces it supports", "extensionRegistry", ".", "initializeParsers", "(", "extension", ",", "module", ",", "null", ")", ";", "// AS7-6190 - ensure we initialize parsers for other extensions from this module", "// now that we know the registry was unaware of the module", "unknownModule", "=", "true", ";", "}", "extension", ".", "initialize", "(", "extensionRegistry", ".", "getExtensionContext", "(", "module", ",", "rootRegistration", ",", "extensionRegistryType", ")", ")", ";", "}", "finally", "{", "WildFlySecurityManager", ".", "setCurrentContextClassLoaderPrivileged", "(", "oldTccl", ")", ";", "}", "initialized", "=", "true", ";", "}", "if", "(", "!", "initialized", ")", "{", "throw", "ControllerLogger", ".", "ROOT_LOGGER", ".", "notFound", "(", "\"META-INF/services/\"", ",", "Extension", ".", "class", ".", "getName", "(", ")", ",", "module", ")", ";", "}", "}", "catch", "(", "ModuleNotFoundException", "e", ")", "{", "// Treat this as a user mistake, e.g. incorrect module name.", "// Throw OFE so post-boot it only gets logged at DEBUG.", "throw", "ControllerLogger", ".", "ROOT_LOGGER", ".", "extensionModuleNotFound", "(", "e", ",", "module", ")", ";", "}", "catch", "(", "ModuleLoadException", "e", ")", "{", "// The module is there but can't be loaded. Treat this as an internal problem.", "// Throw a runtime exception so it always gets logged at ERROR in the server log with stack trace details.", "throw", "ControllerLogger", ".", "ROOT_LOGGER", ".", "extensionModuleLoadingFailure", "(", "e", ",", "module", ")", ";", "}", "}" ]
Initialise an extension module's extensions in the extension registry @param extensionRegistry the extension registry @param module the name of the module containing the extensions @param rootRegistration The parent registration of the extensions. For a server or domain.xml extension, this will be the root resource registration. For a host.xml extension, this will be the host resource registration @param extensionRegistryType The type of the registry
[ "Initialise", "an", "extension", "module", "s", "extensions", "in", "the", "extension", "registry" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/extension/ExtensionAddHandler.java#L114-L149
159,079
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/services/path/PathManagerService.java
PathManagerService.addDependent
private void addDependent(String pathName, String relativeTo) { if (relativeTo != null) { Set<String> dependents = dependenctRelativePaths.get(relativeTo); if (dependents == null) { dependents = new HashSet<String>(); dependenctRelativePaths.put(relativeTo, dependents); } dependents.add(pathName); } }
java
private void addDependent(String pathName, String relativeTo) { if (relativeTo != null) { Set<String> dependents = dependenctRelativePaths.get(relativeTo); if (dependents == null) { dependents = new HashSet<String>(); dependenctRelativePaths.put(relativeTo, dependents); } dependents.add(pathName); } }
[ "private", "void", "addDependent", "(", "String", "pathName", ",", "String", "relativeTo", ")", "{", "if", "(", "relativeTo", "!=", "null", ")", "{", "Set", "<", "String", ">", "dependents", "=", "dependenctRelativePaths", ".", "get", "(", "relativeTo", ")", ";", "if", "(", "dependents", "==", "null", ")", "{", "dependents", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "dependenctRelativePaths", ".", "put", "(", "relativeTo", ",", "dependents", ")", ";", "}", "dependents", ".", "add", "(", "pathName", ")", ";", "}", "}" ]
Must be called with pathEntries lock taken
[ "Must", "be", "called", "with", "pathEntries", "lock", "taken" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/services/path/PathManagerService.java#L359-L368
159,080
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/services/path/PathManagerService.java
PathManagerService.getAllDependents
private void getAllDependents(Set<PathEntry> result, String name) { Set<String> depNames = dependenctRelativePaths.get(name); if (depNames == null) { return; } for (String dep : depNames) { PathEntry entry = pathEntries.get(dep); if (entry != null) { result.add(entry); getAllDependents(result, dep); } } }
java
private void getAllDependents(Set<PathEntry> result, String name) { Set<String> depNames = dependenctRelativePaths.get(name); if (depNames == null) { return; } for (String dep : depNames) { PathEntry entry = pathEntries.get(dep); if (entry != null) { result.add(entry); getAllDependents(result, dep); } } }
[ "private", "void", "getAllDependents", "(", "Set", "<", "PathEntry", ">", "result", ",", "String", "name", ")", "{", "Set", "<", "String", ">", "depNames", "=", "dependenctRelativePaths", ".", "get", "(", "name", ")", ";", "if", "(", "depNames", "==", "null", ")", "{", "return", ";", "}", "for", "(", "String", "dep", ":", "depNames", ")", "{", "PathEntry", "entry", "=", "pathEntries", ".", "get", "(", "dep", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "result", ".", "add", "(", "entry", ")", ";", "getAllDependents", "(", "result", ",", "dep", ")", ";", "}", "}", "}" ]
Call with pathEntries lock taken
[ "Call", "with", "pathEntries", "lock", "taken" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/services/path/PathManagerService.java#L463-L475
159,081
wildfly/wildfly-core
host-controller/src/main/java/org/jboss/as/host/controller/model/jvm/JvmOptionsElement.java
JvmOptionsElement.addOption
void addOption(final String value) { Assert.checkNotNullParam("value", value); synchronized (options) { options.add(value); } }
java
void addOption(final String value) { Assert.checkNotNullParam("value", value); synchronized (options) { options.add(value); } }
[ "void", "addOption", "(", "final", "String", "value", ")", "{", "Assert", ".", "checkNotNullParam", "(", "\"value\"", ",", "value", ")", ";", "synchronized", "(", "options", ")", "{", "options", ".", "add", "(", "value", ")", ";", "}", "}" ]
Adds an option to the Jvm options @param value the option to add
[ "Adds", "an", "option", "to", "the", "Jvm", "options" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/model/jvm/JvmOptionsElement.java#L51-L56
159,082
wildfly/wildfly-core
server/src/main/java/org/jboss/as/server/deployment/AttachmentKey.java
AttachmentKey.create
@SuppressWarnings("unchecked") public static <T> AttachmentKey<T> create(final Class<? super T> valueClass) { return new SimpleAttachmentKey(valueClass); }
java
@SuppressWarnings("unchecked") public static <T> AttachmentKey<T> create(final Class<? super T> valueClass) { return new SimpleAttachmentKey(valueClass); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "AttachmentKey", "<", "T", ">", "create", "(", "final", "Class", "<", "?", "super", "T", ">", "valueClass", ")", "{", "return", "new", "SimpleAttachmentKey", "(", "valueClass", ")", ";", "}" ]
Construct a new simple attachment key. @param valueClass the value class @param <T> the attachment type @return the new instance
[ "Construct", "a", "new", "simple", "attachment", "key", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/AttachmentKey.java#L50-L53
159,083
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/runner/PatchContentLoader.java
PatchContentLoader.openContentStream
InputStream openContentStream(final ContentItem item) throws IOException { final File file = getFile(item); if (file == null) { throw new IllegalStateException(); } return new FileInputStream(file); }
java
InputStream openContentStream(final ContentItem item) throws IOException { final File file = getFile(item); if (file == null) { throw new IllegalStateException(); } return new FileInputStream(file); }
[ "InputStream", "openContentStream", "(", "final", "ContentItem", "item", ")", "throws", "IOException", "{", "final", "File", "file", "=", "getFile", "(", "item", ")", ";", "if", "(", "file", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "return", "new", "FileInputStream", "(", "file", ")", ";", "}" ]
Open a new content stream. @param item the content item @return the content stream
[ "Open", "a", "new", "content", "stream", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/PatchContentLoader.java#L66-L72
159,084
wildfly/wildfly-core
cli/src/main/java/org/jboss/as/cli/impl/aesh/cmd/security/model/SSLSecurityBuilder.java
SSLSecurityBuilder.buildExecutableRequest
public ModelNode buildExecutableRequest(CommandContext ctx) throws Exception { try { for (FailureDescProvider h : providers) { effectiveProviders.add(h); } // In case some key-store needs to be persisted for (String ks : ksToStore) { composite.get(Util.STEPS).add(ElytronUtil.storeKeyStore(ctx, ks)); effectiveProviders.add(new FailureDescProvider() { @Override public String stepFailedDescription() { return "Storing the key-store " + ksToStore; } }); } // Final steps for (int i = 0; i < finalSteps.size(); i++) { composite.get(Util.STEPS).add(finalSteps.get(i)); effectiveProviders.add(finalProviders.get(i)); } return composite; } catch (Exception ex) { try { failureOccured(ctx, null); } catch (Exception ex2) { ex.addSuppressed(ex2); } throw ex; } }
java
public ModelNode buildExecutableRequest(CommandContext ctx) throws Exception { try { for (FailureDescProvider h : providers) { effectiveProviders.add(h); } // In case some key-store needs to be persisted for (String ks : ksToStore) { composite.get(Util.STEPS).add(ElytronUtil.storeKeyStore(ctx, ks)); effectiveProviders.add(new FailureDescProvider() { @Override public String stepFailedDescription() { return "Storing the key-store " + ksToStore; } }); } // Final steps for (int i = 0; i < finalSteps.size(); i++) { composite.get(Util.STEPS).add(finalSteps.get(i)); effectiveProviders.add(finalProviders.get(i)); } return composite; } catch (Exception ex) { try { failureOccured(ctx, null); } catch (Exception ex2) { ex.addSuppressed(ex2); } throw ex; } }
[ "public", "ModelNode", "buildExecutableRequest", "(", "CommandContext", "ctx", ")", "throws", "Exception", "{", "try", "{", "for", "(", "FailureDescProvider", "h", ":", "providers", ")", "{", "effectiveProviders", ".", "add", "(", "h", ")", ";", "}", "// In case some key-store needs to be persisted", "for", "(", "String", "ks", ":", "ksToStore", ")", "{", "composite", ".", "get", "(", "Util", ".", "STEPS", ")", ".", "add", "(", "ElytronUtil", ".", "storeKeyStore", "(", "ctx", ",", "ks", ")", ")", ";", "effectiveProviders", ".", "add", "(", "new", "FailureDescProvider", "(", ")", "{", "@", "Override", "public", "String", "stepFailedDescription", "(", ")", "{", "return", "\"Storing the key-store \"", "+", "ksToStore", ";", "}", "}", ")", ";", "}", "// Final steps", "for", "(", "int", "i", "=", "0", ";", "i", "<", "finalSteps", ".", "size", "(", ")", ";", "i", "++", ")", "{", "composite", ".", "get", "(", "Util", ".", "STEPS", ")", ".", "add", "(", "finalSteps", ".", "get", "(", "i", ")", ")", ";", "effectiveProviders", ".", "add", "(", "finalProviders", ".", "get", "(", "i", ")", ")", ";", "}", "return", "composite", ";", "}", "catch", "(", "Exception", "ex", ")", "{", "try", "{", "failureOccured", "(", "ctx", ",", "null", ")", ";", "}", "catch", "(", "Exception", "ex2", ")", "{", "ex", ".", "addSuppressed", "(", "ex2", ")", ";", "}", "throw", "ex", ";", "}", "}" ]
Sort and order steps to avoid unwanted generation
[ "Sort", "and", "order", "steps", "to", "avoid", "unwanted", "generation" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/impl/aesh/cmd/security/model/SSLSecurityBuilder.java#L100-L129
159,085
wildfly/wildfly-core
server/src/main/java/org/jboss/as/server/deployment/module/ManifestAttachmentProcessor.java
ManifestAttachmentProcessor.deploy
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); List<ResourceRoot> resourceRoots = DeploymentUtils.allResourceRoots(deploymentUnit); for (ResourceRoot resourceRoot : resourceRoots) { if (IgnoreMetaInfMarker.isIgnoreMetaInf(resourceRoot)) { continue; } Manifest manifest = getManifest(resourceRoot); if (manifest != null) resourceRoot.putAttachment(Attachments.MANIFEST, manifest); } }
java
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); List<ResourceRoot> resourceRoots = DeploymentUtils.allResourceRoots(deploymentUnit); for (ResourceRoot resourceRoot : resourceRoots) { if (IgnoreMetaInfMarker.isIgnoreMetaInf(resourceRoot)) { continue; } Manifest manifest = getManifest(resourceRoot); if (manifest != null) resourceRoot.putAttachment(Attachments.MANIFEST, manifest); } }
[ "@", "Override", "public", "void", "deploy", "(", "DeploymentPhaseContext", "phaseContext", ")", "throws", "DeploymentUnitProcessingException", "{", "final", "DeploymentUnit", "deploymentUnit", "=", "phaseContext", ".", "getDeploymentUnit", "(", ")", ";", "List", "<", "ResourceRoot", ">", "resourceRoots", "=", "DeploymentUtils", ".", "allResourceRoots", "(", "deploymentUnit", ")", ";", "for", "(", "ResourceRoot", "resourceRoot", ":", "resourceRoots", ")", "{", "if", "(", "IgnoreMetaInfMarker", ".", "isIgnoreMetaInf", "(", "resourceRoot", ")", ")", "{", "continue", ";", "}", "Manifest", "manifest", "=", "getManifest", "(", "resourceRoot", ")", ";", "if", "(", "manifest", "!=", "null", ")", "resourceRoot", ".", "putAttachment", "(", "Attachments", ".", "MANIFEST", ",", "manifest", ")", ";", "}", "}" ]
Process the deployment root for the manifest. @param phaseContext the deployment unit context @throws DeploymentUnitProcessingException
[ "Process", "the", "deployment", "root", "for", "the", "manifest", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/module/ManifestAttachmentProcessor.java#L56-L69
159,086
wildfly/wildfly-core
elytron/src/main/java/org/wildfly/extension/elytron/MapperParser.java
MapperParser.getSimpleMapperParser
private PersistentResourceXMLDescription getSimpleMapperParser() { if (version.equals(Version.VERSION_1_0)) { return simpleMapperParser_1_0; } else if (version.equals(Version.VERSION_1_1)) { return simpleMapperParser_1_1; } return simpleMapperParser; }
java
private PersistentResourceXMLDescription getSimpleMapperParser() { if (version.equals(Version.VERSION_1_0)) { return simpleMapperParser_1_0; } else if (version.equals(Version.VERSION_1_1)) { return simpleMapperParser_1_1; } return simpleMapperParser; }
[ "private", "PersistentResourceXMLDescription", "getSimpleMapperParser", "(", ")", "{", "if", "(", "version", ".", "equals", "(", "Version", ".", "VERSION_1_0", ")", ")", "{", "return", "simpleMapperParser_1_0", ";", "}", "else", "if", "(", "version", ".", "equals", "(", "Version", ".", "VERSION_1_1", ")", ")", "{", "return", "simpleMapperParser_1_1", ";", "}", "return", "simpleMapperParser", ";", "}" ]
1.0 version of parser is different at simple mapperParser
[ "1", ".", "0", "version", "of", "parser", "is", "different", "at", "simple", "mapperParser" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/elytron/src/main/java/org/wildfly/extension/elytron/MapperParser.java#L235-L242
159,087
wildfly/wildfly-core
server/src/main/java/org/jboss/as/server/deployment/DeploymentUtils.java
DeploymentUtils.getTopDeploymentUnit
public static DeploymentUnit getTopDeploymentUnit(DeploymentUnit unit) { Assert.checkNotNullParam("unit", unit); DeploymentUnit parent = unit.getParent(); while (parent != null) { unit = parent; parent = unit.getParent(); } return unit; }
java
public static DeploymentUnit getTopDeploymentUnit(DeploymentUnit unit) { Assert.checkNotNullParam("unit", unit); DeploymentUnit parent = unit.getParent(); while (parent != null) { unit = parent; parent = unit.getParent(); } return unit; }
[ "public", "static", "DeploymentUnit", "getTopDeploymentUnit", "(", "DeploymentUnit", "unit", ")", "{", "Assert", ".", "checkNotNullParam", "(", "\"unit\"", ",", "unit", ")", ";", "DeploymentUnit", "parent", "=", "unit", ".", "getParent", "(", ")", ";", "while", "(", "parent", "!=", "null", ")", "{", "unit", "=", "parent", ";", "parent", "=", "unit", ".", "getParent", "(", ")", ";", "}", "return", "unit", ";", "}" ]
Get top deployment unit. @param unit the current deployment unit @return top deployment unit
[ "Get", "top", "deployment", "unit", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/DeploymentUtils.java#L80-L89
159,088
wildfly/wildfly-core
host-controller/src/main/java/org/jboss/as/host/controller/RemoteDomainConnection.java
RemoteDomainConnection.openConnection
protected Connection openConnection() throws IOException { // Perhaps this can just be done once? CallbackHandler callbackHandler = null; SSLContext sslContext = null; if (realm != null) { sslContext = realm.getSSLContext(); CallbackHandlerFactory handlerFactory = realm.getSecretCallbackHandlerFactory(); if (handlerFactory != null) { String username = this.username != null ? this.username : localHostName; callbackHandler = handlerFactory.getCallbackHandler(username); } } final ProtocolConnectionConfiguration config = ProtocolConnectionConfiguration.copy(configuration); config.setCallbackHandler(callbackHandler); config.setSslContext(sslContext); config.setUri(uri); AuthenticationContext authenticationContext = this.authenticationContext != null ? this.authenticationContext : AuthenticationContext.captureCurrent(); // Connect try { return authenticationContext.run((PrivilegedExceptionAction<Connection>) () -> ProtocolConnectionUtils.connectSync(config)); } catch (PrivilegedActionException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e); } }
java
protected Connection openConnection() throws IOException { // Perhaps this can just be done once? CallbackHandler callbackHandler = null; SSLContext sslContext = null; if (realm != null) { sslContext = realm.getSSLContext(); CallbackHandlerFactory handlerFactory = realm.getSecretCallbackHandlerFactory(); if (handlerFactory != null) { String username = this.username != null ? this.username : localHostName; callbackHandler = handlerFactory.getCallbackHandler(username); } } final ProtocolConnectionConfiguration config = ProtocolConnectionConfiguration.copy(configuration); config.setCallbackHandler(callbackHandler); config.setSslContext(sslContext); config.setUri(uri); AuthenticationContext authenticationContext = this.authenticationContext != null ? this.authenticationContext : AuthenticationContext.captureCurrent(); // Connect try { return authenticationContext.run((PrivilegedExceptionAction<Connection>) () -> ProtocolConnectionUtils.connectSync(config)); } catch (PrivilegedActionException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e); } }
[ "protected", "Connection", "openConnection", "(", ")", "throws", "IOException", "{", "// Perhaps this can just be done once?", "CallbackHandler", "callbackHandler", "=", "null", ";", "SSLContext", "sslContext", "=", "null", ";", "if", "(", "realm", "!=", "null", ")", "{", "sslContext", "=", "realm", ".", "getSSLContext", "(", ")", ";", "CallbackHandlerFactory", "handlerFactory", "=", "realm", ".", "getSecretCallbackHandlerFactory", "(", ")", ";", "if", "(", "handlerFactory", "!=", "null", ")", "{", "String", "username", "=", "this", ".", "username", "!=", "null", "?", "this", ".", "username", ":", "localHostName", ";", "callbackHandler", "=", "handlerFactory", ".", "getCallbackHandler", "(", "username", ")", ";", "}", "}", "final", "ProtocolConnectionConfiguration", "config", "=", "ProtocolConnectionConfiguration", ".", "copy", "(", "configuration", ")", ";", "config", ".", "setCallbackHandler", "(", "callbackHandler", ")", ";", "config", ".", "setSslContext", "(", "sslContext", ")", ";", "config", ".", "setUri", "(", "uri", ")", ";", "AuthenticationContext", "authenticationContext", "=", "this", ".", "authenticationContext", "!=", "null", "?", "this", ".", "authenticationContext", ":", "AuthenticationContext", ".", "captureCurrent", "(", ")", ";", "// Connect", "try", "{", "return", "authenticationContext", ".", "run", "(", "(", "PrivilegedExceptionAction", "<", "Connection", ">", ")", "(", ")", "->", "ProtocolConnectionUtils", ".", "connectSync", "(", "config", ")", ")", ";", "}", "catch", "(", "PrivilegedActionException", "e", ")", "{", "if", "(", "e", ".", "getCause", "(", ")", "instanceof", "IOException", ")", "{", "throw", "(", "IOException", ")", "e", ".", "getCause", "(", ")", ";", "}", "throw", "new", "IOException", "(", "e", ")", ";", "}", "}" ]
Connect and register at the remote domain controller. @return connection the established connection @throws IOException
[ "Connect", "and", "register", "at", "the", "remote", "domain", "controller", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/RemoteDomainConnection.java#L202-L230
159,089
wildfly/wildfly-core
host-controller/src/main/java/org/jboss/as/host/controller/RemoteDomainConnection.java
RemoteDomainConnection.applyDomainModel
boolean applyDomainModel(ModelNode result) { if(! result.hasDefined(ModelDescriptionConstants.RESULT)) { return false; } final List<ModelNode> bootOperations= result.get(ModelDescriptionConstants.RESULT).asList(); return callback.applyDomainModel(bootOperations); }
java
boolean applyDomainModel(ModelNode result) { if(! result.hasDefined(ModelDescriptionConstants.RESULT)) { return false; } final List<ModelNode> bootOperations= result.get(ModelDescriptionConstants.RESULT).asList(); return callback.applyDomainModel(bootOperations); }
[ "boolean", "applyDomainModel", "(", "ModelNode", "result", ")", "{", "if", "(", "!", "result", ".", "hasDefined", "(", "ModelDescriptionConstants", ".", "RESULT", ")", ")", "{", "return", "false", ";", "}", "final", "List", "<", "ModelNode", ">", "bootOperations", "=", "result", ".", "get", "(", "ModelDescriptionConstants", ".", "RESULT", ")", ".", "asList", "(", ")", ";", "return", "callback", ".", "applyDomainModel", "(", "bootOperations", ")", ";", "}" ]
Apply the remote read domain model result. @param result the domain model result @return whether it was applied successfully or not
[ "Apply", "the", "remote", "read", "domain", "model", "result", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/RemoteDomainConnection.java#L320-L326
159,090
wildfly/wildfly-core
launcher/src/main/java/org/wildfly/core/launcher/ProcessHelper.java
ProcessHelper.addShutdownHook
public static Thread addShutdownHook(final Process process) { final Thread thread = new Thread(new Runnable() { @Override public void run() { if (process != null) { process.destroy(); try { process.waitFor(); } catch (InterruptedException e) { throw new RuntimeException(e); } } } }); thread.setDaemon(true); Runtime.getRuntime().addShutdownHook(thread); return thread; }
java
public static Thread addShutdownHook(final Process process) { final Thread thread = new Thread(new Runnable() { @Override public void run() { if (process != null) { process.destroy(); try { process.waitFor(); } catch (InterruptedException e) { throw new RuntimeException(e); } } } }); thread.setDaemon(true); Runtime.getRuntime().addShutdownHook(thread); return thread; }
[ "public", "static", "Thread", "addShutdownHook", "(", "final", "Process", "process", ")", "{", "final", "Thread", "thread", "=", "new", "Thread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "if", "(", "process", "!=", "null", ")", "{", "process", ".", "destroy", "(", ")", ";", "try", "{", "process", ".", "waitFor", "(", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "throw", "new", "RuntimeException", "(", "e", ")", ";", "}", "}", "}", "}", ")", ";", "thread", ".", "setDaemon", "(", "true", ")", ";", "Runtime", ".", "getRuntime", "(", ")", ".", "addShutdownHook", "(", "thread", ")", ";", "return", "thread", ";", "}" ]
Adds a shutdown hook for the process. @param process the process to add a shutdown hook for @return the thread set as the shutdown hook @throws java.lang.SecurityException If a security manager is present and it denies {@link java.lang.RuntimePermission <code>RuntimePermission("shutdownHooks")</code>}
[ "Adds", "a", "shutdown", "hook", "for", "the", "process", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/ProcessHelper.java#L73-L90
159,091
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/operations/common/OrderedChildTypesAttachment.java
OrderedChildTypesAttachment.addOrderedChildResourceTypes
public void addOrderedChildResourceTypes(PathAddress resourceAddress, Resource resource) { Set<String> orderedChildTypes = resource.getOrderedChildTypes(); if (orderedChildTypes.size() > 0) { orderedChildren.put(resourceAddress, resource.getOrderedChildTypes()); } }
java
public void addOrderedChildResourceTypes(PathAddress resourceAddress, Resource resource) { Set<String> orderedChildTypes = resource.getOrderedChildTypes(); if (orderedChildTypes.size() > 0) { orderedChildren.put(resourceAddress, resource.getOrderedChildTypes()); } }
[ "public", "void", "addOrderedChildResourceTypes", "(", "PathAddress", "resourceAddress", ",", "Resource", "resource", ")", "{", "Set", "<", "String", ">", "orderedChildTypes", "=", "resource", ".", "getOrderedChildTypes", "(", ")", ";", "if", "(", "orderedChildTypes", ".", "size", "(", ")", ">", "0", ")", "{", "orderedChildren", ".", "put", "(", "resourceAddress", ",", "resource", ".", "getOrderedChildTypes", "(", ")", ")", ";", "}", "}" ]
If the resource has ordered child types, those child types will be stored in the attachment. If there are no ordered child types, this method is a no-op. @param resourceAddress the address of the resource @param resource the resource which may or may not have ordered children.
[ "If", "the", "resource", "has", "ordered", "child", "types", "those", "child", "types", "will", "be", "stored", "in", "the", "attachment", ".", "If", "there", "are", "no", "ordered", "child", "types", "this", "method", "is", "a", "no", "-", "op", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/operations/common/OrderedChildTypesAttachment.java#L32-L37
159,092
wildfly/wildfly-core
controller-client/src/main/java/org/jboss/as/controller/client/helpers/domain/impl/DeploymentPlanResultImpl.java
DeploymentPlanResultImpl.buildServerGroupResults
private static Map<String, ServerGroupDeploymentPlanResult> buildServerGroupResults(Map<UUID, DeploymentActionResult> deploymentActionResults) { Map<String, ServerGroupDeploymentPlanResult> serverGroupResults = new HashMap<String, ServerGroupDeploymentPlanResult>(); for (Map.Entry<UUID, DeploymentActionResult> entry : deploymentActionResults.entrySet()) { UUID actionId = entry.getKey(); DeploymentActionResult actionResult = entry.getValue(); Map<String, ServerGroupDeploymentActionResult> actionResultsByServerGroup = actionResult.getResultsByServerGroup(); for (ServerGroupDeploymentActionResult serverGroupActionResult : actionResultsByServerGroup.values()) { String serverGroupName = serverGroupActionResult.getServerGroupName(); ServerGroupDeploymentPlanResultImpl sgdpr = (ServerGroupDeploymentPlanResultImpl) serverGroupResults.get(serverGroupName); if (sgdpr == null) { sgdpr = new ServerGroupDeploymentPlanResultImpl(serverGroupName); serverGroupResults.put(serverGroupName, sgdpr); } for (Map.Entry<String, ServerUpdateResult> serverEntry : serverGroupActionResult.getResultByServer().entrySet()) { String serverName = serverEntry.getKey(); ServerUpdateResult sud = serverEntry.getValue(); ServerDeploymentPlanResultImpl sdpr = (ServerDeploymentPlanResultImpl) sgdpr.getServerResult(serverName); if (sdpr == null) { sdpr = new ServerDeploymentPlanResultImpl(serverName); sgdpr.storeServerResult(serverName, sdpr); } sdpr.storeServerUpdateResult(actionId, sud); } } } return serverGroupResults; }
java
private static Map<String, ServerGroupDeploymentPlanResult> buildServerGroupResults(Map<UUID, DeploymentActionResult> deploymentActionResults) { Map<String, ServerGroupDeploymentPlanResult> serverGroupResults = new HashMap<String, ServerGroupDeploymentPlanResult>(); for (Map.Entry<UUID, DeploymentActionResult> entry : deploymentActionResults.entrySet()) { UUID actionId = entry.getKey(); DeploymentActionResult actionResult = entry.getValue(); Map<String, ServerGroupDeploymentActionResult> actionResultsByServerGroup = actionResult.getResultsByServerGroup(); for (ServerGroupDeploymentActionResult serverGroupActionResult : actionResultsByServerGroup.values()) { String serverGroupName = serverGroupActionResult.getServerGroupName(); ServerGroupDeploymentPlanResultImpl sgdpr = (ServerGroupDeploymentPlanResultImpl) serverGroupResults.get(serverGroupName); if (sgdpr == null) { sgdpr = new ServerGroupDeploymentPlanResultImpl(serverGroupName); serverGroupResults.put(serverGroupName, sgdpr); } for (Map.Entry<String, ServerUpdateResult> serverEntry : serverGroupActionResult.getResultByServer().entrySet()) { String serverName = serverEntry.getKey(); ServerUpdateResult sud = serverEntry.getValue(); ServerDeploymentPlanResultImpl sdpr = (ServerDeploymentPlanResultImpl) sgdpr.getServerResult(serverName); if (sdpr == null) { sdpr = new ServerDeploymentPlanResultImpl(serverName); sgdpr.storeServerResult(serverName, sdpr); } sdpr.storeServerUpdateResult(actionId, sud); } } } return serverGroupResults; }
[ "private", "static", "Map", "<", "String", ",", "ServerGroupDeploymentPlanResult", ">", "buildServerGroupResults", "(", "Map", "<", "UUID", ",", "DeploymentActionResult", ">", "deploymentActionResults", ")", "{", "Map", "<", "String", ",", "ServerGroupDeploymentPlanResult", ">", "serverGroupResults", "=", "new", "HashMap", "<", "String", ",", "ServerGroupDeploymentPlanResult", ">", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "UUID", ",", "DeploymentActionResult", ">", "entry", ":", "deploymentActionResults", ".", "entrySet", "(", ")", ")", "{", "UUID", "actionId", "=", "entry", ".", "getKey", "(", ")", ";", "DeploymentActionResult", "actionResult", "=", "entry", ".", "getValue", "(", ")", ";", "Map", "<", "String", ",", "ServerGroupDeploymentActionResult", ">", "actionResultsByServerGroup", "=", "actionResult", ".", "getResultsByServerGroup", "(", ")", ";", "for", "(", "ServerGroupDeploymentActionResult", "serverGroupActionResult", ":", "actionResultsByServerGroup", ".", "values", "(", ")", ")", "{", "String", "serverGroupName", "=", "serverGroupActionResult", ".", "getServerGroupName", "(", ")", ";", "ServerGroupDeploymentPlanResultImpl", "sgdpr", "=", "(", "ServerGroupDeploymentPlanResultImpl", ")", "serverGroupResults", ".", "get", "(", "serverGroupName", ")", ";", "if", "(", "sgdpr", "==", "null", ")", "{", "sgdpr", "=", "new", "ServerGroupDeploymentPlanResultImpl", "(", "serverGroupName", ")", ";", "serverGroupResults", ".", "put", "(", "serverGroupName", ",", "sgdpr", ")", ";", "}", "for", "(", "Map", ".", "Entry", "<", "String", ",", "ServerUpdateResult", ">", "serverEntry", ":", "serverGroupActionResult", ".", "getResultByServer", "(", ")", ".", "entrySet", "(", ")", ")", "{", "String", "serverName", "=", "serverEntry", ".", "getKey", "(", ")", ";", "ServerUpdateResult", "sud", "=", "serverEntry", ".", "getValue", "(", ")", ";", "ServerDeploymentPlanResultImpl", "sdpr", "=", "(", "ServerDeploymentPlanResultImpl", ")", "sgdpr", ".", "getServerResult", "(", "serverName", ")", ";", "if", "(", "sdpr", "==", "null", ")", "{", "sdpr", "=", "new", "ServerDeploymentPlanResultImpl", "(", "serverName", ")", ";", "sgdpr", ".", "storeServerResult", "(", "serverName", ",", "sdpr", ")", ";", "}", "sdpr", ".", "storeServerUpdateResult", "(", "actionId", ",", "sud", ")", ";", "}", "}", "}", "return", "serverGroupResults", ";", "}" ]
Builds the data structures that show the effects of the plan by server group
[ "Builds", "the", "data", "structures", "that", "show", "the", "effects", "of", "the", "plan", "by", "server", "group" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller-client/src/main/java/org/jboss/as/controller/client/helpers/domain/impl/DeploymentPlanResultImpl.java#L102-L133
159,093
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/transform/description/AbstractTransformationDescriptionBuilder.java
AbstractTransformationDescriptionBuilder.buildDefault
protected TransformationDescription buildDefault(final DiscardPolicy discardPolicy, boolean inherited, final AttributeTransformationDescriptionBuilderImpl.AttributeTransformationDescriptionBuilderRegistry registry, List<String> discardedOperations) { // Build attribute rules final Map<String, AttributeTransformationDescription> attributes = registry.buildAttributes(); // Create operation transformers final Map<String, OperationTransformer> operations = buildOperationTransformers(registry); // Process children final List<TransformationDescription> children = buildChildren(); if (discardPolicy == DiscardPolicy.NEVER) { // TODO override more global operations? if(! operations.containsKey(ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION)) { operations.put(ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION, OperationTransformationRules.createWriteOperation(attributes)); } if(! operations.containsKey(ModelDescriptionConstants.UNDEFINE_ATTRIBUTE_OPERATION)) { operations.put(ModelDescriptionConstants.UNDEFINE_ATTRIBUTE_OPERATION, OperationTransformationRules.createUndefinedOperation(attributes)); } } // Create the description Set<String> discarded = new HashSet<>(); discarded.addAll(discardedOperations); return new TransformingDescription(pathElement, pathAddressTransformer, discardPolicy, inherited, resourceTransformer, attributes, operations, children, discarded, dynamicDiscardPolicy); }
java
protected TransformationDescription buildDefault(final DiscardPolicy discardPolicy, boolean inherited, final AttributeTransformationDescriptionBuilderImpl.AttributeTransformationDescriptionBuilderRegistry registry, List<String> discardedOperations) { // Build attribute rules final Map<String, AttributeTransformationDescription> attributes = registry.buildAttributes(); // Create operation transformers final Map<String, OperationTransformer> operations = buildOperationTransformers(registry); // Process children final List<TransformationDescription> children = buildChildren(); if (discardPolicy == DiscardPolicy.NEVER) { // TODO override more global operations? if(! operations.containsKey(ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION)) { operations.put(ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION, OperationTransformationRules.createWriteOperation(attributes)); } if(! operations.containsKey(ModelDescriptionConstants.UNDEFINE_ATTRIBUTE_OPERATION)) { operations.put(ModelDescriptionConstants.UNDEFINE_ATTRIBUTE_OPERATION, OperationTransformationRules.createUndefinedOperation(attributes)); } } // Create the description Set<String> discarded = new HashSet<>(); discarded.addAll(discardedOperations); return new TransformingDescription(pathElement, pathAddressTransformer, discardPolicy, inherited, resourceTransformer, attributes, operations, children, discarded, dynamicDiscardPolicy); }
[ "protected", "TransformationDescription", "buildDefault", "(", "final", "DiscardPolicy", "discardPolicy", ",", "boolean", "inherited", ",", "final", "AttributeTransformationDescriptionBuilderImpl", ".", "AttributeTransformationDescriptionBuilderRegistry", "registry", ",", "List", "<", "String", ">", "discardedOperations", ")", "{", "// Build attribute rules", "final", "Map", "<", "String", ",", "AttributeTransformationDescription", ">", "attributes", "=", "registry", ".", "buildAttributes", "(", ")", ";", "// Create operation transformers", "final", "Map", "<", "String", ",", "OperationTransformer", ">", "operations", "=", "buildOperationTransformers", "(", "registry", ")", ";", "// Process children", "final", "List", "<", "TransformationDescription", ">", "children", "=", "buildChildren", "(", ")", ";", "if", "(", "discardPolicy", "==", "DiscardPolicy", ".", "NEVER", ")", "{", "// TODO override more global operations?", "if", "(", "!", "operations", ".", "containsKey", "(", "ModelDescriptionConstants", ".", "WRITE_ATTRIBUTE_OPERATION", ")", ")", "{", "operations", ".", "put", "(", "ModelDescriptionConstants", ".", "WRITE_ATTRIBUTE_OPERATION", ",", "OperationTransformationRules", ".", "createWriteOperation", "(", "attributes", ")", ")", ";", "}", "if", "(", "!", "operations", ".", "containsKey", "(", "ModelDescriptionConstants", ".", "UNDEFINE_ATTRIBUTE_OPERATION", ")", ")", "{", "operations", ".", "put", "(", "ModelDescriptionConstants", ".", "UNDEFINE_ATTRIBUTE_OPERATION", ",", "OperationTransformationRules", ".", "createUndefinedOperation", "(", "attributes", ")", ")", ";", "}", "}", "// Create the description", "Set", "<", "String", ">", "discarded", "=", "new", "HashSet", "<>", "(", ")", ";", "discarded", ".", "addAll", "(", "discardedOperations", ")", ";", "return", "new", "TransformingDescription", "(", "pathElement", ",", "pathAddressTransformer", ",", "discardPolicy", ",", "inherited", ",", "resourceTransformer", ",", "attributes", ",", "operations", ",", "children", ",", "discarded", ",", "dynamicDiscardPolicy", ")", ";", "}" ]
Build the default transformation description. @param discardPolicy the discard policy to use @param inherited whether the definition is inherited @param registry the attribute transformation rules for the resource @param discardedOperations the discarded operations @return the transformation description
[ "Build", "the", "default", "transformation", "description", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/description/AbstractTransformationDescriptionBuilder.java#L87-L109
159,094
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/transform/description/AbstractTransformationDescriptionBuilder.java
AbstractTransformationDescriptionBuilder.buildOperationTransformers
protected Map<String, OperationTransformer> buildOperationTransformers(AttributeTransformationDescriptionBuilderImpl.AttributeTransformationDescriptionBuilderRegistry registry) { final Map<String, OperationTransformer> operations = new HashMap<String, OperationTransformer>(); for(final Map.Entry<String, OperationTransformationEntry> entry: operationTransformers.entrySet()) { final OperationTransformer transformer = entry.getValue().getOperationTransformer(registry); operations.put(entry.getKey(), transformer); } return operations; }
java
protected Map<String, OperationTransformer> buildOperationTransformers(AttributeTransformationDescriptionBuilderImpl.AttributeTransformationDescriptionBuilderRegistry registry) { final Map<String, OperationTransformer> operations = new HashMap<String, OperationTransformer>(); for(final Map.Entry<String, OperationTransformationEntry> entry: operationTransformers.entrySet()) { final OperationTransformer transformer = entry.getValue().getOperationTransformer(registry); operations.put(entry.getKey(), transformer); } return operations; }
[ "protected", "Map", "<", "String", ",", "OperationTransformer", ">", "buildOperationTransformers", "(", "AttributeTransformationDescriptionBuilderImpl", ".", "AttributeTransformationDescriptionBuilderRegistry", "registry", ")", "{", "final", "Map", "<", "String", ",", "OperationTransformer", ">", "operations", "=", "new", "HashMap", "<", "String", ",", "OperationTransformer", ">", "(", ")", ";", "for", "(", "final", "Map", ".", "Entry", "<", "String", ",", "OperationTransformationEntry", ">", "entry", ":", "operationTransformers", ".", "entrySet", "(", ")", ")", "{", "final", "OperationTransformer", "transformer", "=", "entry", ".", "getValue", "(", ")", ".", "getOperationTransformer", "(", "registry", ")", ";", "operations", ".", "put", "(", "entry", ".", "getKey", "(", ")", ",", "transformer", ")", ";", "}", "return", "operations", ";", "}" ]
Build the operation transformers. @param registry the shared resource registry @return the operation transformers
[ "Build", "the", "operation", "transformers", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/description/AbstractTransformationDescriptionBuilder.java#L117-L124
159,095
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/transform/description/AbstractTransformationDescriptionBuilder.java
AbstractTransformationDescriptionBuilder.buildChildren
protected List<TransformationDescription> buildChildren() { if(children.isEmpty()) { return Collections.emptyList(); } final List<TransformationDescription> children = new ArrayList<TransformationDescription>(); for(final TransformationDescriptionBuilder builder : this.children) { children.add(builder.build()); } return children; }
java
protected List<TransformationDescription> buildChildren() { if(children.isEmpty()) { return Collections.emptyList(); } final List<TransformationDescription> children = new ArrayList<TransformationDescription>(); for(final TransformationDescriptionBuilder builder : this.children) { children.add(builder.build()); } return children; }
[ "protected", "List", "<", "TransformationDescription", ">", "buildChildren", "(", ")", "{", "if", "(", "children", ".", "isEmpty", "(", ")", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "final", "List", "<", "TransformationDescription", ">", "children", "=", "new", "ArrayList", "<", "TransformationDescription", ">", "(", ")", ";", "for", "(", "final", "TransformationDescriptionBuilder", "builder", ":", "this", ".", "children", ")", "{", "children", ".", "add", "(", "builder", ".", "build", "(", ")", ")", ";", "}", "return", "children", ";", "}" ]
Build all children. @return the child descriptions
[ "Build", "all", "children", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/description/AbstractTransformationDescriptionBuilder.java#L131-L140
159,096
wildfly/wildfly-core
remoting/subsystem/src/main/java/org/jboss/as/remoting/EndpointConfigFactory.java
EndpointConfigFactory.create
@Deprecated public static OptionMap create(final ExpressionResolver resolver, final ModelNode model, final OptionMap defaults) throws OperationFailedException { final OptionMap map = OptionMap.builder() .addAll(defaults) .set(Options.WORKER_READ_THREADS, RemotingSubsystemRootResource.WORKER_READ_THREADS.resolveModelAttribute(resolver, model).asInt()) .set(Options.WORKER_TASK_CORE_THREADS, RemotingSubsystemRootResource.WORKER_TASK_CORE_THREADS.resolveModelAttribute(resolver, model).asInt()) .set(Options.WORKER_TASK_KEEPALIVE, RemotingSubsystemRootResource.WORKER_TASK_KEEPALIVE.resolveModelAttribute(resolver, model).asInt()) .set(Options.WORKER_TASK_LIMIT, RemotingSubsystemRootResource.WORKER_TASK_LIMIT.resolveModelAttribute(resolver, model).asInt()) .set(Options.WORKER_TASK_MAX_THREADS, RemotingSubsystemRootResource.WORKER_TASK_MAX_THREADS.resolveModelAttribute(resolver, model).asInt()) .set(Options.WORKER_WRITE_THREADS, RemotingSubsystemRootResource.WORKER_WRITE_THREADS.resolveModelAttribute(resolver, model).asInt()) .set(Options.WORKER_READ_THREADS, RemotingSubsystemRootResource.WORKER_READ_THREADS.resolveModelAttribute(resolver, model).asInt()) .getMap(); return map; }
java
@Deprecated public static OptionMap create(final ExpressionResolver resolver, final ModelNode model, final OptionMap defaults) throws OperationFailedException { final OptionMap map = OptionMap.builder() .addAll(defaults) .set(Options.WORKER_READ_THREADS, RemotingSubsystemRootResource.WORKER_READ_THREADS.resolveModelAttribute(resolver, model).asInt()) .set(Options.WORKER_TASK_CORE_THREADS, RemotingSubsystemRootResource.WORKER_TASK_CORE_THREADS.resolveModelAttribute(resolver, model).asInt()) .set(Options.WORKER_TASK_KEEPALIVE, RemotingSubsystemRootResource.WORKER_TASK_KEEPALIVE.resolveModelAttribute(resolver, model).asInt()) .set(Options.WORKER_TASK_LIMIT, RemotingSubsystemRootResource.WORKER_TASK_LIMIT.resolveModelAttribute(resolver, model).asInt()) .set(Options.WORKER_TASK_MAX_THREADS, RemotingSubsystemRootResource.WORKER_TASK_MAX_THREADS.resolveModelAttribute(resolver, model).asInt()) .set(Options.WORKER_WRITE_THREADS, RemotingSubsystemRootResource.WORKER_WRITE_THREADS.resolveModelAttribute(resolver, model).asInt()) .set(Options.WORKER_READ_THREADS, RemotingSubsystemRootResource.WORKER_READ_THREADS.resolveModelAttribute(resolver, model).asInt()) .getMap(); return map; }
[ "@", "Deprecated", "public", "static", "OptionMap", "create", "(", "final", "ExpressionResolver", "resolver", ",", "final", "ModelNode", "model", ",", "final", "OptionMap", "defaults", ")", "throws", "OperationFailedException", "{", "final", "OptionMap", "map", "=", "OptionMap", ".", "builder", "(", ")", ".", "addAll", "(", "defaults", ")", ".", "set", "(", "Options", ".", "WORKER_READ_THREADS", ",", "RemotingSubsystemRootResource", ".", "WORKER_READ_THREADS", ".", "resolveModelAttribute", "(", "resolver", ",", "model", ")", ".", "asInt", "(", ")", ")", ".", "set", "(", "Options", ".", "WORKER_TASK_CORE_THREADS", ",", "RemotingSubsystemRootResource", ".", "WORKER_TASK_CORE_THREADS", ".", "resolveModelAttribute", "(", "resolver", ",", "model", ")", ".", "asInt", "(", ")", ")", ".", "set", "(", "Options", ".", "WORKER_TASK_KEEPALIVE", ",", "RemotingSubsystemRootResource", ".", "WORKER_TASK_KEEPALIVE", ".", "resolveModelAttribute", "(", "resolver", ",", "model", ")", ".", "asInt", "(", ")", ")", ".", "set", "(", "Options", ".", "WORKER_TASK_LIMIT", ",", "RemotingSubsystemRootResource", ".", "WORKER_TASK_LIMIT", ".", "resolveModelAttribute", "(", "resolver", ",", "model", ")", ".", "asInt", "(", ")", ")", ".", "set", "(", "Options", ".", "WORKER_TASK_MAX_THREADS", ",", "RemotingSubsystemRootResource", ".", "WORKER_TASK_MAX_THREADS", ".", "resolveModelAttribute", "(", "resolver", ",", "model", ")", ".", "asInt", "(", ")", ")", ".", "set", "(", "Options", ".", "WORKER_WRITE_THREADS", ",", "RemotingSubsystemRootResource", ".", "WORKER_WRITE_THREADS", ".", "resolveModelAttribute", "(", "resolver", ",", "model", ")", ".", "asInt", "(", ")", ")", ".", "set", "(", "Options", ".", "WORKER_READ_THREADS", ",", "RemotingSubsystemRootResource", ".", "WORKER_READ_THREADS", ".", "resolveModelAttribute", "(", "resolver", ",", "model", ")", ".", "asInt", "(", ")", ")", ".", "getMap", "(", ")", ";", "return", "map", ";", "}" ]
creates option map for remoting connections @param resolver @param model @param defaults @return @throws OperationFailedException @deprecated configuring xnio worker options is no longer supported and should be replaced for referencing IO subsystem
[ "creates", "option", "map", "for", "remoting", "connections" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/remoting/subsystem/src/main/java/org/jboss/as/remoting/EndpointConfigFactory.java#L61-L74
159,097
wildfly/wildfly-core
elytron/src/main/java/org/wildfly/extension/elytron/ElytronSubsystemParser2_0.java
ElytronSubsystemParser2_0.getParserDescription
@Override public PersistentResourceXMLDescription getParserDescription() { return PersistentResourceXMLDescription.builder(ElytronExtension.SUBSYSTEM_PATH, getNameSpace()) .addAttribute(ElytronDefinition.DEFAULT_AUTHENTICATION_CONTEXT) .addAttribute(ElytronDefinition.INITIAL_PROVIDERS) .addAttribute(ElytronDefinition.FINAL_PROVIDERS) .addAttribute(ElytronDefinition.DISALLOWED_PROVIDERS) .addAttribute(ElytronDefinition.SECURITY_PROPERTIES, new AttributeParsers.PropertiesParser(null, SECURITY_PROPERTY, true), new AttributeMarshallers.PropertiesAttributeMarshaller(null, SECURITY_PROPERTY, true)) .addChild(getAuthenticationClientParser()) .addChild(getProviderParser()) .addChild(getAuditLoggingParser()) .addChild(getDomainParser()) .addChild(getRealmParser()) .addChild(getCredentialSecurityFactoryParser()) .addChild(getMapperParser()) .addChild(getHttpParser()) .addChild(getSaslParser()) .addChild(getTlsParser()) .addChild(decorator(CREDENTIAL_STORES).addChild(new CredentialStoreParser().parser)) .addChild(getDirContextParser()) .addChild(getPolicyParser()) .build(); }
java
@Override public PersistentResourceXMLDescription getParserDescription() { return PersistentResourceXMLDescription.builder(ElytronExtension.SUBSYSTEM_PATH, getNameSpace()) .addAttribute(ElytronDefinition.DEFAULT_AUTHENTICATION_CONTEXT) .addAttribute(ElytronDefinition.INITIAL_PROVIDERS) .addAttribute(ElytronDefinition.FINAL_PROVIDERS) .addAttribute(ElytronDefinition.DISALLOWED_PROVIDERS) .addAttribute(ElytronDefinition.SECURITY_PROPERTIES, new AttributeParsers.PropertiesParser(null, SECURITY_PROPERTY, true), new AttributeMarshallers.PropertiesAttributeMarshaller(null, SECURITY_PROPERTY, true)) .addChild(getAuthenticationClientParser()) .addChild(getProviderParser()) .addChild(getAuditLoggingParser()) .addChild(getDomainParser()) .addChild(getRealmParser()) .addChild(getCredentialSecurityFactoryParser()) .addChild(getMapperParser()) .addChild(getHttpParser()) .addChild(getSaslParser()) .addChild(getTlsParser()) .addChild(decorator(CREDENTIAL_STORES).addChild(new CredentialStoreParser().parser)) .addChild(getDirContextParser()) .addChild(getPolicyParser()) .build(); }
[ "@", "Override", "public", "PersistentResourceXMLDescription", "getParserDescription", "(", ")", "{", "return", "PersistentResourceXMLDescription", ".", "builder", "(", "ElytronExtension", ".", "SUBSYSTEM_PATH", ",", "getNameSpace", "(", ")", ")", ".", "addAttribute", "(", "ElytronDefinition", ".", "DEFAULT_AUTHENTICATION_CONTEXT", ")", ".", "addAttribute", "(", "ElytronDefinition", ".", "INITIAL_PROVIDERS", ")", ".", "addAttribute", "(", "ElytronDefinition", ".", "FINAL_PROVIDERS", ")", ".", "addAttribute", "(", "ElytronDefinition", ".", "DISALLOWED_PROVIDERS", ")", ".", "addAttribute", "(", "ElytronDefinition", ".", "SECURITY_PROPERTIES", ",", "new", "AttributeParsers", ".", "PropertiesParser", "(", "null", ",", "SECURITY_PROPERTY", ",", "true", ")", ",", "new", "AttributeMarshallers", ".", "PropertiesAttributeMarshaller", "(", "null", ",", "SECURITY_PROPERTY", ",", "true", ")", ")", ".", "addChild", "(", "getAuthenticationClientParser", "(", ")", ")", ".", "addChild", "(", "getProviderParser", "(", ")", ")", ".", "addChild", "(", "getAuditLoggingParser", "(", ")", ")", ".", "addChild", "(", "getDomainParser", "(", ")", ")", ".", "addChild", "(", "getRealmParser", "(", ")", ")", ".", "addChild", "(", "getCredentialSecurityFactoryParser", "(", ")", ")", ".", "addChild", "(", "getMapperParser", "(", ")", ")", ".", "addChild", "(", "getHttpParser", "(", ")", ")", ".", "addChild", "(", "getSaslParser", "(", ")", ")", ".", "addChild", "(", "getTlsParser", "(", ")", ")", ".", "addChild", "(", "decorator", "(", "CREDENTIAL_STORES", ")", ".", "addChild", "(", "new", "CredentialStoreParser", "(", ")", ".", "parser", ")", ")", ".", "addChild", "(", "getDirContextParser", "(", ")", ")", ".", "addChild", "(", "getPolicyParser", "(", ")", ")", ".", "build", "(", ")", ";", "}" ]
at this point definition below is not really needed as it is the same as for 1.1, but it is here as place holder when subsystem parser evolves.
[ "at", "this", "point", "definition", "below", "is", "not", "really", "needed", "as", "it", "is", "the", "same", "as", "for", "1", ".", "1", "but", "it", "is", "here", "as", "place", "holder", "when", "subsystem", "parser", "evolves", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/elytron/src/main/java/org/wildfly/extension/elytron/ElytronSubsystemParser2_0.java#L43-L65
159,098
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/access/management/WritableAuthorizerConfiguration.java
WritableAuthorizerConfiguration.reset
public synchronized void reset() { this.authorizerDescription = StandardRBACAuthorizer.AUTHORIZER_DESCRIPTION; this.useIdentityRoles = this.nonFacadeMBeansSensitive = false; this.roleMappings = new HashMap<String, RoleMappingImpl>(); RoleMaps oldRoleMaps = this.roleMaps; this.roleMaps = new RoleMaps(authorizerDescription.getStandardRoles(), Collections.<String, ScopedRole>emptyMap()); for (ScopedRole role : oldRoleMaps.scopedRoles.values()) { for (ScopedRoleListener listener : scopedRoleListeners) { try { listener.scopedRoleRemoved(role); } catch (Exception ignored) { // TODO log an ERROR } } } }
java
public synchronized void reset() { this.authorizerDescription = StandardRBACAuthorizer.AUTHORIZER_DESCRIPTION; this.useIdentityRoles = this.nonFacadeMBeansSensitive = false; this.roleMappings = new HashMap<String, RoleMappingImpl>(); RoleMaps oldRoleMaps = this.roleMaps; this.roleMaps = new RoleMaps(authorizerDescription.getStandardRoles(), Collections.<String, ScopedRole>emptyMap()); for (ScopedRole role : oldRoleMaps.scopedRoles.values()) { for (ScopedRoleListener listener : scopedRoleListeners) { try { listener.scopedRoleRemoved(role); } catch (Exception ignored) { // TODO log an ERROR } } } }
[ "public", "synchronized", "void", "reset", "(", ")", "{", "this", ".", "authorizerDescription", "=", "StandardRBACAuthorizer", ".", "AUTHORIZER_DESCRIPTION", ";", "this", ".", "useIdentityRoles", "=", "this", ".", "nonFacadeMBeansSensitive", "=", "false", ";", "this", ".", "roleMappings", "=", "new", "HashMap", "<", "String", ",", "RoleMappingImpl", ">", "(", ")", ";", "RoleMaps", "oldRoleMaps", "=", "this", ".", "roleMaps", ";", "this", ".", "roleMaps", "=", "new", "RoleMaps", "(", "authorizerDescription", ".", "getStandardRoles", "(", ")", ",", "Collections", ".", "<", "String", ",", "ScopedRole", ">", "emptyMap", "(", ")", ")", ";", "for", "(", "ScopedRole", "role", ":", "oldRoleMaps", ".", "scopedRoles", ".", "values", "(", ")", ")", "{", "for", "(", "ScopedRoleListener", "listener", ":", "scopedRoleListeners", ")", "{", "try", "{", "listener", ".", "scopedRoleRemoved", "(", "role", ")", ";", "}", "catch", "(", "Exception", "ignored", ")", "{", "// TODO log an ERROR", "}", "}", "}", "}" ]
Reset the internal state of this object back to what it originally was. Used then reloading a server or in a slave host controller following a post-boot reconnect to the master.
[ "Reset", "the", "internal", "state", "of", "this", "object", "back", "to", "what", "it", "originally", "was", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/access/management/WritableAuthorizerConfiguration.java#L72-L87
159,099
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/access/management/WritableAuthorizerConfiguration.java
WritableAuthorizerConfiguration.addRoleMapping
public synchronized void addRoleMapping(final String roleName) { HashMap<String, RoleMappingImpl> newRoles = new HashMap<String, RoleMappingImpl>(roleMappings); if (newRoles.containsKey(roleName) == false) { newRoles.put(roleName, new RoleMappingImpl(roleName)); roleMappings = Collections.unmodifiableMap(newRoles); } }
java
public synchronized void addRoleMapping(final String roleName) { HashMap<String, RoleMappingImpl> newRoles = new HashMap<String, RoleMappingImpl>(roleMappings); if (newRoles.containsKey(roleName) == false) { newRoles.put(roleName, new RoleMappingImpl(roleName)); roleMappings = Collections.unmodifiableMap(newRoles); } }
[ "public", "synchronized", "void", "addRoleMapping", "(", "final", "String", "roleName", ")", "{", "HashMap", "<", "String", ",", "RoleMappingImpl", ">", "newRoles", "=", "new", "HashMap", "<", "String", ",", "RoleMappingImpl", ">", "(", "roleMappings", ")", ";", "if", "(", "newRoles", ".", "containsKey", "(", "roleName", ")", "==", "false", ")", "{", "newRoles", ".", "put", "(", "roleName", ",", "new", "RoleMappingImpl", "(", "roleName", ")", ")", ";", "roleMappings", "=", "Collections", ".", "unmodifiableMap", "(", "newRoles", ")", ";", "}", "}" ]
Adds a new role to the list of defined roles. @param roleName - The name of the role being added.
[ "Adds", "a", "new", "role", "to", "the", "list", "of", "defined", "roles", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/access/management/WritableAuthorizerConfiguration.java#L176-L182