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,100 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/access/management/WritableAuthorizerConfiguration.java | WritableAuthorizerConfiguration.removeRoleMapping | public synchronized Object removeRoleMapping(final String roleName) {
/*
* Would not expect this to happen during boot so don't offer the 'immediate' optimisation.
*/
HashMap<String, RoleMappingImpl> newRoles = new HashMap<String, RoleMappingImpl>(roleMappings);
if (newRoles.co... | java | public synchronized Object removeRoleMapping(final String roleName) {
/*
* Would not expect this to happen during boot so don't offer the 'immediate' optimisation.
*/
HashMap<String, RoleMappingImpl> newRoles = new HashMap<String, RoleMappingImpl>(roleMappings);
if (newRoles.co... | [
"public",
"synchronized",
"Object",
"removeRoleMapping",
"(",
"final",
"String",
"roleName",
")",
"{",
"/*\n * Would not expect this to happen during boot so don't offer the 'immediate' optimisation.\n */",
"HashMap",
"<",
"String",
",",
"RoleMappingImpl",
">",
"new... | Remove a role from the list of defined roles.
@param roleName - The name of the role to be removed.
@return A key that can be used to undo the removal. | [
"Remove",
"a",
"role",
"from",
"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#L190-L205 |
159,101 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/access/management/WritableAuthorizerConfiguration.java | WritableAuthorizerConfiguration.undoRoleMappingRemove | public synchronized boolean undoRoleMappingRemove(final Object removalKey) {
HashMap<String, RoleMappingImpl> newRoles = new HashMap<String, RoleMappingImpl>(roleMappings);
RoleMappingImpl toRestore = removedRoles.remove(removalKey);
if (toRestore != null && newRoles.containsKey(toRestore.getNam... | java | public synchronized boolean undoRoleMappingRemove(final Object removalKey) {
HashMap<String, RoleMappingImpl> newRoles = new HashMap<String, RoleMappingImpl>(roleMappings);
RoleMappingImpl toRestore = removedRoles.remove(removalKey);
if (toRestore != null && newRoles.containsKey(toRestore.getNam... | [
"public",
"synchronized",
"boolean",
"undoRoleMappingRemove",
"(",
"final",
"Object",
"removalKey",
")",
"{",
"HashMap",
"<",
"String",
",",
"RoleMappingImpl",
">",
"newRoles",
"=",
"new",
"HashMap",
"<",
"String",
",",
"RoleMappingImpl",
">",
"(",
"roleMappings",... | Undo a prior removal using the supplied undo key.
@param removalKey - The key returned from the call to removeRoleMapping.
@return true if the undo was successful, false otherwise. | [
"Undo",
"a",
"prior",
"removal",
"using",
"the",
"supplied",
"undo",
"key",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/access/management/WritableAuthorizerConfiguration.java#L213-L223 |
159,102 | wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/domain/controller/operations/coordination/ServerOperationResolver.java | ServerOperationResolver.getDeploymentOverlayOperations | private Map<Set<ServerIdentity>, ModelNode> getDeploymentOverlayOperations(ModelNode operation,
ModelNode host) {
final PathAddress realAddress = PathAddress.pathAddress(operation.get(OP_ADDR));
if (realAddress.size() == 0 &&... | java | private Map<Set<ServerIdentity>, ModelNode> getDeploymentOverlayOperations(ModelNode operation,
ModelNode host) {
final PathAddress realAddress = PathAddress.pathAddress(operation.get(OP_ADDR));
if (realAddress.size() == 0 &&... | [
"private",
"Map",
"<",
"Set",
"<",
"ServerIdentity",
">",
",",
"ModelNode",
">",
"getDeploymentOverlayOperations",
"(",
"ModelNode",
"operation",
",",
"ModelNode",
"host",
")",
"{",
"final",
"PathAddress",
"realAddress",
"=",
"PathAddress",
".",
"pathAddress",
"("... | Convert an operation for deployment overlays to be executed on local servers.
Since this might be called in the case of redeployment of affected deployments, we need to take into account
the composite op resulting from such a transformation
@see AffectedDeploymentOverlay#redeployLinksAndTransformOperationForDomain
@par... | [
"Convert",
"an",
"operation",
"for",
"deployment",
"overlays",
"to",
"be",
"executed",
"on",
"local",
"servers",
".",
"Since",
"this",
"might",
"be",
"called",
"in",
"the",
"case",
"of",
"redeployment",
"of",
"affected",
"deployments",
"we",
"need",
"to",
"t... | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/operations/coordination/ServerOperationResolver.java#L350-L384 |
159,103 | wildfly/wildfly-core | cli/src/main/java/org/jboss/as/cli/gui/ServerLogsPanel.java | ServerLogsPanel.isLogDownloadAvailable | public static boolean isLogDownloadAvailable(CliGuiContext cliGuiCtx) {
ModelNode readOps = null;
try {
readOps = cliGuiCtx.getExecutor().doCommand("/subsystem=logging:read-children-types");
} catch (CommandFormatException | IOException e) {
return false;
}
... | java | public static boolean isLogDownloadAvailable(CliGuiContext cliGuiCtx) {
ModelNode readOps = null;
try {
readOps = cliGuiCtx.getExecutor().doCommand("/subsystem=logging:read-children-types");
} catch (CommandFormatException | IOException e) {
return false;
}
... | [
"public",
"static",
"boolean",
"isLogDownloadAvailable",
"(",
"CliGuiContext",
"cliGuiCtx",
")",
"{",
"ModelNode",
"readOps",
"=",
"null",
";",
"try",
"{",
"readOps",
"=",
"cliGuiCtx",
".",
"getExecutor",
"(",
")",
".",
"doCommand",
"(",
"\"/subsystem=logging:read... | Does the server support log downloads?
@param cliGuiCtx The context.
@return <code>true</code> if the server supports log downloads,
<code>false</code> otherwise. | [
"Does",
"the",
"server",
"support",
"log",
"downloads?"
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/gui/ServerLogsPanel.java#L80-L92 |
159,104 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/interfaces/InetAddressUtil.java | InetAddressUtil.getLocalHost | public static InetAddress getLocalHost() throws UnknownHostException {
InetAddress addr;
try {
addr = InetAddress.getLocalHost();
} catch (ArrayIndexOutOfBoundsException e) { //this is workaround for mac osx bug see AS7-3223 and JGRP-1404
addr = InetAddress.getByName(nul... | java | public static InetAddress getLocalHost() throws UnknownHostException {
InetAddress addr;
try {
addr = InetAddress.getLocalHost();
} catch (ArrayIndexOutOfBoundsException e) { //this is workaround for mac osx bug see AS7-3223 and JGRP-1404
addr = InetAddress.getByName(nul... | [
"public",
"static",
"InetAddress",
"getLocalHost",
"(",
")",
"throws",
"UnknownHostException",
"{",
"InetAddress",
"addr",
";",
"try",
"{",
"addr",
"=",
"InetAddress",
".",
"getLocalHost",
"(",
")",
";",
"}",
"catch",
"(",
"ArrayIndexOutOfBoundsException",
"e",
... | Methods returns InetAddress for localhost
@return InetAddress of the localhost
@throws UnknownHostException if localhost could not be resolved | [
"Methods",
"returns",
"InetAddress",
"for",
"localhost"
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/interfaces/InetAddressUtil.java#L44-L52 |
159,105 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java | ConfigurationFile.getBootFile | public File getBootFile() {
if (bootFile == null) {
synchronized (this) {
if (bootFile == null) {
if (bootFileReset) {
//Reset the done bootup and the sequence, so that the old file we are reloading from
// overwrite... | java | public File getBootFile() {
if (bootFile == null) {
synchronized (this) {
if (bootFile == null) {
if (bootFileReset) {
//Reset the done bootup and the sequence, so that the old file we are reloading from
// overwrite... | [
"public",
"File",
"getBootFile",
"(",
")",
"{",
"if",
"(",
"bootFile",
"==",
"null",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"bootFile",
"==",
"null",
")",
"{",
"if",
"(",
"bootFileReset",
")",
"{",
"//Reset the done bootup and the sequ... | Gets the file from which boot operations should be parsed.
@return the file. Will not be {@code null} | [
"Gets",
"the",
"file",
"from",
"which",
"boot",
"operations",
"should",
"be",
"parsed",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java#L217-L287 |
159,106 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java | ConfigurationFile.successfulBoot | void successfulBoot() throws ConfigurationPersistenceException {
synchronized (this) {
if (doneBootup.get()) {
return;
}
final File copySource;
if (!interactionPolicy.isReadOnly()) {
copySource = mainFile;
} else {
... | java | void successfulBoot() throws ConfigurationPersistenceException {
synchronized (this) {
if (doneBootup.get()) {
return;
}
final File copySource;
if (!interactionPolicy.isReadOnly()) {
copySource = mainFile;
} else {
... | [
"void",
"successfulBoot",
"(",
")",
"throws",
"ConfigurationPersistenceException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"doneBootup",
".",
"get",
"(",
")",
")",
"{",
"return",
";",
"}",
"final",
"File",
"copySource",
";",
"if",
"(",
"!",
... | Notification that boot has completed successfully and the configuration history should be updated | [
"Notification",
"that",
"boot",
"has",
"completed",
"successfully",
"and",
"the",
"configuration",
"history",
"should",
"be",
"updated"
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java#L483-L533 |
159,107 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java | ConfigurationFile.backup | void backup() throws ConfigurationPersistenceException {
if (!doneBootup.get()) {
return;
}
try {
if (!interactionPolicy.isReadOnly()) {
//Move the main file to the versioned history
moveFile(mainFile, getVersionedFile(mainFile));
... | java | void backup() throws ConfigurationPersistenceException {
if (!doneBootup.get()) {
return;
}
try {
if (!interactionPolicy.isReadOnly()) {
//Move the main file to the versioned history
moveFile(mainFile, getVersionedFile(mainFile));
... | [
"void",
"backup",
"(",
")",
"throws",
"ConfigurationPersistenceException",
"{",
"if",
"(",
"!",
"doneBootup",
".",
"get",
"(",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"if",
"(",
"!",
"interactionPolicy",
".",
"isReadOnly",
"(",
")",
")",
"{",
"/... | Backup the current version of the configuration to the versioned configuration history | [
"Backup",
"the",
"current",
"version",
"of",
"the",
"configuration",
"to",
"the",
"versioned",
"configuration",
"history"
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java#L537-L564 |
159,108 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java | ConfigurationFile.commitTempFile | void commitTempFile(File temp) throws ConfigurationPersistenceException {
if (!doneBootup.get()) {
return;
}
if (!interactionPolicy.isReadOnly()) {
FilePersistenceUtils.moveTempFileToMain(temp, mainFile);
} else {
FilePersistenceUtils.moveTempFileToMai... | java | void commitTempFile(File temp) throws ConfigurationPersistenceException {
if (!doneBootup.get()) {
return;
}
if (!interactionPolicy.isReadOnly()) {
FilePersistenceUtils.moveTempFileToMain(temp, mainFile);
} else {
FilePersistenceUtils.moveTempFileToMai... | [
"void",
"commitTempFile",
"(",
"File",
"temp",
")",
"throws",
"ConfigurationPersistenceException",
"{",
"if",
"(",
"!",
"doneBootup",
".",
"get",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"interactionPolicy",
".",
"isReadOnly",
"(",
")",
")",... | Commit the contents of the given temp file to either the main file, or, if we are not persisting
to the main file, to the .last file in the configuration history
@param temp temp file containing the latest configuration. Will not be {@code null}
@throws ConfigurationPersistenceException | [
"Commit",
"the",
"contents",
"of",
"the",
"given",
"temp",
"file",
"to",
"either",
"the",
"main",
"file",
"or",
"if",
"we",
"are",
"not",
"persisting",
"to",
"the",
"main",
"file",
"to",
"the",
".",
"last",
"file",
"in",
"the",
"configuration",
"history"... | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java#L572-L581 |
159,109 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java | ConfigurationFile.fileWritten | void fileWritten() throws ConfigurationPersistenceException {
if (!doneBootup.get() || interactionPolicy.isReadOnly()) {
return;
}
try {
FilePersistenceUtils.copyFile(mainFile, lastFile);
} catch (IOException e) {
throw ControllerLogger.ROOT_LOGGER.fai... | java | void fileWritten() throws ConfigurationPersistenceException {
if (!doneBootup.get() || interactionPolicy.isReadOnly()) {
return;
}
try {
FilePersistenceUtils.copyFile(mainFile, lastFile);
} catch (IOException e) {
throw ControllerLogger.ROOT_LOGGER.fai... | [
"void",
"fileWritten",
"(",
")",
"throws",
"ConfigurationPersistenceException",
"{",
"if",
"(",
"!",
"doneBootup",
".",
"get",
"(",
")",
"||",
"interactionPolicy",
".",
"isReadOnly",
"(",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"FilePersistenceUtils",
... | Notification that the configuration has been written, and its current content should be stored to the .last file | [
"Notification",
"that",
"the",
"configuration",
"has",
"been",
"written",
"and",
"its",
"current",
"content",
"should",
"be",
"stored",
"to",
"the",
".",
"last",
"file"
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java#L584-L593 |
159,110 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java | ConfigurationFile.deleteRecursive | private void deleteRecursive(final File file) {
if (file.isDirectory()) {
final String[] files = file.list();
if (files != null) {
for (String name : files) {
deleteRecursive(new File(file, name));
}
}
}
if ... | java | private void deleteRecursive(final File file) {
if (file.isDirectory()) {
final String[] files = file.list();
if (files != null) {
for (String name : files) {
deleteRecursive(new File(file, name));
}
}
}
if ... | [
"private",
"void",
"deleteRecursive",
"(",
"final",
"File",
"file",
")",
"{",
"if",
"(",
"file",
".",
"isDirectory",
"(",
")",
")",
"{",
"final",
"String",
"[",
"]",
"files",
"=",
"file",
".",
"list",
"(",
")",
";",
"if",
"(",
"files",
"!=",
"null"... | note, this just logs an error and doesn't throw as its only used to remove old configuration files, and shouldn't stop boot | [
"note",
"this",
"just",
"logs",
"an",
"error",
"and",
"doesn",
"t",
"throw",
"as",
"its",
"only",
"used",
"to",
"remove",
"old",
"configuration",
"files",
"and",
"shouldn",
"t",
"stop",
"boot"
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java#L714-L727 |
159,111 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/RestartParentResourceRemoveHandler.java | RestartParentResourceRemoveHandler.updateModel | protected void updateModel(final OperationContext context, final ModelNode operation) throws OperationFailedException {
// verify that the resource exist before removing it
context.readResource(PathAddress.EMPTY_ADDRESS, false);
Resource resource = context.removeResource(PathAddress.EMPTY_ADDRES... | java | protected void updateModel(final OperationContext context, final ModelNode operation) throws OperationFailedException {
// verify that the resource exist before removing it
context.readResource(PathAddress.EMPTY_ADDRESS, false);
Resource resource = context.removeResource(PathAddress.EMPTY_ADDRES... | [
"protected",
"void",
"updateModel",
"(",
"final",
"OperationContext",
"context",
",",
"final",
"ModelNode",
"operation",
")",
"throws",
"OperationFailedException",
"{",
"// verify that the resource exist before removing it",
"context",
".",
"readResource",
"(",
"PathAddress",... | Performs the update to the persistent configuration model. This default implementation simply removes
the targeted resource.
@param context the operation context
@param operation the operation
@throws OperationFailedException if there is a problem updating the model | [
"Performs",
"the",
"update",
"to",
"the",
"persistent",
"configuration",
"model",
".",
"This",
"default",
"implementation",
"simply",
"removes",
"the",
"targeted",
"resource",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/RestartParentResourceRemoveHandler.java#L62-L67 |
159,112 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java | AbstractOperationContext.executeOperation | ResultAction executeOperation() {
assert isControllingThread();
try {
/** Execution has begun */
executing = true;
processStages();
if (resultAction == ResultAction.KEEP) {
report(MessageSeverity.INFO, ControllerLogger.ROOT_LOGGER.operat... | java | ResultAction executeOperation() {
assert isControllingThread();
try {
/** Execution has begun */
executing = true;
processStages();
if (resultAction == ResultAction.KEEP) {
report(MessageSeverity.INFO, ControllerLogger.ROOT_LOGGER.operat... | [
"ResultAction",
"executeOperation",
"(",
")",
"{",
"assert",
"isControllingThread",
"(",
")",
";",
"try",
"{",
"/** Execution has begun */",
"executing",
"=",
"true",
";",
"processStages",
"(",
")",
";",
"if",
"(",
"resultAction",
"==",
"ResultAction",
".",
"KEE... | Package-protected method used to initiate operation execution.
@return the result action | [
"Package",
"-",
"protected",
"method",
"used",
"to",
"initiate",
"operation",
"execution",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java#L460-L499 |
159,113 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java | AbstractOperationContext.logAuditRecord | void logAuditRecord() {
trackConfigurationChange();
if (!auditLogged) {
try {
AccessAuditContext accessContext = SecurityActions.currentAccessAuditContext();
Caller caller = getCaller();
auditLogger.log(
isReadOnly(),
... | java | void logAuditRecord() {
trackConfigurationChange();
if (!auditLogged) {
try {
AccessAuditContext accessContext = SecurityActions.currentAccessAuditContext();
Caller caller = getCaller();
auditLogger.log(
isReadOnly(),
... | [
"void",
"logAuditRecord",
"(",
")",
"{",
"trackConfigurationChange",
"(",
")",
";",
"if",
"(",
"!",
"auditLogged",
")",
"{",
"try",
"{",
"AccessAuditContext",
"accessContext",
"=",
"SecurityActions",
".",
"currentAccessAuditContext",
"(",
")",
";",
"Caller",
"ca... | Log an audit record of this operation. | [
"Log",
"an",
"audit",
"record",
"of",
"this",
"operation",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java#L621-L641 |
159,114 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java | AbstractOperationContext.processStages | private void processStages() {
// Locate the next step to execute.
ModelNode primaryResponse = null;
Step step;
do {
step = steps.get(currentStage).pollFirst();
if (step == null) {
if (currentStage == Stage.MODEL && addModelValidationSteps()) {
... | java | private void processStages() {
// Locate the next step to execute.
ModelNode primaryResponse = null;
Step step;
do {
step = steps.get(currentStage).pollFirst();
if (step == null) {
if (currentStage == Stage.MODEL && addModelValidationSteps()) {
... | [
"private",
"void",
"processStages",
"(",
")",
"{",
"// Locate the next step to execute.",
"ModelNode",
"primaryResponse",
"=",
"null",
";",
"Step",
"step",
";",
"do",
"{",
"step",
"=",
"steps",
".",
"get",
"(",
"currentStage",
")",
".",
"pollFirst",
"(",
")",
... | Perform the work of processing the various OperationContext.Stage queues, and then the DONE stage. | [
"Perform",
"the",
"work",
"of",
"processing",
"the",
"various",
"OperationContext",
".",
"Stage",
"queues",
"and",
"then",
"the",
"DONE",
"stage",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java#L687-L770 |
159,115 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java | AbstractOperationContext.checkUndefinedNotification | private void checkUndefinedNotification(Notification notification) {
String type = notification.getType();
PathAddress source = notification.getSource();
Map<String, NotificationEntry> descriptions = getRootResourceRegistration().getNotificationDescriptions(source, true);
if (!descriptio... | java | private void checkUndefinedNotification(Notification notification) {
String type = notification.getType();
PathAddress source = notification.getSource();
Map<String, NotificationEntry> descriptions = getRootResourceRegistration().getNotificationDescriptions(source, true);
if (!descriptio... | [
"private",
"void",
"checkUndefinedNotification",
"(",
"Notification",
"notification",
")",
"{",
"String",
"type",
"=",
"notification",
".",
"getType",
"(",
")",
";",
"PathAddress",
"source",
"=",
"notification",
".",
"getSource",
"(",
")",
";",
"Map",
"<",
"St... | Check that each emitted notification is properly described by its source. | [
"Check",
"that",
"each",
"emitted",
"notification",
"is",
"properly",
"described",
"by",
"its",
"source",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java#L939-L946 |
159,116 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java | AbstractOperationContext.getFailedResultAction | private ResultAction getFailedResultAction(Throwable cause) {
if (currentStage == Stage.MODEL || cancelled || isRollbackOnRuntimeFailure() || isRollbackOnly()
|| (cause != null && !(cause instanceof OperationFailedException))) {
return ResultAction.ROLLBACK;
}
return ... | java | private ResultAction getFailedResultAction(Throwable cause) {
if (currentStage == Stage.MODEL || cancelled || isRollbackOnRuntimeFailure() || isRollbackOnly()
|| (cause != null && !(cause instanceof OperationFailedException))) {
return ResultAction.ROLLBACK;
}
return ... | [
"private",
"ResultAction",
"getFailedResultAction",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"currentStage",
"==",
"Stage",
".",
"MODEL",
"||",
"cancelled",
"||",
"isRollbackOnRuntimeFailure",
"(",
")",
"||",
"isRollbackOnly",
"(",
")",
"||",
"(",
"cause"... | Decide whether failure should trigger a rollback.
@param cause
the cause of the failure, or {@code null} if failure is not
the result of catching a throwable
@return the result action | [
"Decide",
"whether",
"failure",
"should",
"trigger",
"a",
"rollback",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java#L1117-L1123 |
159,117 | wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/domain/controller/plan/ServerUpdatePolicy.java | ServerUpdatePolicy.canUpdateServer | public boolean canUpdateServer(ServerIdentity server) {
if (!serverGroupName.equals(server.getServerGroupName()) || !servers.contains(server)) {
throw DomainControllerLogger.HOST_CONTROLLER_LOGGER.unknownServer(server);
}
if (!parent.canChildProceed())
return false;
... | java | public boolean canUpdateServer(ServerIdentity server) {
if (!serverGroupName.equals(server.getServerGroupName()) || !servers.contains(server)) {
throw DomainControllerLogger.HOST_CONTROLLER_LOGGER.unknownServer(server);
}
if (!parent.canChildProceed())
return false;
... | [
"public",
"boolean",
"canUpdateServer",
"(",
"ServerIdentity",
"server",
")",
"{",
"if",
"(",
"!",
"serverGroupName",
".",
"equals",
"(",
"server",
".",
"getServerGroupName",
"(",
")",
")",
"||",
"!",
"servers",
".",
"contains",
"(",
"server",
")",
")",
"{... | Gets whether the given server can be updated.
@param server the id of the server. Cannot be <code>null</code>
@return <code>true</code> if the server can be updated; <code>false</code>
if the update should be cancelled
@throws IllegalStateException if this policy is not expecting a request
to update the given server | [
"Gets",
"whether",
"the",
"given",
"server",
"can",
"be",
"updated",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/plan/ServerUpdatePolicy.java#L111-L122 |
159,118 | wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/domain/controller/plan/ServerUpdatePolicy.java | ServerUpdatePolicy.recordServerResult | public void recordServerResult(ServerIdentity server, ModelNode response) {
if (!serverGroupName.equals(server.getServerGroupName()) || !servers.contains(server)) {
throw DomainControllerLogger.HOST_CONTROLLER_LOGGER.unknownServer(server);
}
boolean serverFailed = response.has(FAIL... | java | public void recordServerResult(ServerIdentity server, ModelNode response) {
if (!serverGroupName.equals(server.getServerGroupName()) || !servers.contains(server)) {
throw DomainControllerLogger.HOST_CONTROLLER_LOGGER.unknownServer(server);
}
boolean serverFailed = response.has(FAIL... | [
"public",
"void",
"recordServerResult",
"(",
"ServerIdentity",
"server",
",",
"ModelNode",
"response",
")",
"{",
"if",
"(",
"!",
"serverGroupName",
".",
"equals",
"(",
"server",
".",
"getServerGroupName",
"(",
")",
")",
"||",
"!",
"servers",
".",
"contains",
... | Records the result of updating a server.
@param server the id of the server. Cannot be <code>null</code>
@param response the result of the updates | [
"Records",
"the",
"result",
"of",
"updating",
"a",
"server",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/plan/ServerUpdatePolicy.java#L130-L160 |
159,119 | wildfly/wildfly-core | launcher/src/main/java/org/wildfly/core/launcher/Arguments.java | Arguments.set | public void set(final Argument argument) {
if (argument != null) {
map.put(argument.getKey(), Collections.singleton(argument));
}
} | java | public void set(final Argument argument) {
if (argument != null) {
map.put(argument.getKey(), Collections.singleton(argument));
}
} | [
"public",
"void",
"set",
"(",
"final",
"Argument",
"argument",
")",
"{",
"if",
"(",
"argument",
"!=",
"null",
")",
"{",
"map",
".",
"put",
"(",
"argument",
".",
"getKey",
"(",
")",
",",
"Collections",
".",
"singleton",
"(",
"argument",
")",
")",
";",... | Sets an argument to the collection of arguments. This guarantees only one value will be assigned to the
argument key.
@param argument the argument to add | [
"Sets",
"an",
"argument",
"to",
"the",
"collection",
"of",
"arguments",
".",
"This",
"guarantees",
"only",
"one",
"value",
"will",
"be",
"assigned",
"to",
"the",
"argument",
"key",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/Arguments.java#L126-L130 |
159,120 | wildfly/wildfly-core | launcher/src/main/java/org/wildfly/core/launcher/Arguments.java | Arguments.get | public String get(final String key) {
final Collection<Argument> args = map.get(key);
if (args != null) {
return args.iterator().hasNext() ? args.iterator().next().getValue() : null;
}
return null;
} | java | public String get(final String key) {
final Collection<Argument> args = map.get(key);
if (args != null) {
return args.iterator().hasNext() ? args.iterator().next().getValue() : null;
}
return null;
} | [
"public",
"String",
"get",
"(",
"final",
"String",
"key",
")",
"{",
"final",
"Collection",
"<",
"Argument",
">",
"args",
"=",
"map",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"args",
"!=",
"null",
")",
"{",
"return",
"args",
".",
"iterator",
"("... | Gets the first value for the key.
@param key the key to check for the value
@return the value or {@code null} if the key is not found or the value was {@code null} | [
"Gets",
"the",
"first",
"value",
"for",
"the",
"key",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/Arguments.java#L154-L160 |
159,121 | wildfly/wildfly-core | launcher/src/main/java/org/wildfly/core/launcher/Arguments.java | Arguments.getArguments | public Collection<Argument> getArguments(final String key) {
final Collection<Argument> args = map.get(key);
if (args != null) {
return new ArrayList<>(args);
}
return Collections.emptyList();
} | java | public Collection<Argument> getArguments(final String key) {
final Collection<Argument> args = map.get(key);
if (args != null) {
return new ArrayList<>(args);
}
return Collections.emptyList();
} | [
"public",
"Collection",
"<",
"Argument",
">",
"getArguments",
"(",
"final",
"String",
"key",
")",
"{",
"final",
"Collection",
"<",
"Argument",
">",
"args",
"=",
"map",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"args",
"!=",
"null",
")",
"{",
"retu... | Gets the value for the key.
@param key the key to check for the value
@return the value or an empty collection if no values were set | [
"Gets",
"the",
"value",
"for",
"the",
"key",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/Arguments.java#L169-L175 |
159,122 | wildfly/wildfly-core | launcher/src/main/java/org/wildfly/core/launcher/Arguments.java | Arguments.asList | public List<String> asList() {
final List<String> result = new ArrayList<>();
for (Collection<Argument> args : map.values()) {
for (Argument arg : args) {
result.add(arg.asCommandLineArgument());
}
}
return result;
} | java | public List<String> asList() {
final List<String> result = new ArrayList<>();
for (Collection<Argument> args : map.values()) {
for (Argument arg : args) {
result.add(arg.asCommandLineArgument());
}
}
return result;
} | [
"public",
"List",
"<",
"String",
">",
"asList",
"(",
")",
"{",
"final",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Collection",
"<",
"Argument",
">",
"args",
":",
"map",
".",
"values",
"(",
")",... | Returns the arguments as a list in their command line form.
@return the arguments for the command line | [
"Returns",
"the",
"arguments",
"as",
"a",
"list",
"in",
"their",
"command",
"line",
"form",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/Arguments.java#L193-L201 |
159,123 | wildfly/wildfly-core | domain-management/src/main/java/org/jboss/as/domain/management/parsing/ManagementXml_Legacy.java | ManagementXml_Legacy.parseLdapAuthorization_1_5 | private void parseLdapAuthorization_1_5(final XMLExtendedStreamReader reader,
final ModelNode realmAddress, final List<ModelNode> list) throws XMLStreamException {
ModelNode addr = realmAddress.clone().add(AUTHORIZATION, LDAP);
ModelNode ldapAuthorization = Util.getEmptyOperation(ADD, addr);... | java | private void parseLdapAuthorization_1_5(final XMLExtendedStreamReader reader,
final ModelNode realmAddress, final List<ModelNode> list) throws XMLStreamException {
ModelNode addr = realmAddress.clone().add(AUTHORIZATION, LDAP);
ModelNode ldapAuthorization = Util.getEmptyOperation(ADD, addr);... | [
"private",
"void",
"parseLdapAuthorization_1_5",
"(",
"final",
"XMLExtendedStreamReader",
"reader",
",",
"final",
"ModelNode",
"realmAddress",
",",
"final",
"List",
"<",
"ModelNode",
">",
"list",
")",
"throws",
"XMLStreamException",
"{",
"ModelNode",
"addr",
"=",
"r... | 1.5 and on, 2.0 and on, 3.0 and on. | [
"1",
".",
"5",
"and",
"on",
"2",
".",
"0",
"and",
"on",
"3",
".",
"0",
"and",
"on",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/domain-management/src/main/java/org/jboss/as/domain/management/parsing/ManagementXml_Legacy.java#L2443-L2512 |
159,124 | wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/module/ResourceRoot.java | ResourceRoot.merge | public void merge(final ResourceRoot additionalResourceRoot) {
if(!additionalResourceRoot.getRoot().equals(root)) {
throw ServerLogger.ROOT_LOGGER.cannotMergeResourceRoot(root, additionalResourceRoot.getRoot());
}
usePhysicalCodeSource = additionalResourceRoot.usePhysicalCodeSource;
... | java | public void merge(final ResourceRoot additionalResourceRoot) {
if(!additionalResourceRoot.getRoot().equals(root)) {
throw ServerLogger.ROOT_LOGGER.cannotMergeResourceRoot(root, additionalResourceRoot.getRoot());
}
usePhysicalCodeSource = additionalResourceRoot.usePhysicalCodeSource;
... | [
"public",
"void",
"merge",
"(",
"final",
"ResourceRoot",
"additionalResourceRoot",
")",
"{",
"if",
"(",
"!",
"additionalResourceRoot",
".",
"getRoot",
"(",
")",
".",
"equals",
"(",
"root",
")",
")",
"{",
"throw",
"ServerLogger",
".",
"ROOT_LOGGER",
".",
"can... | Merges information from the resource root into this resource root
@param additionalResourceRoot The root to merge | [
"Merges",
"information",
"from",
"the",
"resource",
"root",
"into",
"this",
"resource",
"root"
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/module/ResourceRoot.java#L94-L106 |
159,125 | wildfly/wildfly-core | security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerExtensionTransformerRegistration.java | SecurityManagerExtensionTransformerRegistration.registerTransformers | @Override
public void registerTransformers(SubsystemTransformerRegistration subsystemRegistration) {
ResourceTransformationDescriptionBuilder builder = ResourceTransformationDescriptionBuilder.Factory.createSubsystemInstance();
builder.addChildResource(DeploymentPermissionsResourceDefinition.DEPLOYM... | java | @Override
public void registerTransformers(SubsystemTransformerRegistration subsystemRegistration) {
ResourceTransformationDescriptionBuilder builder = ResourceTransformationDescriptionBuilder.Factory.createSubsystemInstance();
builder.addChildResource(DeploymentPermissionsResourceDefinition.DEPLOYM... | [
"@",
"Override",
"public",
"void",
"registerTransformers",
"(",
"SubsystemTransformerRegistration",
"subsystemRegistration",
")",
"{",
"ResourceTransformationDescriptionBuilder",
"builder",
"=",
"ResourceTransformationDescriptionBuilder",
".",
"Factory",
".",
"createSubsystemInstan... | Registers the transformers for JBoss EAP 7.0.0.
@param subsystemRegistration contains data about the subsystem registration | [
"Registers",
"the",
"transformers",
"for",
"JBoss",
"EAP",
"7",
".",
"0",
".",
"0",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerExtensionTransformerRegistration.java#L50-L70 |
159,126 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/operations/global/FilteredData.java | FilteredData.toModelNode | ModelNode toModelNode() {
ModelNode result = null;
if (map != null) {
result = new ModelNode();
for (Map.Entry<PathAddress, ResourceData> entry : map.entrySet()) {
ModelNode item = new ModelNode();
PathAddress pa = entry.getKey();
i... | java | ModelNode toModelNode() {
ModelNode result = null;
if (map != null) {
result = new ModelNode();
for (Map.Entry<PathAddress, ResourceData> entry : map.entrySet()) {
ModelNode item = new ModelNode();
PathAddress pa = entry.getKey();
i... | [
"ModelNode",
"toModelNode",
"(",
")",
"{",
"ModelNode",
"result",
"=",
"null",
";",
"if",
"(",
"map",
"!=",
"null",
")",
"{",
"result",
"=",
"new",
"ModelNode",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"PathAddress",
",",
"ResourceData",
... | Report on the filtered data in DMR . | [
"Report",
"on",
"the",
"filtered",
"data",
"in",
"DMR",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/operations/global/FilteredData.java#L107-L151 |
159,127 | wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java | IdentityPatchRunner.rollbackLast | public PatchingResult rollbackLast(final ContentVerificationPolicy contentPolicy, final boolean resetConfiguration, InstallationManager.InstallationModification modification) throws PatchingException {
// Determine the patch id to rollback
String patchId;
final List<String> oneOffs = modificati... | java | public PatchingResult rollbackLast(final ContentVerificationPolicy contentPolicy, final boolean resetConfiguration, InstallationManager.InstallationModification modification) throws PatchingException {
// Determine the patch id to rollback
String patchId;
final List<String> oneOffs = modificati... | [
"public",
"PatchingResult",
"rollbackLast",
"(",
"final",
"ContentVerificationPolicy",
"contentPolicy",
",",
"final",
"boolean",
"resetConfiguration",
",",
"InstallationManager",
".",
"InstallationModification",
"modification",
")",
"throws",
"PatchingException",
"{",
"// Det... | Rollback the last applied patch.
@param contentPolicy the content policy
@param resetConfiguration whether to reset the configuration
@param modification the installation modification
@return the patching result
@throws PatchingException | [
"Rollback",
"the",
"last",
"applied",
"patch",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java#L284-L298 |
159,128 | wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java | IdentityPatchRunner.restoreFromHistory | static void restoreFromHistory(final InstallationManager.MutablePatchingTarget target, final String rollbackPatchId,
final Patch.PatchType patchType, final PatchableTarget.TargetInfo history) throws PatchingException {
if (patchType == Patch.PatchType.CUMULATIVE) {
... | java | static void restoreFromHistory(final InstallationManager.MutablePatchingTarget target, final String rollbackPatchId,
final Patch.PatchType patchType, final PatchableTarget.TargetInfo history) throws PatchingException {
if (patchType == Patch.PatchType.CUMULATIVE) {
... | [
"static",
"void",
"restoreFromHistory",
"(",
"final",
"InstallationManager",
".",
"MutablePatchingTarget",
"target",
",",
"final",
"String",
"rollbackPatchId",
",",
"final",
"Patch",
".",
"PatchType",
"patchType",
",",
"final",
"PatchableTarget",
".",
"TargetInfo",
"h... | Restore the recorded state from the rollback xml.
@param target the patchable target
@param rollbackPatchId the rollback patch id
@param patchType the the current patch type
@param history the recorded history
@throws PatchingException | [
"Restore",
"the",
"recorded",
"state",
"from",
"the",
"rollback",
"xml",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java#L425-L438 |
159,129 | wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java | IdentityPatchRunner.portForward | void portForward(final Patch patch, IdentityPatchContext context) throws PatchingException, IOException, XMLStreamException {
assert patch.getIdentity().getPatchType() == Patch.PatchType.CUMULATIVE;
final PatchingHistory history = context.getHistory();
for (final PatchElement element : patch.ge... | java | void portForward(final Patch patch, IdentityPatchContext context) throws PatchingException, IOException, XMLStreamException {
assert patch.getIdentity().getPatchType() == Patch.PatchType.CUMULATIVE;
final PatchingHistory history = context.getHistory();
for (final PatchElement element : patch.ge... | [
"void",
"portForward",
"(",
"final",
"Patch",
"patch",
",",
"IdentityPatchContext",
"context",
")",
"throws",
"PatchingException",
",",
"IOException",
",",
"XMLStreamException",
"{",
"assert",
"patch",
".",
"getIdentity",
"(",
")",
".",
"getPatchType",
"(",
")",
... | Port forward missing module changes for each layer.
@param patch the current patch
@param context the patch context
@throws PatchingException
@throws IOException
@throws XMLStreamException | [
"Port",
"forward",
"missing",
"module",
"changes",
"for",
"each",
"layer",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java#L563-L610 |
159,130 | wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java | IdentityPatchRunner.executeTasks | static PatchingResult executeTasks(final IdentityPatchContext context, final IdentityPatchContext.FinalizeCallback callback) throws Exception {
final List<PreparedTask> tasks = new ArrayList<PreparedTask>();
final List<ContentItem> conflicts = new ArrayList<ContentItem>();
// Identity
pr... | java | static PatchingResult executeTasks(final IdentityPatchContext context, final IdentityPatchContext.FinalizeCallback callback) throws Exception {
final List<PreparedTask> tasks = new ArrayList<PreparedTask>();
final List<ContentItem> conflicts = new ArrayList<ContentItem>();
// Identity
pr... | [
"static",
"PatchingResult",
"executeTasks",
"(",
"final",
"IdentityPatchContext",
"context",
",",
"final",
"IdentityPatchContext",
".",
"FinalizeCallback",
"callback",
")",
"throws",
"Exception",
"{",
"final",
"List",
"<",
"PreparedTask",
">",
"tasks",
"=",
"new",
"... | Execute all recorded tasks.
@param context the patch context
@param callback the finalization callback
@throws Exception | [
"Execute",
"all",
"recorded",
"tasks",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java#L630-L658 |
159,131 | wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java | IdentityPatchRunner.prepareTasks | static void prepareTasks(final IdentityPatchContext.PatchEntry entry, final IdentityPatchContext context, final List<PreparedTask> tasks, final List<ContentItem> conflicts) throws PatchingException {
for (final PatchingTasks.ContentTaskDefinition definition : entry.getTaskDefinitions()) {
final Patc... | java | static void prepareTasks(final IdentityPatchContext.PatchEntry entry, final IdentityPatchContext context, final List<PreparedTask> tasks, final List<ContentItem> conflicts) throws PatchingException {
for (final PatchingTasks.ContentTaskDefinition definition : entry.getTaskDefinitions()) {
final Patc... | [
"static",
"void",
"prepareTasks",
"(",
"final",
"IdentityPatchContext",
".",
"PatchEntry",
"entry",
",",
"final",
"IdentityPatchContext",
"context",
",",
"final",
"List",
"<",
"PreparedTask",
">",
"tasks",
",",
"final",
"List",
"<",
"ContentItem",
">",
"conflicts"... | Prepare all tasks.
@param entry the patch entry
@param context the patch context
@param tasks a list for prepared tasks
@param conflicts a list for conflicting content items
@throws PatchingException | [
"Prepare",
"all",
"tasks",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java#L669-L689 |
159,132 | wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java | IdentityPatchRunner.createTask | static PatchingTask createTask(final PatchingTasks.ContentTaskDefinition definition, final PatchContentProvider provider, final IdentityPatchContext.PatchEntry context) {
final PatchContentLoader contentLoader = provider.getLoader(definition.getTarget().getPatchId());
final PatchingTaskDescription descr... | java | static PatchingTask createTask(final PatchingTasks.ContentTaskDefinition definition, final PatchContentProvider provider, final IdentityPatchContext.PatchEntry context) {
final PatchContentLoader contentLoader = provider.getLoader(definition.getTarget().getPatchId());
final PatchingTaskDescription descr... | [
"static",
"PatchingTask",
"createTask",
"(",
"final",
"PatchingTasks",
".",
"ContentTaskDefinition",
"definition",
",",
"final",
"PatchContentProvider",
"provider",
",",
"final",
"IdentityPatchContext",
".",
"PatchEntry",
"context",
")",
"{",
"final",
"PatchContentLoader"... | Create the patching task based on the definition.
@param definition the task description
@param provider the content provider
@param context the task context
@return the created task | [
"Create",
"the",
"patching",
"task",
"based",
"on",
"the",
"definition",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java#L699-L703 |
159,133 | wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java | IdentityPatchRunner.checkUpgradeConditions | static void checkUpgradeConditions(final UpgradeCondition condition, final InstallationManager.MutablePatchingTarget target) throws PatchingException {
// See if the prerequisites are met
for (final String required : condition.getRequires()) {
if (!target.isApplied(required)) {
... | java | static void checkUpgradeConditions(final UpgradeCondition condition, final InstallationManager.MutablePatchingTarget target) throws PatchingException {
// See if the prerequisites are met
for (final String required : condition.getRequires()) {
if (!target.isApplied(required)) {
... | [
"static",
"void",
"checkUpgradeConditions",
"(",
"final",
"UpgradeCondition",
"condition",
",",
"final",
"InstallationManager",
".",
"MutablePatchingTarget",
"target",
")",
"throws",
"PatchingException",
"{",
"// See if the prerequisites are met",
"for",
"(",
"final",
"Stri... | Check whether the patch can be applied to a given target.
@param condition the conditions
@param target the target
@throws PatchingException | [
"Check",
"whether",
"the",
"patch",
"can",
"be",
"applied",
"to",
"a",
"given",
"target",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java#L769-L782 |
159,134 | wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/host/controller/discovery/S3Util.java | S3Util.domainControllerDataFromByteBuffer | public static List<DomainControllerData> domainControllerDataFromByteBuffer(byte[] buffer) throws Exception {
List<DomainControllerData> retval = new ArrayList<DomainControllerData>();
if (buffer == null) {
return retval;
}
ByteArrayInputStream in_stream = new ByteArrayInputS... | java | public static List<DomainControllerData> domainControllerDataFromByteBuffer(byte[] buffer) throws Exception {
List<DomainControllerData> retval = new ArrayList<DomainControllerData>();
if (buffer == null) {
return retval;
}
ByteArrayInputStream in_stream = new ByteArrayInputS... | [
"public",
"static",
"List",
"<",
"DomainControllerData",
">",
"domainControllerDataFromByteBuffer",
"(",
"byte",
"[",
"]",
"buffer",
")",
"throws",
"Exception",
"{",
"List",
"<",
"DomainControllerData",
">",
"retval",
"=",
"new",
"ArrayList",
"<",
"DomainControllerD... | Get the domain controller data from the given byte buffer.
@param buffer the byte buffer
@return the domain controller data
@throws Exception | [
"Get",
"the",
"domain",
"controller",
"data",
"from",
"the",
"given",
"byte",
"buffer",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/discovery/S3Util.java#L83-L103 |
159,135 | wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/host/controller/discovery/S3Util.java | S3Util.domainControllerDataToByteBuffer | public static byte[] domainControllerDataToByteBuffer(List<DomainControllerData> data) throws Exception {
final ByteArrayOutputStream out_stream = new ByteArrayOutputStream(512);
byte[] result;
try (DataOutputStream out = new DataOutputStream(out_stream)) {
Iterator<DomainControllerD... | java | public static byte[] domainControllerDataToByteBuffer(List<DomainControllerData> data) throws Exception {
final ByteArrayOutputStream out_stream = new ByteArrayOutputStream(512);
byte[] result;
try (DataOutputStream out = new DataOutputStream(out_stream)) {
Iterator<DomainControllerD... | [
"public",
"static",
"byte",
"[",
"]",
"domainControllerDataToByteBuffer",
"(",
"List",
"<",
"DomainControllerData",
">",
"data",
")",
"throws",
"Exception",
"{",
"final",
"ByteArrayOutputStream",
"out_stream",
"=",
"new",
"ByteArrayOutputStream",
"(",
"512",
")",
";... | Write the domain controller data to a byte buffer.
@param data the domain controller data
@return the byte buffer
@throws Exception | [
"Write",
"the",
"domain",
"controller",
"data",
"to",
"a",
"byte",
"buffer",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/discovery/S3Util.java#L112-L127 |
159,136 | wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/domain/controller/plan/ConcurrentGroupServerUpdatePolicy.java | ConcurrentGroupServerUpdatePolicy.canSuccessorProceed | private boolean canSuccessorProceed() {
if (predecessor != null && !predecessor.canSuccessorProceed()) {
return false;
}
synchronized (this) {
while (responseCount < groups.size()) {
try {
wait();
} catch (InterruptedE... | java | private boolean canSuccessorProceed() {
if (predecessor != null && !predecessor.canSuccessorProceed()) {
return false;
}
synchronized (this) {
while (responseCount < groups.size()) {
try {
wait();
} catch (InterruptedE... | [
"private",
"boolean",
"canSuccessorProceed",
"(",
")",
"{",
"if",
"(",
"predecessor",
"!=",
"null",
"&&",
"!",
"predecessor",
".",
"canSuccessorProceed",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"synchronized",
"(",
"this",
")",
"{",
"while",
"(",
... | Check from another ConcurrentGroupServerUpdatePolicy whose plans are meant to
execute once this policy's plans are successfully completed.
@return <code>true</code> if the successor can proceed | [
"Check",
"from",
"another",
"ConcurrentGroupServerUpdatePolicy",
"whose",
"plans",
"are",
"meant",
"to",
"execute",
"once",
"this",
"policy",
"s",
"plans",
"are",
"successfully",
"completed",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/plan/ConcurrentGroupServerUpdatePolicy.java#L64-L81 |
159,137 | wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/domain/controller/plan/ConcurrentGroupServerUpdatePolicy.java | ConcurrentGroupServerUpdatePolicy.recordServerGroupResult | public void recordServerGroupResult(final String serverGroup, final boolean failed) {
synchronized (this) {
if (groups.contains(serverGroup)) {
responseCount++;
if (failed) {
this.failed = true;
}
DomainControllerLo... | java | public void recordServerGroupResult(final String serverGroup, final boolean failed) {
synchronized (this) {
if (groups.contains(serverGroup)) {
responseCount++;
if (failed) {
this.failed = true;
}
DomainControllerLo... | [
"public",
"void",
"recordServerGroupResult",
"(",
"final",
"String",
"serverGroup",
",",
"final",
"boolean",
"failed",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"groups",
".",
"contains",
"(",
"serverGroup",
")",
")",
"{",
"responseCount",
... | Records the result of updating a server group.
@param serverGroup the server group's name. Cannot be <code>null</code>
@param failed <code>true</code> if the server group update failed;
<code>false</code> if it succeeded | [
"Records",
"the",
"result",
"of",
"updating",
"a",
"server",
"group",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/plan/ConcurrentGroupServerUpdatePolicy.java#L100-L116 |
159,138 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/ModelControllerImpl.java | ModelControllerImpl.executeReadOnlyOperation | @SuppressWarnings("deprecation")
protected ModelNode executeReadOnlyOperation(final ModelNode operation, final OperationMessageHandler handler, final OperationTransactionControl control, final OperationStepHandler prepareStep, final int operationId) {
final AbstractOperationContext delegateContext = getDele... | java | @SuppressWarnings("deprecation")
protected ModelNode executeReadOnlyOperation(final ModelNode operation, final OperationMessageHandler handler, final OperationTransactionControl control, final OperationStepHandler prepareStep, final int operationId) {
final AbstractOperationContext delegateContext = getDele... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"protected",
"ModelNode",
"executeReadOnlyOperation",
"(",
"final",
"ModelNode",
"operation",
",",
"final",
"OperationMessageHandler",
"handler",
",",
"final",
"OperationTransactionControl",
"control",
",",
"final",
"O... | Executes an operation on the controller latching onto an existing transaction
@param operation the operation
@param handler the handler
@param control the transaction control
@param prepareStep the prepare step to be executed before any other steps
@param operationId the id of the current transaction
@return the resul... | [
"Executes",
"an",
"operation",
"on",
"the",
"controller",
"latching",
"onto",
"an",
"existing",
"transaction"
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/ModelControllerImpl.java#L271-L280 |
159,139 | wildfly/wildfly-core | domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ManagementHttpRequestProcessor.java | ManagementHttpRequestProcessor.addShutdownListener | public synchronized void addShutdownListener(ShutdownListener listener) {
if (state == CLOSED) {
listener.handleCompleted();
} else {
listeners.add(listener);
}
} | java | public synchronized void addShutdownListener(ShutdownListener listener) {
if (state == CLOSED) {
listener.handleCompleted();
} else {
listeners.add(listener);
}
} | [
"public",
"synchronized",
"void",
"addShutdownListener",
"(",
"ShutdownListener",
"listener",
")",
"{",
"if",
"(",
"state",
"==",
"CLOSED",
")",
"{",
"listener",
".",
"handleCompleted",
"(",
")",
";",
"}",
"else",
"{",
"listeners",
".",
"add",
"(",
"listener... | Add a shutdown listener, which gets called when all requests completed on shutdown.
@param listener the shutdown listener | [
"Add",
"a",
"shutdown",
"listener",
"which",
"gets",
"called",
"when",
"all",
"requests",
"completed",
"on",
"shutdown",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ManagementHttpRequestProcessor.java#L93-L99 |
159,140 | wildfly/wildfly-core | domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ManagementHttpRequestProcessor.java | ManagementHttpRequestProcessor.handleCompleted | protected synchronized void handleCompleted() {
latch.countDown();
for (final ShutdownListener listener : listeners) {
listener.handleCompleted();
}
listeners.clear();
} | java | protected synchronized void handleCompleted() {
latch.countDown();
for (final ShutdownListener listener : listeners) {
listener.handleCompleted();
}
listeners.clear();
} | [
"protected",
"synchronized",
"void",
"handleCompleted",
"(",
")",
"{",
"latch",
".",
"countDown",
"(",
")",
";",
"for",
"(",
"final",
"ShutdownListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"handleCompleted",
"(",
")",
";",
"}",
"listene... | Notify all shutdown listeners that the shutdown completed. | [
"Notify",
"all",
"shutdown",
"listeners",
"that",
"the",
"shutdown",
"completed",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/domain-http/interface/src/main/java/org/jboss/as/domain/http/server/ManagementHttpRequestProcessor.java#L104-L110 |
159,141 | wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java | DeploymentResourceSupport.hasDeploymentSubsystemModel | public boolean hasDeploymentSubsystemModel(final String subsystemName) {
final Resource root = deploymentUnit.getAttachment(DEPLOYMENT_RESOURCE);
final PathElement subsystem = PathElement.pathElement(SUBSYSTEM, subsystemName);
return root.hasChild(subsystem);
} | java | public boolean hasDeploymentSubsystemModel(final String subsystemName) {
final Resource root = deploymentUnit.getAttachment(DEPLOYMENT_RESOURCE);
final PathElement subsystem = PathElement.pathElement(SUBSYSTEM, subsystemName);
return root.hasChild(subsystem);
} | [
"public",
"boolean",
"hasDeploymentSubsystemModel",
"(",
"final",
"String",
"subsystemName",
")",
"{",
"final",
"Resource",
"root",
"=",
"deploymentUnit",
".",
"getAttachment",
"(",
"DEPLOYMENT_RESOURCE",
")",
";",
"final",
"PathElement",
"subsystem",
"=",
"PathElemen... | Checks to see if a subsystem resource has already been registered for the deployment.
@param subsystemName the name of the subsystem
@return {@code true} if the subsystem exists on the deployment otherwise {@code false} | [
"Checks",
"to",
"see",
"if",
"a",
"subsystem",
"resource",
"has",
"already",
"been",
"registered",
"for",
"the",
"deployment",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java#L59-L63 |
159,142 | wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java | DeploymentResourceSupport.getDeploymentSubsystemModel | public ModelNode getDeploymentSubsystemModel(final String subsystemName) {
assert subsystemName != null : "The subsystemName cannot be null";
return getDeploymentSubModel(subsystemName, PathAddress.EMPTY_ADDRESS, null, deploymentUnit);
} | java | public ModelNode getDeploymentSubsystemModel(final String subsystemName) {
assert subsystemName != null : "The subsystemName cannot be null";
return getDeploymentSubModel(subsystemName, PathAddress.EMPTY_ADDRESS, null, deploymentUnit);
} | [
"public",
"ModelNode",
"getDeploymentSubsystemModel",
"(",
"final",
"String",
"subsystemName",
")",
"{",
"assert",
"subsystemName",
"!=",
"null",
":",
"\"The subsystemName cannot be null\"",
";",
"return",
"getDeploymentSubModel",
"(",
"subsystemName",
",",
"PathAddress",
... | Get the subsystem deployment model root.
<p>
If the subsystem resource does not exist one will be created.
</p>
@param subsystemName the subsystem name.
@return the model | [
"Get",
"the",
"subsystem",
"deployment",
"model",
"root",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java#L76-L79 |
159,143 | wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java | DeploymentResourceSupport.registerDeploymentSubsystemResource | public ModelNode registerDeploymentSubsystemResource(final String subsystemName, final Resource resource) {
assert subsystemName != null : "The subsystemName cannot be null";
assert resource != null : "The resource cannot be null";
return registerDeploymentSubResource(subsystemName, PathAddress.... | java | public ModelNode registerDeploymentSubsystemResource(final String subsystemName, final Resource resource) {
assert subsystemName != null : "The subsystemName cannot be null";
assert resource != null : "The resource cannot be null";
return registerDeploymentSubResource(subsystemName, PathAddress.... | [
"public",
"ModelNode",
"registerDeploymentSubsystemResource",
"(",
"final",
"String",
"subsystemName",
",",
"final",
"Resource",
"resource",
")",
"{",
"assert",
"subsystemName",
"!=",
"null",
":",
"\"The subsystemName cannot be null\"",
";",
"assert",
"resource",
"!=",
... | Registers the resource to the parent deployment resource. The model returned is that of the resource parameter.
@param subsystemName the subsystem name
@param resource the resource to be used for the subsystem on the deployment
@return the model
@throws java.lang.IllegalStateException if the subsystem resource ... | [
"Registers",
"the",
"resource",
"to",
"the",
"parent",
"deployment",
"resource",
".",
"The",
"model",
"returned",
"is",
"that",
"of",
"the",
"resource",
"parameter",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java#L91-L95 |
159,144 | wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java | DeploymentResourceSupport.getOrCreateSubDeployment | static Resource getOrCreateSubDeployment(final String deploymentName, final DeploymentUnit parent) {
final Resource root = parent.getAttachment(DEPLOYMENT_RESOURCE);
return getOrCreate(root, PathElement.pathElement(SUBDEPLOYMENT, deploymentName));
} | java | static Resource getOrCreateSubDeployment(final String deploymentName, final DeploymentUnit parent) {
final Resource root = parent.getAttachment(DEPLOYMENT_RESOURCE);
return getOrCreate(root, PathElement.pathElement(SUBDEPLOYMENT, deploymentName));
} | [
"static",
"Resource",
"getOrCreateSubDeployment",
"(",
"final",
"String",
"deploymentName",
",",
"final",
"DeploymentUnit",
"parent",
")",
"{",
"final",
"Resource",
"root",
"=",
"parent",
".",
"getAttachment",
"(",
"DEPLOYMENT_RESOURCE",
")",
";",
"return",
"getOrCr... | Gets or creates the a resource for the sub-deployment on the parent deployments resource.
@param deploymentName the name of the deployment
@param parent the parent deployment used to find the parent resource
@return the already registered resource or a newly created resource | [
"Gets",
"or",
"creates",
"the",
"a",
"resource",
"for",
"the",
"sub",
"-",
"deployment",
"on",
"the",
"parent",
"deployments",
"resource",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java#L231-L234 |
159,145 | wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java | DeploymentResourceSupport.cleanup | static void cleanup(final Resource resource) {
synchronized (resource) {
for (final Resource.ResourceEntry entry : resource.getChildren(SUBSYSTEM)) {
resource.removeChild(entry.getPathElement());
}
for (final Resource.ResourceEntry entry : resource.getChildren... | java | static void cleanup(final Resource resource) {
synchronized (resource) {
for (final Resource.ResourceEntry entry : resource.getChildren(SUBSYSTEM)) {
resource.removeChild(entry.getPathElement());
}
for (final Resource.ResourceEntry entry : resource.getChildren... | [
"static",
"void",
"cleanup",
"(",
"final",
"Resource",
"resource",
")",
"{",
"synchronized",
"(",
"resource",
")",
"{",
"for",
"(",
"final",
"Resource",
".",
"ResourceEntry",
"entry",
":",
"resource",
".",
"getChildren",
"(",
"SUBSYSTEM",
")",
")",
"{",
"r... | Cleans up the subsystem children for the deployment and each sub-deployment resource.
@param resource the subsystem resource to clean up | [
"Cleans",
"up",
"the",
"subsystem",
"children",
"for",
"the",
"deployment",
"and",
"each",
"sub",
"-",
"deployment",
"resource",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java#L241-L250 |
159,146 | wildfly/wildfly-core | embedded/src/main/java/org/wildfly/core/embedded/SystemPropertyContext.java | SystemPropertyContext.resolveBaseDir | Path resolveBaseDir(final String name, final String dirName) {
final String currentDir = SecurityActions.getPropertyPrivileged(name);
if (currentDir == null) {
return jbossHomeDir.resolve(dirName);
}
return Paths.get(currentDir);
} | java | Path resolveBaseDir(final String name, final String dirName) {
final String currentDir = SecurityActions.getPropertyPrivileged(name);
if (currentDir == null) {
return jbossHomeDir.resolve(dirName);
}
return Paths.get(currentDir);
} | [
"Path",
"resolveBaseDir",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"dirName",
")",
"{",
"final",
"String",
"currentDir",
"=",
"SecurityActions",
".",
"getPropertyPrivileged",
"(",
"name",
")",
";",
"if",
"(",
"currentDir",
"==",
"null",
")",
"... | Resolves the base directory. If the system property is set that value will be used. Otherwise the path is
resolved from the home directory.
@param name the system property name
@param dirName the directory name relative to the base directory
@return the resolved base directory | [
"Resolves",
"the",
"base",
"directory",
".",
"If",
"the",
"system",
"property",
"is",
"set",
"that",
"value",
"will",
"be",
"used",
".",
"Otherwise",
"the",
"path",
"is",
"resolved",
"from",
"the",
"home",
"directory",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/embedded/src/main/java/org/wildfly/core/embedded/SystemPropertyContext.java#L151-L157 |
159,147 | wildfly/wildfly-core | embedded/src/main/java/org/wildfly/core/embedded/SystemPropertyContext.java | SystemPropertyContext.resolvePath | static Path resolvePath(final Path base, final String... paths) {
return Paths.get(base.toString(), paths);
} | java | static Path resolvePath(final Path base, final String... paths) {
return Paths.get(base.toString(), paths);
} | [
"static",
"Path",
"resolvePath",
"(",
"final",
"Path",
"base",
",",
"final",
"String",
"...",
"paths",
")",
"{",
"return",
"Paths",
".",
"get",
"(",
"base",
".",
"toString",
"(",
")",
",",
"paths",
")",
";",
"}"
] | Resolves a path relative to the base path.
@param base the base path
@param paths paths relative to the base directory
@return the resolved path | [
"Resolves",
"a",
"path",
"relative",
"to",
"the",
"base",
"path",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/embedded/src/main/java/org/wildfly/core/embedded/SystemPropertyContext.java#L167-L169 |
159,148 | wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/operations/global/GlobalOperationHandlers.java | GlobalOperationHandlers.getChildAddresses | static Map<String, Set<String>> getChildAddresses(final OperationContext context, final PathAddress addr, final ImmutableManagementResourceRegistration registry, Resource resource, final String validChildType) {
Map<String, Set<String>> result = new HashMap<>();
Predicate<String> validChildTypeFilter =... | java | static Map<String, Set<String>> getChildAddresses(final OperationContext context, final PathAddress addr, final ImmutableManagementResourceRegistration registry, Resource resource, final String validChildType) {
Map<String, Set<String>> result = new HashMap<>();
Predicate<String> validChildTypeFilter =... | [
"static",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"getChildAddresses",
"(",
"final",
"OperationContext",
"context",
",",
"final",
"PathAddress",
"addr",
",",
"final",
"ImmutableManagementResourceRegistration",
"registry",
",",
"Resource",
"resourc... | Gets the addresses of the child resources under the given resource.
@param context the operation context
@param registry registry entry representing the resource
@param resource the current resource
@param validChildType a single child type to which the results should be limited. If {@code null} the... | [
"Gets",
"the",
"addresses",
"of",
"the",
"child",
"resources",
"under",
"the",
"given",
"resource",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/operations/global/GlobalOperationHandlers.java#L1009-L1064 |
159,149 | Comcast/jrugged | jrugged-core/src/main/java/org/fishwife/jrugged/interval/DiscreteInterval.java | DiscreteInterval.plus | public DiscreteInterval plus(DiscreteInterval other) {
return new DiscreteInterval(this.min + other.min, this.max + other.max);
} | java | public DiscreteInterval plus(DiscreteInterval other) {
return new DiscreteInterval(this.min + other.min, this.max + other.max);
} | [
"public",
"DiscreteInterval",
"plus",
"(",
"DiscreteInterval",
"other",
")",
"{",
"return",
"new",
"DiscreteInterval",
"(",
"this",
".",
"min",
"+",
"other",
".",
"min",
",",
"this",
".",
"max",
"+",
"other",
".",
"max",
")",
";",
"}"
] | Returns an interval representing the addition of the
given interval with this one.
@param other interval to add to this one
@return interval sum | [
"Returns",
"an",
"interval",
"representing",
"the",
"addition",
"of",
"the",
"given",
"interval",
"with",
"this",
"one",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/interval/DiscreteInterval.java#L74-L76 |
159,150 | Comcast/jrugged | jrugged-core/src/main/java/org/fishwife/jrugged/interval/DiscreteInterval.java | DiscreteInterval.minus | public DiscreteInterval minus(DiscreteInterval other) {
return new DiscreteInterval(this.min - other.max, this.max - other.min);
} | java | public DiscreteInterval minus(DiscreteInterval other) {
return new DiscreteInterval(this.min - other.max, this.max - other.min);
} | [
"public",
"DiscreteInterval",
"minus",
"(",
"DiscreteInterval",
"other",
")",
"{",
"return",
"new",
"DiscreteInterval",
"(",
"this",
".",
"min",
"-",
"other",
".",
"max",
",",
"this",
".",
"max",
"-",
"other",
".",
"min",
")",
";",
"}"
] | Returns an interval representing the subtraction of the
given interval from this one.
@param other interval to subtract from this one
@return result of subtraction | [
"Returns",
"an",
"interval",
"representing",
"the",
"subtraction",
"of",
"the",
"given",
"interval",
"from",
"this",
"one",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/interval/DiscreteInterval.java#L91-L93 |
159,151 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/AnnotatedMethodScanner.java | AnnotatedMethodScanner.findAnnotatedMethods | public Set<Method> findAnnotatedMethods(String scanBase, Class<? extends Annotation> annotationClass) {
Set<BeanDefinition> filteredComponents = findCandidateBeans(scanBase, annotationClass);
return extractAnnotatedMethods(filteredComponents, annotationClass);
} | java | public Set<Method> findAnnotatedMethods(String scanBase, Class<? extends Annotation> annotationClass) {
Set<BeanDefinition> filteredComponents = findCandidateBeans(scanBase, annotationClass);
return extractAnnotatedMethods(filteredComponents, annotationClass);
} | [
"public",
"Set",
"<",
"Method",
">",
"findAnnotatedMethods",
"(",
"String",
"scanBase",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
")",
"{",
"Set",
"<",
"BeanDefinition",
">",
"filteredComponents",
"=",
"findCandidateBeans",
"(",
"s... | Find all methods on classes under scanBase that are annotated with annotationClass.
@param scanBase Package to scan recursively, in dot notation (ie: org.jrugged...)
@param annotationClass Class of the annotation to search for
@return Set<Method> The set of all @{java.lang.reflect.Method}s having the annotation | [
"Find",
"all",
"methods",
"on",
"classes",
"under",
"scanBase",
"that",
"are",
"annotated",
"with",
"annotationClass",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/AnnotatedMethodScanner.java#L48-L51 |
159,152 | Comcast/jrugged | jrugged-core/src/main/java/org/fishwife/jrugged/CircuitBreaker.java | CircuitBreaker.reset | public void reset() {
state = BreakerState.CLOSED;
isHardTrip = false;
byPass = false;
isAttemptLive = false;
notifyBreakerStateChange(getStatus());
} | java | public void reset() {
state = BreakerState.CLOSED;
isHardTrip = false;
byPass = false;
isAttemptLive = false;
notifyBreakerStateChange(getStatus());
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"state",
"=",
"BreakerState",
".",
"CLOSED",
";",
"isHardTrip",
"=",
"false",
";",
"byPass",
"=",
"false",
";",
"isAttemptLive",
"=",
"false",
";",
"notifyBreakerStateChange",
"(",
"getStatus",
"(",
")",
")",
";",
... | Manually set the breaker to be reset and ready for use. This
is only useful after a manual trip otherwise the breaker will
trip automatically again if the service is still unavailable.
Just like a real breaker. WOOT!!! | [
"Manually",
"set",
"the",
"breaker",
"to",
"be",
"reset",
"and",
"ready",
"for",
"use",
".",
"This",
"is",
"only",
"useful",
"after",
"a",
"manual",
"trip",
"otherwise",
"the",
"breaker",
"will",
"trip",
"automatically",
"again",
"if",
"the",
"service",
"i... | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/CircuitBreaker.java#L403-L410 |
159,153 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanServerAdapter.java | WebMBeanServerAdapter.createWebMBeanAdapter | public WebMBeanAdapter createWebMBeanAdapter(String mBeanName, String encoding)
throws JMException, UnsupportedEncodingException {
return new WebMBeanAdapter(mBeanServer, mBeanName, encoding);
} | java | public WebMBeanAdapter createWebMBeanAdapter(String mBeanName, String encoding)
throws JMException, UnsupportedEncodingException {
return new WebMBeanAdapter(mBeanServer, mBeanName, encoding);
} | [
"public",
"WebMBeanAdapter",
"createWebMBeanAdapter",
"(",
"String",
"mBeanName",
",",
"String",
"encoding",
")",
"throws",
"JMException",
",",
"UnsupportedEncodingException",
"{",
"return",
"new",
"WebMBeanAdapter",
"(",
"mBeanServer",
",",
"mBeanName",
",",
"encoding"... | Create a WebMBeanAdaptor for a specified MBean name.
@param mBeanName the MBean name (can be URL-encoded).
@param encoding the string encoding to be used (i.e. UTF-8)
@return the created WebMBeanAdaptor.
@throws JMException Java Management Exception
@throws UnsupportedEncodingException if the encoding is not supported. | [
"Create",
"a",
"WebMBeanAdaptor",
"for",
"a",
"specified",
"MBean",
"name",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanServerAdapter.java#L71-L74 |
159,154 | Comcast/jrugged | jrugged-core/src/main/java/org/fishwife/jrugged/WindowedEventCounter.java | WindowedEventCounter.mark | public void mark() {
final long currentTimeMillis = clock.currentTimeMillis();
synchronized (queue) {
if (queue.size() == capacity) {
/*
* we're all filled up already, let's dequeue the oldest
* timestamp to make room for this new one.
... | java | public void mark() {
final long currentTimeMillis = clock.currentTimeMillis();
synchronized (queue) {
if (queue.size() == capacity) {
/*
* we're all filled up already, let's dequeue the oldest
* timestamp to make room for this new one.
... | [
"public",
"void",
"mark",
"(",
")",
"{",
"final",
"long",
"currentTimeMillis",
"=",
"clock",
".",
"currentTimeMillis",
"(",
")",
";",
"synchronized",
"(",
"queue",
")",
"{",
"if",
"(",
"queue",
".",
"size",
"(",
")",
"==",
"capacity",
")",
"{",
"/*\n ... | Record a new event. | [
"Record",
"a",
"new",
"event",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/WindowedEventCounter.java#L75-L88 |
159,155 | Comcast/jrugged | jrugged-core/src/main/java/org/fishwife/jrugged/WindowedEventCounter.java | WindowedEventCounter.tally | public int tally() {
long currentTimeMillis = clock.currentTimeMillis();
// calculates time for which we remove any errors before
final long removeTimesBeforeMillis = currentTimeMillis - windowMillis;
synchronized (queue) {
// drain out any expired timestamps but don't drai... | java | public int tally() {
long currentTimeMillis = clock.currentTimeMillis();
// calculates time for which we remove any errors before
final long removeTimesBeforeMillis = currentTimeMillis - windowMillis;
synchronized (queue) {
// drain out any expired timestamps but don't drai... | [
"public",
"int",
"tally",
"(",
")",
"{",
"long",
"currentTimeMillis",
"=",
"clock",
".",
"currentTimeMillis",
"(",
")",
";",
"// calculates time for which we remove any errors before",
"final",
"long",
"removeTimesBeforeMillis",
"=",
"currentTimeMillis",
"-",
"windowMilli... | Returns a count of in-window events.
@return the the count of in-window events. | [
"Returns",
"a",
"count",
"of",
"in",
"-",
"window",
"events",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/WindowedEventCounter.java#L95-L108 |
159,156 | Comcast/jrugged | jrugged-core/src/main/java/org/fishwife/jrugged/WindowedEventCounter.java | WindowedEventCounter.setCapacity | public void setCapacity(int capacity) {
if (capacity <= 0) {
throw new IllegalArgumentException("capacity must be greater than 0");
}
synchronized (queue) {
// If the capacity was reduced, we remove oldest elements until the
// queue fits inside the specified... | java | public void setCapacity(int capacity) {
if (capacity <= 0) {
throw new IllegalArgumentException("capacity must be greater than 0");
}
synchronized (queue) {
// If the capacity was reduced, we remove oldest elements until the
// queue fits inside the specified... | [
"public",
"void",
"setCapacity",
"(",
"int",
"capacity",
")",
"{",
"if",
"(",
"capacity",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"capacity must be greater than 0\"",
")",
";",
"}",
"synchronized",
"(",
"queue",
")",
"{",
"// If... | Specifies the maximum capacity of the counter.
@param capacity
<code>long</code>
@throws IllegalArgumentException
if windowMillis is less than 1. | [
"Specifies",
"the",
"maximum",
"capacity",
"of",
"the",
"counter",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/WindowedEventCounter.java#L128-L144 |
159,157 | Comcast/jrugged | jrugged-aspects/src/main/java/org/fishwife/jrugged/aspects/RetryableAspect.java | RetryableAspect.call | @Around("@annotation(retryableAnnotation)")
public Object call(final ProceedingJoinPoint pjp, Retryable retryableAnnotation) throws Throwable {
final int maxTries = retryableAnnotation.maxTries();
final int retryDelayMillies = retryableAnnotation.retryDelayMillis();
final Class<? extends Thr... | java | @Around("@annotation(retryableAnnotation)")
public Object call(final ProceedingJoinPoint pjp, Retryable retryableAnnotation) throws Throwable {
final int maxTries = retryableAnnotation.maxTries();
final int retryDelayMillies = retryableAnnotation.retryDelayMillis();
final Class<? extends Thr... | [
"@",
"Around",
"(",
"\"@annotation(retryableAnnotation)\"",
")",
"public",
"Object",
"call",
"(",
"final",
"ProceedingJoinPoint",
"pjp",
",",
"Retryable",
"retryableAnnotation",
")",
"throws",
"Throwable",
"{",
"final",
"int",
"maxTries",
"=",
"retryableAnnotation",
"... | Runs a method call with retries.
@param pjp a {@link ProceedingJoinPoint} representing an annotated
method call.
@param retryableAnnotation the {@link org.fishwife.jrugged.aspects.Retryable}
annotation that wrapped the method.
@throws Throwable if the method invocation itself throws one during execution.
@return The re... | [
"Runs",
"a",
"method",
"call",
"with",
"retries",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-aspects/src/main/java/org/fishwife/jrugged/aspects/RetryableAspect.java#L49-L86 |
159,158 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java | WebMBeanAdapter.getAttributeMetadata | public Map<String, MBeanAttributeInfo> getAttributeMetadata() {
MBeanAttributeInfo[] attributeList = mBeanInfo.getAttributes();
Map<String, MBeanAttributeInfo> attributeMap = new TreeMap<String, MBeanAttributeInfo>();
for (MBeanAttributeInfo attribute: attributeList) {
attributeMap... | java | public Map<String, MBeanAttributeInfo> getAttributeMetadata() {
MBeanAttributeInfo[] attributeList = mBeanInfo.getAttributes();
Map<String, MBeanAttributeInfo> attributeMap = new TreeMap<String, MBeanAttributeInfo>();
for (MBeanAttributeInfo attribute: attributeList) {
attributeMap... | [
"public",
"Map",
"<",
"String",
",",
"MBeanAttributeInfo",
">",
"getAttributeMetadata",
"(",
")",
"{",
"MBeanAttributeInfo",
"[",
"]",
"attributeList",
"=",
"mBeanInfo",
".",
"getAttributes",
"(",
")",
";",
"Map",
"<",
"String",
",",
"MBeanAttributeInfo",
">",
... | Get the Attribute metadata for an MBean by name.
@return the {@link Map} of {@link String} attribute names to {@link MBeanAttributeInfo} values. | [
"Get",
"the",
"Attribute",
"metadata",
"for",
"an",
"MBean",
"by",
"name",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java#L73-L82 |
159,159 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java | WebMBeanAdapter.getOperationMetadata | public Map<String, MBeanOperationInfo> getOperationMetadata() {
MBeanOperationInfo[] operations = mBeanInfo.getOperations();
Map<String, MBeanOperationInfo> operationMap = new TreeMap<String, MBeanOperationInfo>();
for (MBeanOperationInfo operation: operations) {
operationMap.put(o... | java | public Map<String, MBeanOperationInfo> getOperationMetadata() {
MBeanOperationInfo[] operations = mBeanInfo.getOperations();
Map<String, MBeanOperationInfo> operationMap = new TreeMap<String, MBeanOperationInfo>();
for (MBeanOperationInfo operation: operations) {
operationMap.put(o... | [
"public",
"Map",
"<",
"String",
",",
"MBeanOperationInfo",
">",
"getOperationMetadata",
"(",
")",
"{",
"MBeanOperationInfo",
"[",
"]",
"operations",
"=",
"mBeanInfo",
".",
"getOperations",
"(",
")",
";",
"Map",
"<",
"String",
",",
"MBeanOperationInfo",
">",
"o... | Get the Operation metadata for an MBean by name.
@return the {@link Map} of {@link String} operation names to {@link MBeanOperationInfo} values. | [
"Get",
"the",
"Operation",
"metadata",
"for",
"an",
"MBean",
"by",
"name",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java#L88-L97 |
159,160 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java | WebMBeanAdapter.getOperationInfo | public MBeanOperationInfo getOperationInfo(String operationName)
throws OperationNotFoundException, UnsupportedEncodingException {
String decodedOperationName = sanitizer.urlDecode(operationName, encoding);
Map<String, MBeanOperationInfo> operationMap = getOperationMetadata();
if (opera... | java | public MBeanOperationInfo getOperationInfo(String operationName)
throws OperationNotFoundException, UnsupportedEncodingException {
String decodedOperationName = sanitizer.urlDecode(operationName, encoding);
Map<String, MBeanOperationInfo> operationMap = getOperationMetadata();
if (opera... | [
"public",
"MBeanOperationInfo",
"getOperationInfo",
"(",
"String",
"operationName",
")",
"throws",
"OperationNotFoundException",
",",
"UnsupportedEncodingException",
"{",
"String",
"decodedOperationName",
"=",
"sanitizer",
".",
"urlDecode",
"(",
"operationName",
",",
"encod... | Get the Operation metadata for a single operation on an MBean by name.
@param operationName the Operation name (can be URL-encoded).
@return the {@link MBeanOperationInfo} for the operation.
@throws OperationNotFoundException Method was not found
@throws UnsupportedEncodingException if the encoding is not supported. | [
"Get",
"the",
"Operation",
"metadata",
"for",
"a",
"single",
"operation",
"on",
"an",
"MBean",
"by",
"name",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java#L106-L116 |
159,161 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java | WebMBeanAdapter.getAttributeValues | public Map<String,Object> getAttributeValues()
throws AttributeNotFoundException, InstanceNotFoundException, ReflectionException {
HashSet<String> attributeSet = new HashSet<String>();
for (MBeanAttributeInfo attributeInfo : mBeanInfo.getAttributes()) {
attributeSet.add(attributeI... | java | public Map<String,Object> getAttributeValues()
throws AttributeNotFoundException, InstanceNotFoundException, ReflectionException {
HashSet<String> attributeSet = new HashSet<String>();
for (MBeanAttributeInfo attributeInfo : mBeanInfo.getAttributes()) {
attributeSet.add(attributeI... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getAttributeValues",
"(",
")",
"throws",
"AttributeNotFoundException",
",",
"InstanceNotFoundException",
",",
"ReflectionException",
"{",
"HashSet",
"<",
"String",
">",
"attributeSet",
"=",
"new",
"HashSet",
"<",
... | Get all the attribute values for an MBean by name. The values are HTML escaped.
@return the {@link Map} of attribute names and values.
@throws javax.management.AttributeNotFoundException Unable to find the 'attribute'
@throws InstanceNotFoundException unable to find the specific bean
@throws ReflectionException unable... | [
"Get",
"all",
"the",
"attribute",
"values",
"for",
"an",
"MBean",
"by",
"name",
".",
"The",
"values",
"are",
"HTML",
"escaped",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java#L125-L143 |
159,162 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java | WebMBeanAdapter.getAttributeValue | public String getAttributeValue(String attributeName)
throws JMException, UnsupportedEncodingException {
String decodedAttributeName = sanitizer.urlDecode(attributeName, encoding);
return sanitizer.escapeValue(mBeanServer.getAttribute(objectName, decodedAttributeName));
} | java | public String getAttributeValue(String attributeName)
throws JMException, UnsupportedEncodingException {
String decodedAttributeName = sanitizer.urlDecode(attributeName, encoding);
return sanitizer.escapeValue(mBeanServer.getAttribute(objectName, decodedAttributeName));
} | [
"public",
"String",
"getAttributeValue",
"(",
"String",
"attributeName",
")",
"throws",
"JMException",
",",
"UnsupportedEncodingException",
"{",
"String",
"decodedAttributeName",
"=",
"sanitizer",
".",
"urlDecode",
"(",
"attributeName",
",",
"encoding",
")",
";",
"ret... | Get the value for a single attribute on an MBean by name.
@param attributeName the attribute name (can be URL-encoded).
@return the value as a String.
@throws JMException Java Management Exception
@throws UnsupportedEncodingException if the encoding is not supported. | [
"Get",
"the",
"value",
"for",
"a",
"single",
"attribute",
"on",
"an",
"MBean",
"by",
"name",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java#L152-L156 |
159,163 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java | WebMBeanAdapter.invokeOperation | public String invokeOperation(String operationName, Map<String, String[]> parameterMap)
throws JMException, UnsupportedEncodingException {
MBeanOperationInfo operationInfo = getOperationInfo(operationName);
MBeanOperationInvoker invoker = createMBeanOperationInvoker(mBeanServer, objectName, oper... | java | public String invokeOperation(String operationName, Map<String, String[]> parameterMap)
throws JMException, UnsupportedEncodingException {
MBeanOperationInfo operationInfo = getOperationInfo(operationName);
MBeanOperationInvoker invoker = createMBeanOperationInvoker(mBeanServer, objectName, oper... | [
"public",
"String",
"invokeOperation",
"(",
"String",
"operationName",
",",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"parameterMap",
")",
"throws",
"JMException",
",",
"UnsupportedEncodingException",
"{",
"MBeanOperationInfo",
"operationInfo",
"=",
"getOp... | Invoke an operation on an MBean by name.
Note that only basic data types are supported for parameter values.
@param operationName the operation name (can be URL-encoded).
@param parameterMap the {@link Map} of parameter names and value arrays.
@return the returned value from the operation.
@throws JMException Java Mana... | [
"Invoke",
"an",
"operation",
"on",
"an",
"MBean",
"by",
"name",
".",
"Note",
"that",
"only",
"basic",
"data",
"types",
"are",
"supported",
"for",
"parameter",
"values",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java#L167-L172 |
159,164 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/MBeanStringSanitizer.java | MBeanStringSanitizer.urlDecode | String urlDecode(String name, String encoding) throws UnsupportedEncodingException {
return URLDecoder.decode(name, encoding);
} | java | String urlDecode(String name, String encoding) throws UnsupportedEncodingException {
return URLDecoder.decode(name, encoding);
} | [
"String",
"urlDecode",
"(",
"String",
"name",
",",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"URLDecoder",
".",
"decode",
"(",
"name",
",",
"encoding",
")",
";",
"}"
] | Convert a URL Encoded name back to the original form.
@param name the name to URL urlDecode.
@param encoding the string encoding to be used (i.e. UTF-8)
@return the name in original form.
@throws UnsupportedEncodingException if the encoding is not supported. | [
"Convert",
"a",
"URL",
"Encoded",
"name",
"back",
"to",
"the",
"original",
"form",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/MBeanStringSanitizer.java#L37-L39 |
159,165 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/MBeanStringSanitizer.java | MBeanStringSanitizer.escapeValue | String escapeValue(Object value) {
return HtmlUtils.htmlEscape(value != null ? value.toString() : "<null>");
} | java | String escapeValue(Object value) {
return HtmlUtils.htmlEscape(value != null ? value.toString() : "<null>");
} | [
"String",
"escapeValue",
"(",
"Object",
"value",
")",
"{",
"return",
"HtmlUtils",
".",
"htmlEscape",
"(",
"value",
"!=",
"null",
"?",
"value",
".",
"toString",
"(",
")",
":",
"\"<null>\"",
")",
";",
"}"
] | Escape a value to be HTML friendly.
@param value the Object value.
@return the HTML-escaped String, or <null> if the value is null. | [
"Escape",
"a",
"value",
"to",
"be",
"HTML",
"friendly",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/MBeanStringSanitizer.java#L46-L48 |
159,166 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/config/PerformanceMonitorBeanDefinitionDecorator.java | PerformanceMonitorBeanDefinitionDecorator.registerProxyCreator | private void registerProxyCreator(Node source,
BeanDefinitionHolder holder,
ParserContext context) {
String beanName = holder.getBeanName();
String proxyName = beanName + "Proxy";
String interceptorName = beanName + "Pe... | java | private void registerProxyCreator(Node source,
BeanDefinitionHolder holder,
ParserContext context) {
String beanName = holder.getBeanName();
String proxyName = beanName + "Proxy";
String interceptorName = beanName + "Pe... | [
"private",
"void",
"registerProxyCreator",
"(",
"Node",
"source",
",",
"BeanDefinitionHolder",
"holder",
",",
"ParserContext",
"context",
")",
"{",
"String",
"beanName",
"=",
"holder",
".",
"getBeanName",
"(",
")",
";",
"String",
"proxyName",
"=",
"beanName",
"+... | Registers a BeanNameAutoProxyCreator class that wraps the bean being
monitored. The proxy is associated with the PerformanceMonitorInterceptor
for the bean, which is created when parsing the methods attribute from
the springconfiguration xml file.
@param source An Attribute node from the spring configuration
@param ho... | [
"Registers",
"a",
"BeanNameAutoProxyCreator",
"class",
"that",
"wraps",
"the",
"bean",
"being",
"monitored",
".",
"The",
"proxy",
"is",
"associated",
"with",
"the",
"PerformanceMonitorInterceptor",
"for",
"the",
"bean",
"which",
"is",
"created",
"when",
"parsing",
... | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/config/PerformanceMonitorBeanDefinitionDecorator.java#L78-L94 |
159,167 | Comcast/jrugged | jrugged-core/src/main/java/org/fishwife/jrugged/CircuitBreakerFactory.java | CircuitBreakerFactory.getIntegerPropertyOverrideValue | private Integer getIntegerPropertyOverrideValue(String name, String key) {
if (properties != null) {
String propertyName = getPropertyName(name, key);
String propertyOverrideValue = properties.getProperty(propertyName);
if (propertyOverrideValue != null) {
t... | java | private Integer getIntegerPropertyOverrideValue(String name, String key) {
if (properties != null) {
String propertyName = getPropertyName(name, key);
String propertyOverrideValue = properties.getProperty(propertyName);
if (propertyOverrideValue != null) {
t... | [
"private",
"Integer",
"getIntegerPropertyOverrideValue",
"(",
"String",
"name",
",",
"String",
"key",
")",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"String",
"propertyName",
"=",
"getPropertyName",
"(",
"name",
",",
"key",
")",
";",
"String",
"p... | Get an integer property override value.
@param name the {@link CircuitBreaker} name.
@param key the property override key.
@return the property override value, or null if it is not found. | [
"Get",
"an",
"integer",
"property",
"override",
"value",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/CircuitBreakerFactory.java#L174-L191 |
159,168 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/config/SingleServiceWrapperInterceptor.java | SingleServiceWrapperInterceptor.shouldWrapMethodCall | private boolean shouldWrapMethodCall(String methodName) {
if (methodList == null) {
return true; // Wrap all by default
}
if (methodList.contains(methodName)) {
return true; //Wrap a specific method
}
// If I get to this point, I should not wrap the call... | java | private boolean shouldWrapMethodCall(String methodName) {
if (methodList == null) {
return true; // Wrap all by default
}
if (methodList.contains(methodName)) {
return true; //Wrap a specific method
}
// If I get to this point, I should not wrap the call... | [
"private",
"boolean",
"shouldWrapMethodCall",
"(",
"String",
"methodName",
")",
"{",
"if",
"(",
"methodList",
"==",
"null",
")",
"{",
"return",
"true",
";",
"// Wrap all by default",
"}",
"if",
"(",
"methodList",
".",
"contains",
"(",
"methodName",
")",
")",
... | Checks if the method being invoked should be wrapped by a service.
It looks the method name up in the methodList. If its in the list, then
the method should be wrapped. If the list is null, then all methods
are wrapped.
@param methodName The method being called
@return boolean | [
"Checks",
"if",
"the",
"method",
"being",
"invoked",
"should",
"be",
"wrapped",
"by",
"a",
"service",
".",
"It",
"looks",
"the",
"method",
"name",
"up",
"in",
"the",
"methodList",
".",
"If",
"its",
"in",
"the",
"list",
"then",
"the",
"method",
"should",
... | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/config/SingleServiceWrapperInterceptor.java#L79-L90 |
159,169 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/MBeanOperationInvoker.java | MBeanOperationInvoker.invokeOperation | public Object invokeOperation(Map<String, String[]> parameterMap) throws JMException {
MBeanParameterInfo[] parameterInfoArray = operationInfo.getSignature();
Object[] values = new Object[parameterInfoArray.length];
String[] types = new String[parameterInfoArray.length];
MBeanValueConv... | java | public Object invokeOperation(Map<String, String[]> parameterMap) throws JMException {
MBeanParameterInfo[] parameterInfoArray = operationInfo.getSignature();
Object[] values = new Object[parameterInfoArray.length];
String[] types = new String[parameterInfoArray.length];
MBeanValueConv... | [
"public",
"Object",
"invokeOperation",
"(",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"parameterMap",
")",
"throws",
"JMException",
"{",
"MBeanParameterInfo",
"[",
"]",
"parameterInfoArray",
"=",
"operationInfo",
".",
"getSignature",
"(",
")",
";",
"... | Invoke the operation.
@param parameterMap the {@link Map} of parameter names to value arrays.
@return the {@link Object} return value from the operation.
@throws JMException Java Management Exception | [
"Invoke",
"the",
"operation",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/MBeanOperationInvoker.java#L52-L68 |
159,170 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/config/MonitorMethodInterceptorDefinitionDecorator.java | MonitorMethodInterceptorDefinitionDecorator.registerInterceptor | private void registerInterceptor(Node source,
String beanName,
BeanDefinitionRegistry registry) {
List<String> methodList = buildMethodList(source);
BeanDefinitionBuilder initializer =
BeanDefinitionBuilder.rootBeanDe... | java | private void registerInterceptor(Node source,
String beanName,
BeanDefinitionRegistry registry) {
List<String> methodList = buildMethodList(source);
BeanDefinitionBuilder initializer =
BeanDefinitionBuilder.rootBeanDe... | [
"private",
"void",
"registerInterceptor",
"(",
"Node",
"source",
",",
"String",
"beanName",
",",
"BeanDefinitionRegistry",
"registry",
")",
"{",
"List",
"<",
"String",
">",
"methodList",
"=",
"buildMethodList",
"(",
"source",
")",
";",
"BeanDefinitionBuilder",
"in... | Register a new SingleServiceWrapperInterceptor for the bean being
wrapped, associate it with the PerformanceMonitor and tell it which methods
to intercept.
@param source An Attribute node from the spring configuration
@param beanName The name of the bean that this performance monitor is wrapped around
@param registry ... | [
"Register",
"a",
"new",
"SingleServiceWrapperInterceptor",
"for",
"the",
"bean",
"being",
"wrapped",
"associate",
"it",
"with",
"the",
"PerformanceMonitor",
"and",
"tell",
"it",
"which",
"methods",
"to",
"intercept",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/config/MonitorMethodInterceptorDefinitionDecorator.java#L69-L83 |
159,171 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/config/MonitorMethodInterceptorDefinitionDecorator.java | MonitorMethodInterceptorDefinitionDecorator.parseMethodList | public List<String> parseMethodList(String methods) {
String[] methodArray = StringUtils.delimitedListToStringArray(methods, ",");
List<String> methodList = new ArrayList<String>();
for (String methodName : methodArray) {
methodList.add(methodName.trim());
}
return... | java | public List<String> parseMethodList(String methods) {
String[] methodArray = StringUtils.delimitedListToStringArray(methods, ",");
List<String> methodList = new ArrayList<String>();
for (String methodName : methodArray) {
methodList.add(methodName.trim());
}
return... | [
"public",
"List",
"<",
"String",
">",
"parseMethodList",
"(",
"String",
"methods",
")",
"{",
"String",
"[",
"]",
"methodArray",
"=",
"StringUtils",
".",
"delimitedListToStringArray",
"(",
"methods",
",",
"\",\"",
")",
";",
"List",
"<",
"String",
">",
"method... | Parse a comma-delimited list of method names into a List of strings.
Whitespace is ignored.
@param methods the comma delimited list of methods from the spring configuration
@return List<String> | [
"Parse",
"a",
"comma",
"-",
"delimited",
"list",
"of",
"method",
"names",
"into",
"a",
"List",
"of",
"strings",
".",
"Whitespace",
"is",
"ignored",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/config/MonitorMethodInterceptorDefinitionDecorator.java#L107-L117 |
159,172 | Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/config/MonitorMethodInterceptorDefinitionDecorator.java | MonitorMethodInterceptorDefinitionDecorator.registerPerformanceMonitor | private void registerPerformanceMonitor(String beanName,
BeanDefinitionRegistry registry) {
String perfMonitorName = beanName + "PerformanceMonitor";
if (!registry.containsBeanDefinition(perfMonitorName)) {
BeanDefinitionBuilder initializer =
... | java | private void registerPerformanceMonitor(String beanName,
BeanDefinitionRegistry registry) {
String perfMonitorName = beanName + "PerformanceMonitor";
if (!registry.containsBeanDefinition(perfMonitorName)) {
BeanDefinitionBuilder initializer =
... | [
"private",
"void",
"registerPerformanceMonitor",
"(",
"String",
"beanName",
",",
"BeanDefinitionRegistry",
"registry",
")",
"{",
"String",
"perfMonitorName",
"=",
"beanName",
"+",
"\"PerformanceMonitor\"",
";",
"if",
"(",
"!",
"registry",
".",
"containsBeanDefinition",
... | Register a new PerformanceMonitor with Spring if it does not already exist.
@param beanName The name of the bean that this performance monitor is wrapped around
@param registry The registry where all the spring beans are registered | [
"Register",
"a",
"new",
"PerformanceMonitor",
"with",
"Spring",
"if",
"it",
"does",
"not",
"already",
"exist",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/config/MonitorMethodInterceptorDefinitionDecorator.java#L125-L134 |
159,173 | flapdoodle-oss/de.flapdoodle.embed.process | src/main/java/de/flapdoodle/embed/process/io/file/Files.java | Files.forceDelete | public static void forceDelete(final Path path) throws IOException {
if (!java.nio.file.Files.isDirectory(path)) {
java.nio.file.Files.delete(path);
} else {
java.nio.file.Files.walkFileTree(path, DeleteDirVisitor.getInstance());
}
} | java | public static void forceDelete(final Path path) throws IOException {
if (!java.nio.file.Files.isDirectory(path)) {
java.nio.file.Files.delete(path);
} else {
java.nio.file.Files.walkFileTree(path, DeleteDirVisitor.getInstance());
}
} | [
"public",
"static",
"void",
"forceDelete",
"(",
"final",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"java",
".",
"nio",
".",
"file",
".",
"Files",
".",
"isDirectory",
"(",
"path",
")",
")",
"{",
"java",
".",
"nio",
".",
"file"... | Deletes a path from the filesystem
If the path is a directory its contents
will be recursively deleted before it itself
is deleted.
Note that removal of a directory is not an atomic-operation
and so if an error occurs during removal, some of the directories
descendants may have already been removed
@throws IOExcepti... | [
"Deletes",
"a",
"path",
"from",
"the",
"filesystem"
] | c6eebcf6705372ab15d4c438dcefcd50ffbde6d0 | https://github.com/flapdoodle-oss/de.flapdoodle.embed.process/blob/c6eebcf6705372ab15d4c438dcefcd50ffbde6d0/src/main/java/de/flapdoodle/embed/process/io/file/Files.java#L143-L149 |
159,174 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/SelectCreator.java | SelectCreator.count | public PreparedStatementCreator count(final Dialect dialect) {
return new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection con)
throws SQLException {
return getPreparedStatementCreator()
.setSql(dialect.createCountSe... | java | public PreparedStatementCreator count(final Dialect dialect) {
return new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection con)
throws SQLException {
return getPreparedStatementCreator()
.setSql(dialect.createCountSe... | [
"public",
"PreparedStatementCreator",
"count",
"(",
"final",
"Dialect",
"dialect",
")",
"{",
"return",
"new",
"PreparedStatementCreator",
"(",
")",
"{",
"public",
"PreparedStatement",
"createPreparedStatement",
"(",
"Connection",
"con",
")",
"throws",
"SQLException",
... | Returns a PreparedStatementCreator that returns a count of the rows that
this creator would return.
@param dialect
Database dialect. | [
"Returns",
"a",
"PreparedStatementCreator",
"that",
"returns",
"a",
"count",
"of",
"the",
"rows",
"that",
"this",
"creator",
"would",
"return",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/SelectCreator.java#L80-L89 |
159,175 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/SelectCreator.java | SelectCreator.page | public PreparedStatementCreator page(final Dialect dialect, final int limit, final int offset) {
return new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection con) throws SQLException {
return getPreparedStatementCreator()
.setSql... | java | public PreparedStatementCreator page(final Dialect dialect, final int limit, final int offset) {
return new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection con) throws SQLException {
return getPreparedStatementCreator()
.setSql... | [
"public",
"PreparedStatementCreator",
"page",
"(",
"final",
"Dialect",
"dialect",
",",
"final",
"int",
"limit",
",",
"final",
"int",
"offset",
")",
"{",
"return",
"new",
"PreparedStatementCreator",
"(",
")",
"{",
"public",
"PreparedStatement",
"createPreparedStateme... | Returns a PreparedStatementCreator that returns a page of the underlying
result set.
@param dialect
Database dialect to use.
@param limit
Maximum number of rows to return.
@param offset
Index of the first row to return. | [
"Returns",
"a",
"PreparedStatementCreator",
"that",
"returns",
"a",
"page",
"of",
"the",
"underlying",
"result",
"set",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/SelectCreator.java#L165-L173 |
159,176 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/Column.java | Column.toColumnName | private static String toColumnName(String fieldName) {
int lastDot = fieldName.indexOf('.');
if (lastDot > -1) {
return fieldName.substring(lastDot + 1);
} else {
return fieldName;
}
} | java | private static String toColumnName(String fieldName) {
int lastDot = fieldName.indexOf('.');
if (lastDot > -1) {
return fieldName.substring(lastDot + 1);
} else {
return fieldName;
}
} | [
"private",
"static",
"String",
"toColumnName",
"(",
"String",
"fieldName",
")",
"{",
"int",
"lastDot",
"=",
"fieldName",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"lastDot",
">",
"-",
"1",
")",
"{",
"return",
"fieldName",
".",
"substring",
"(... | Returns the portion of the field name after the last dot, as field names
may actually be paths. | [
"Returns",
"the",
"portion",
"of",
"the",
"field",
"name",
"after",
"the",
"last",
"dot",
"as",
"field",
"names",
"may",
"actually",
"be",
"paths",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/Column.java#L15-L22 |
159,177 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/Predicates.java | Predicates.anyBitsSet | public static Predicate anyBitsSet(final String expr, final long bits) {
return new Predicate() {
private String param;
public void init(AbstractSqlCreator creator) {
param = creator.allocateParameter();
creator.setParameter(param, bits);
}
... | java | public static Predicate anyBitsSet(final String expr, final long bits) {
return new Predicate() {
private String param;
public void init(AbstractSqlCreator creator) {
param = creator.allocateParameter();
creator.setParameter(param, bits);
}
... | [
"public",
"static",
"Predicate",
"anyBitsSet",
"(",
"final",
"String",
"expr",
",",
"final",
"long",
"bits",
")",
"{",
"return",
"new",
"Predicate",
"(",
")",
"{",
"private",
"String",
"param",
";",
"public",
"void",
"init",
"(",
"AbstractSqlCreator",
"creat... | Adds a clause that checks whether ANY set bits in a bitmask are present
in a numeric expression.
@param expr
SQL numeric expression to check.
@param bits
Integer containing the bits for which to check. | [
"Adds",
"a",
"clause",
"that",
"checks",
"whether",
"ANY",
"set",
"bits",
"in",
"a",
"bitmask",
"are",
"present",
"in",
"a",
"numeric",
"expression",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/Predicates.java#L74-L85 |
159,178 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/Predicates.java | Predicates.is | public static Predicate is(final String sql) {
return new Predicate() {
public String toSql() {
return sql;
}
public void init(AbstractSqlCreator creator) {
}
};
} | java | public static Predicate is(final String sql) {
return new Predicate() {
public String toSql() {
return sql;
}
public void init(AbstractSqlCreator creator) {
}
};
} | [
"public",
"static",
"Predicate",
"is",
"(",
"final",
"String",
"sql",
")",
"{",
"return",
"new",
"Predicate",
"(",
")",
"{",
"public",
"String",
"toSql",
"(",
")",
"{",
"return",
"sql",
";",
"}",
"public",
"void",
"init",
"(",
"AbstractSqlCreator",
"crea... | Returns a predicate that takes no parameters. The given SQL expression is
used directly.
@param sql
SQL text of the expression | [
"Returns",
"a",
"predicate",
"that",
"takes",
"no",
"parameters",
".",
"The",
"given",
"SQL",
"expression",
"is",
"used",
"directly",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/Predicates.java#L171-L179 |
159,179 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/Predicates.java | Predicates.join | private static Predicate join(final String joinWord, final List<Predicate> preds) {
return new Predicate() {
public void init(AbstractSqlCreator creator) {
for (Predicate p : preds) {
p.init(creator);
}
}
public String toSql... | java | private static Predicate join(final String joinWord, final List<Predicate> preds) {
return new Predicate() {
public void init(AbstractSqlCreator creator) {
for (Predicate p : preds) {
p.init(creator);
}
}
public String toSql... | [
"private",
"static",
"Predicate",
"join",
"(",
"final",
"String",
"joinWord",
",",
"final",
"List",
"<",
"Predicate",
">",
"preds",
")",
"{",
"return",
"new",
"Predicate",
"(",
")",
"{",
"public",
"void",
"init",
"(",
"AbstractSqlCreator",
"creator",
")",
... | Factory for 'and' and 'or' predicates. | [
"Factory",
"for",
"and",
"and",
"or",
"predicates",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/Predicates.java#L184-L205 |
159,180 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java | Mapping.addFields | public Mapping<T> addFields() {
if (idColumn == null) {
throw new RuntimeException("Map ID column before adding class fields");
}
for (Field f : ReflectionUtils.getDeclaredFieldsInHierarchy(clazz)) {
if (!Modifier.isStatic(f.getModifiers())
&& !isFie... | java | public Mapping<T> addFields() {
if (idColumn == null) {
throw new RuntimeException("Map ID column before adding class fields");
}
for (Field f : ReflectionUtils.getDeclaredFieldsInHierarchy(clazz)) {
if (!Modifier.isStatic(f.getModifiers())
&& !isFie... | [
"public",
"Mapping",
"<",
"T",
">",
"addFields",
"(",
")",
"{",
"if",
"(",
"idColumn",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Map ID column before adding class fields\"",
")",
";",
"}",
"for",
"(",
"Field",
"f",
":",
"ReflectionU... | Adds mappings for each declared field in the mapped class. Any fields
already mapped by addColumn are skipped. | [
"Adds",
"mappings",
"for",
"each",
"declared",
"field",
"in",
"the",
"mapped",
"class",
".",
"Any",
"fields",
"already",
"mapped",
"by",
"addColumn",
"are",
"skipped",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java#L300-L315 |
159,181 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java | Mapping.createInstance | protected T createInstance() {
try {
Constructor<T> ctor = clazz.getDeclaredConstructor();
ctor.setAccessible(true);
return ctor.newInstance();
} catch (InstantiationException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {... | java | protected T createInstance() {
try {
Constructor<T> ctor = clazz.getDeclaredConstructor();
ctor.setAccessible(true);
return ctor.newInstance();
} catch (InstantiationException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {... | [
"protected",
"T",
"createInstance",
"(",
")",
"{",
"try",
"{",
"Constructor",
"<",
"T",
">",
"ctor",
"=",
"clazz",
".",
"getDeclaredConstructor",
"(",
")",
";",
"ctor",
".",
"setAccessible",
"(",
"true",
")",
";",
"return",
"ctor",
".",
"newInstance",
"(... | Creates instance of the entity class. This method is called to create the object
instances when returning query results. | [
"Creates",
"instance",
"of",
"the",
"entity",
"class",
".",
"This",
"method",
"is",
"called",
"to",
"create",
"the",
"object",
"instances",
"when",
"returning",
"query",
"results",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java#L330-L348 |
159,182 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java | Mapping.deleteById | public void deleteById(Object id) {
int count = beginDelete().whereEquals(idColumn.getColumnName(), id).delete();
if (count == 0) {
throw new RowNotFoundException(table, id);
}
} | java | public void deleteById(Object id) {
int count = beginDelete().whereEquals(idColumn.getColumnName(), id).delete();
if (count == 0) {
throw new RowNotFoundException(table, id);
}
} | [
"public",
"void",
"deleteById",
"(",
"Object",
"id",
")",
"{",
"int",
"count",
"=",
"beginDelete",
"(",
")",
".",
"whereEquals",
"(",
"idColumn",
".",
"getColumnName",
"(",
")",
",",
"id",
")",
".",
"delete",
"(",
")",
";",
"if",
"(",
"count",
"==",
... | Deletes an entity by its primary key.
@param id
Primary key of the entity. | [
"Deletes",
"an",
"entity",
"by",
"its",
"primary",
"key",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java#L363-L370 |
159,183 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java | Mapping.findById | public T findById(Object id) throws RowNotFoundException, TooManyRowsException {
return findWhere(eq(idColumn.getColumnName(), id)).getSingleResult();
} | java | public T findById(Object id) throws RowNotFoundException, TooManyRowsException {
return findWhere(eq(idColumn.getColumnName(), id)).getSingleResult();
} | [
"public",
"T",
"findById",
"(",
"Object",
"id",
")",
"throws",
"RowNotFoundException",
",",
"TooManyRowsException",
"{",
"return",
"findWhere",
"(",
"eq",
"(",
"idColumn",
".",
"getColumnName",
"(",
")",
",",
"id",
")",
")",
".",
"getSingleResult",
"(",
")",... | Finds an entity given its primary key.
@throws RowNotFoundException
If no such object was found.
@throws TooManyRowsException
If more that one object was returned for the given ID. | [
"Finds",
"an",
"entity",
"given",
"its",
"primary",
"key",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java#L380-L382 |
159,184 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java | Mapping.insert | public T insert(T entity) {
if (!hasPrimaryKey(entity)) {
throw new RuntimeException(String.format("Tried to insert entity of type %s with null or zero primary key",
entity.getClass().getSimpleName()));
}
InsertCreator insert = new InsertCreator(table);
... | java | public T insert(T entity) {
if (!hasPrimaryKey(entity)) {
throw new RuntimeException(String.format("Tried to insert entity of type %s with null or zero primary key",
entity.getClass().getSimpleName()));
}
InsertCreator insert = new InsertCreator(table);
... | [
"public",
"T",
"insert",
"(",
"T",
"entity",
")",
"{",
"if",
"(",
"!",
"hasPrimaryKey",
"(",
"entity",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"String",
".",
"format",
"(",
"\"Tried to insert entity of type %s with null or zero primary key\"",
",",... | Insert entity object. The caller must first initialize the primary key
field. | [
"Insert",
"entity",
"object",
".",
"The",
"caller",
"must",
"first",
"initialize",
"the",
"primary",
"key",
"field",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java#L454-L482 |
159,185 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java | Mapping.hasPrimaryKey | private boolean hasPrimaryKey(T entity) {
Object pk = getPrimaryKey(entity);
if (pk == null) {
return false;
} else {
if (pk instanceof Number && ((Number) pk).longValue() == 0) {
return false;
}
}
return true;
} | java | private boolean hasPrimaryKey(T entity) {
Object pk = getPrimaryKey(entity);
if (pk == null) {
return false;
} else {
if (pk instanceof Number && ((Number) pk).longValue() == 0) {
return false;
}
}
return true;
} | [
"private",
"boolean",
"hasPrimaryKey",
"(",
"T",
"entity",
")",
"{",
"Object",
"pk",
"=",
"getPrimaryKey",
"(",
"entity",
")",
";",
"if",
"(",
"pk",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"if",
"(",
"pk",
"instanceof",
"Num... | Returns true if this entity's primary key is not null, and for numeric
fields, is non-zero. | [
"Returns",
"true",
"if",
"this",
"entity",
"s",
"primary",
"key",
"is",
"not",
"null",
"and",
"for",
"numeric",
"fields",
"is",
"non",
"-",
"zero",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java#L507-L517 |
159,186 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java | Mapping.update | public T update(T entity) throws RowNotFoundException, OptimisticLockException {
if (!hasPrimaryKey(entity)) {
throw new RuntimeException(String.format("Tried to update entity of type %s without a primary key", entity
.getClass().getSimpleName()));
}
UpdateCreat... | java | public T update(T entity) throws RowNotFoundException, OptimisticLockException {
if (!hasPrimaryKey(entity)) {
throw new RuntimeException(String.format("Tried to update entity of type %s without a primary key", entity
.getClass().getSimpleName()));
}
UpdateCreat... | [
"public",
"T",
"update",
"(",
"T",
"entity",
")",
"throws",
"RowNotFoundException",
",",
"OptimisticLockException",
"{",
"if",
"(",
"!",
"hasPrimaryKey",
"(",
"entity",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"String",
".",
"format",
"(",
"\"... | Updates value of entity in the table. | [
"Updates",
"value",
"of",
"entity",
"in",
"the",
"table",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java#L558-L622 |
159,187 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/AbstractSqlCreator.java | AbstractSqlCreator.setParameter | public AbstractSqlCreator setParameter(String name, Object value) {
ppsc.setParameter(name, value);
return this;
} | java | public AbstractSqlCreator setParameter(String name, Object value) {
ppsc.setParameter(name, value);
return this;
} | [
"public",
"AbstractSqlCreator",
"setParameter",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"ppsc",
".",
"setParameter",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets a parameter for the creator. | [
"Sets",
"a",
"parameter",
"for",
"the",
"creator",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/AbstractSqlCreator.java#L64-L67 |
159,188 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/InsertBuilder.java | InsertBuilder.set | public InsertBuilder set(String column, String value) {
columns.add(column);
values.add(value);
return this;
} | java | public InsertBuilder set(String column, String value) {
columns.add(column);
values.add(value);
return this;
} | [
"public",
"InsertBuilder",
"set",
"(",
"String",
"column",
",",
"String",
"value",
")",
"{",
"columns",
".",
"add",
"(",
"column",
")",
";",
"values",
".",
"add",
"(",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a column name, value pair into the SQL.
@param column
Name of the table column.
@param value
Value to substitute in. InsertBuilder does *no* interpretation
of this. If you want a string constant inserted, you must
provide the single quotes and escape the internal quotes. It
is more common to use a question mar... | [
"Inserts",
"a",
"column",
"name",
"value",
"pair",
"into",
"the",
"SQL",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/InsertBuilder.java#L44-L48 |
159,189 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/SelectBuilder.java | SelectBuilder.orderBy | public SelectBuilder orderBy(String name, boolean ascending) {
if (ascending) {
orderBys.add(name + " asc");
} else {
orderBys.add(name + " desc");
}
return this;
} | java | public SelectBuilder orderBy(String name, boolean ascending) {
if (ascending) {
orderBys.add(name + " asc");
} else {
orderBys.add(name + " desc");
}
return this;
} | [
"public",
"SelectBuilder",
"orderBy",
"(",
"String",
"name",
",",
"boolean",
"ascending",
")",
"{",
"if",
"(",
"ascending",
")",
"{",
"orderBys",
".",
"add",
"(",
"name",
"+",
"\" asc\"",
")",
";",
"}",
"else",
"{",
"orderBys",
".",
"add",
"(",
"name",... | Adds an ORDER BY item with a direction indicator.
@param name
Name of the column by which to sort.
@param ascending
If true, specifies the direction "asc", otherwise, specifies
the direction "desc". | [
"Adds",
"an",
"ORDER",
"BY",
"item",
"with",
"a",
"direction",
"indicator",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/SelectBuilder.java#L248-L255 |
159,190 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/StringListFlattener.java | StringListFlattener.split | public List<String> split(String s) {
List<String> result = new ArrayList<String>();
if (s == null) {
return result;
}
boolean seenEscape = false;
// Used to detect if the last char was a separator,
// in which case we append an empty string
boolea... | java | public List<String> split(String s) {
List<String> result = new ArrayList<String>();
if (s == null) {
return result;
}
boolean seenEscape = false;
// Used to detect if the last char was a separator,
// in which case we append an empty string
boolea... | [
"public",
"List",
"<",
"String",
">",
"split",
"(",
"String",
"s",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"result",
";",
"}",
... | Splits the given string. | [
"Splits",
"the",
"given",
"string",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/StringListFlattener.java#L35-L93 |
159,191 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/StringListFlattener.java | StringListFlattener.join | public String join(List<String> list) {
if (list == null) {
return null;
}
StringBuilder sb = new StringBuilder();
boolean first = true;
for (String s : list) {
if (s == null) {
if (convertEmptyToNull) {
s = "";
... | java | public String join(List<String> list) {
if (list == null) {
return null;
}
StringBuilder sb = new StringBuilder();
boolean first = true;
for (String s : list) {
if (s == null) {
if (convertEmptyToNull) {
s = "";
... | [
"public",
"String",
"join",
"(",
"List",
"<",
"String",
">",
"list",
")",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"first",
"=",
"true",
... | Joins the given list into a single string. | [
"Joins",
"the",
"given",
"list",
"into",
"a",
"single",
"string",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/StringListFlattener.java#L98-L131 |
159,192 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/AbstractSqlBuilder.java | AbstractSqlBuilder.appendList | protected void appendList(StringBuilder sql, List<?> list, String init, String sep) {
boolean first = true;
for (Object s : list) {
if (first) {
sql.append(init);
} else {
sql.append(sep);
}
sql.append(s);
firs... | java | protected void appendList(StringBuilder sql, List<?> list, String init, String sep) {
boolean first = true;
for (Object s : list) {
if (first) {
sql.append(init);
} else {
sql.append(sep);
}
sql.append(s);
firs... | [
"protected",
"void",
"appendList",
"(",
"StringBuilder",
"sql",
",",
"List",
"<",
"?",
">",
"list",
",",
"String",
"init",
",",
"String",
"sep",
")",
"{",
"boolean",
"first",
"=",
"true",
";",
"for",
"(",
"Object",
"s",
":",
"list",
")",
"{",
"if",
... | Constructs a list of items with given separators.
@param sql
StringBuilder to which the constructed string will be
appended.
@param list
List of objects (usually strings) to join.
@param init
String to be added to the start of the list, before any of the
items.
@param sep
Separator string to be added between items in ... | [
"Constructs",
"a",
"list",
"of",
"items",
"with",
"given",
"separators",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/AbstractSqlBuilder.java#L26-L39 |
159,193 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/EnumStringConverter.java | EnumStringConverter.create | public static <E extends Enum<E>> EnumStringConverter<E> create(Class<E> enumType) {
return new EnumStringConverter<E>(enumType);
} | java | public static <E extends Enum<E>> EnumStringConverter<E> create(Class<E> enumType) {
return new EnumStringConverter<E>(enumType);
} | [
"public",
"static",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
">",
"EnumStringConverter",
"<",
"E",
">",
"create",
"(",
"Class",
"<",
"E",
">",
"enumType",
")",
"{",
"return",
"new",
"EnumStringConverter",
"<",
"E",
">",
"(",
"enumType",
")",
";",
... | Factory method to create EnumStringConverter
@param <E>
enum type inferred from enumType parameter
@param enumType
particular enum class
@return instance of EnumConverter | [
"Factory",
"method",
"to",
"create",
"EnumStringConverter"
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/EnumStringConverter.java#L26-L28 |
159,194 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java | ReflectionUtils.getDeclaredFieldsInHierarchy | public static Field[] getDeclaredFieldsInHierarchy(Class<?> clazz) {
if (clazz.isPrimitive()) {
throw new IllegalArgumentException("Primitive types not supported.");
}
List<Field> result = new ArrayList<Field>();
while (true) {
if (clazz == Object.class) {
... | java | public static Field[] getDeclaredFieldsInHierarchy(Class<?> clazz) {
if (clazz.isPrimitive()) {
throw new IllegalArgumentException("Primitive types not supported.");
}
List<Field> result = new ArrayList<Field>();
while (true) {
if (clazz == Object.class) {
... | [
"public",
"static",
"Field",
"[",
"]",
"getDeclaredFieldsInHierarchy",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"clazz",
".",
"isPrimitive",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Primitive types not supported.\... | Returns an array of all declared fields in the given class and all
super-classes. | [
"Returns",
"an",
"array",
"of",
"all",
"declared",
"fields",
"in",
"the",
"given",
"class",
"and",
"all",
"super",
"-",
"classes",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java#L14-L33 |
159,195 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java | ReflectionUtils.getDeclaredFieldWithPath | public static Field getDeclaredFieldWithPath(Class<?> clazz, String path) {
int lastDot = path.lastIndexOf('.');
if (lastDot > -1) {
String parentPath = path.substring(0, lastDot);
String fieldName = path.substring(lastDot + 1);
Field parentField = getDeclaredFieldW... | java | public static Field getDeclaredFieldWithPath(Class<?> clazz, String path) {
int lastDot = path.lastIndexOf('.');
if (lastDot > -1) {
String parentPath = path.substring(0, lastDot);
String fieldName = path.substring(lastDot + 1);
Field parentField = getDeclaredFieldW... | [
"public",
"static",
"Field",
"getDeclaredFieldWithPath",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"path",
")",
"{",
"int",
"lastDot",
"=",
"path",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"lastDot",
">",
"-",
"1",
")",
"{",... | Returns the Field for a given parent class and a dot-separated path of
field names.
@param clazz
Parent class.
@param path
Path to the desired field. | [
"Returns",
"the",
"Field",
"for",
"a",
"given",
"parent",
"class",
"and",
"a",
"dot",
"-",
"separated",
"path",
"of",
"field",
"names",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java#L44-L56 |
159,196 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java | ReflectionUtils.getFieldValue | public static Object getFieldValue(Object object, String fieldName) {
try {
return getDeclaredFieldInHierarchy(object.getClass(), fieldName).get(object);
} catch (IllegalArgumentException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
... | java | public static Object getFieldValue(Object object, String fieldName) {
try {
return getDeclaredFieldInHierarchy(object.getClass(), fieldName).get(object);
} catch (IllegalArgumentException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
... | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"Object",
"object",
",",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"getDeclaredFieldInHierarchy",
"(",
"object",
".",
"getClass",
"(",
")",
",",
"fieldName",
")",
".",
"get",
"(",
"object",
")"... | Convenience method for getting the value of a private object field,
without the stress of checked exceptions in the reflection API.
@param object
Object containing the field.
@param fieldName
Name of the field whose value to return. | [
"Convenience",
"method",
"for",
"getting",
"the",
"value",
"of",
"a",
"private",
"object",
"field",
"without",
"the",
"stress",
"of",
"checked",
"exceptions",
"in",
"the",
"reflection",
"API",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java#L85-L93 |
159,197 | jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java | ReflectionUtils.setFieldValue | public static void setFieldValue(Object object, String fieldName, Object value) {
try {
getDeclaredFieldInHierarchy(object.getClass(), fieldName).set(object, value);
} catch (IllegalArgumentException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {... | java | public static void setFieldValue(Object object, String fieldName, Object value) {
try {
getDeclaredFieldInHierarchy(object.getClass(), fieldName).set(object, value);
} catch (IllegalArgumentException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {... | [
"public",
"static",
"void",
"setFieldValue",
"(",
"Object",
"object",
",",
"String",
"fieldName",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"getDeclaredFieldInHierarchy",
"(",
"object",
".",
"getClass",
"(",
")",
",",
"fieldName",
")",
".",
"set",
"(",
... | Convenience method for setting the value of a private object field,
without the stress of checked exceptions in the reflection API.
@param object
Object containing the field.
@param fieldName
Name of the field to set.
@param value
Value to which to set the field. | [
"Convenience",
"method",
"for",
"setting",
"the",
"value",
"of",
"a",
"private",
"object",
"field",
"without",
"the",
"stress",
"of",
"checked",
"exceptions",
"in",
"the",
"reflection",
"API",
"."
] | 8e6acedc51cfad0527263376af51e1ef052f7147 | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java#L139-L147 |
159,198 | super-csv/super-csv | super-csv/src/main/java/org/supercsv/cellprocessor/constraint/LMinMax.java | LMinMax.checkPreconditions | private static void checkPreconditions(final long min, final long max) {
if( max < min ) {
throw new IllegalArgumentException(String.format("max (%d) should not be < min (%d)", max, min));
}
} | java | private static void checkPreconditions(final long min, final long max) {
if( max < min ) {
throw new IllegalArgumentException(String.format("max (%d) should not be < min (%d)", max, min));
}
} | [
"private",
"static",
"void",
"checkPreconditions",
"(",
"final",
"long",
"min",
",",
"final",
"long",
"max",
")",
"{",
"if",
"(",
"max",
"<",
"min",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"max (%d) should n... | Checks the preconditions for creating a new LMinMax processor.
@param min
the minimum value (inclusive)
@param max
the maximum value (inclusive)
@throws IllegalArgumentException
if {@code max < min} | [
"Checks",
"the",
"preconditions",
"for",
"creating",
"a",
"new",
"LMinMax",
"processor",
"."
] | f18db724674dc1c4116e25142c1b5403ebf43e96 | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/constraint/LMinMax.java#L125-L129 |
159,199 | super-csv/super-csv | super-csv/src/main/java/org/supercsv/util/ReflectionUtils.java | ReflectionUtils.findGetter | public static Method findGetter(final Object object, final String fieldName) {
if( object == null ) {
throw new NullPointerException("object should not be null");
} else if( fieldName == null ) {
throw new NullPointerException("fieldName should not be null");
}
final Class<?> clazz = object.getClass();... | java | public static Method findGetter(final Object object, final String fieldName) {
if( object == null ) {
throw new NullPointerException("object should not be null");
} else if( fieldName == null ) {
throw new NullPointerException("fieldName should not be null");
}
final Class<?> clazz = object.getClass();... | [
"public",
"static",
"Method",
"findGetter",
"(",
"final",
"Object",
"object",
",",
"final",
"String",
"fieldName",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"object should not be null\"",
")",
";",
"}... | Returns the getter method associated with the object's field.
@param object
the object
@param fieldName
the name of the field
@return the getter method
@throws NullPointerException
if object or fieldName is null
@throws SuperCsvReflectionException
if the getter doesn't exist or is not visible | [
"Returns",
"the",
"getter",
"method",
"associated",
"with",
"the",
"object",
"s",
"field",
"."
] | f18db724674dc1c4116e25142c1b5403ebf43e96 | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/util/ReflectionUtils.java#L77-L105 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.