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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
64,900 | thorntail/thorntail | plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java | GradleDependencyResolutionHelper.determinePluginVersion | public static String determinePluginVersion() {
if (pluginVersion == null) {
final String fileName = "META-INF/gradle-plugins/thorntail.properties";
ClassLoader loader = Thread.currentThread().getContextClassLoader();
String version;
try (InputStream stream = load... | java | public static String determinePluginVersion() {
if (pluginVersion == null) {
final String fileName = "META-INF/gradle-plugins/thorntail.properties";
ClassLoader loader = Thread.currentThread().getContextClassLoader();
String version;
try (InputStream stream = load... | [
"public",
"static",
"String",
"determinePluginVersion",
"(",
")",
"{",
"if",
"(",
"pluginVersion",
"==",
"null",
")",
"{",
"final",
"String",
"fileName",
"=",
"\"META-INF/gradle-plugins/thorntail.properties\"",
";",
"ClassLoader",
"loader",
"=",
"Thread",
".",
"curr... | Parse the plugin definition file and extract the version details from it. | [
"Parse",
"the",
"plugin",
"definition",
"file",
"and",
"extract",
"the",
"version",
"details",
"from",
"it",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java#L67-L82 |
64,901 | thorntail/thorntail | plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java | GradleDependencyResolutionHelper.isProject | public static boolean isProject(Project project, DependencyDescriptor descriptor) {
final String specGAV = String.format("%s:%s:%s", descriptor.getGroup(), descriptor.getName(), descriptor.getVersion());
return getAllProjects(project).containsKey(specGAV) || getIncludedProjectIdentifiers(project).contai... | java | public static boolean isProject(Project project, DependencyDescriptor descriptor) {
final String specGAV = String.format("%s:%s:%s", descriptor.getGroup(), descriptor.getName(), descriptor.getVersion());
return getAllProjects(project).containsKey(specGAV) || getIncludedProjectIdentifiers(project).contai... | [
"public",
"static",
"boolean",
"isProject",
"(",
"Project",
"project",
",",
"DependencyDescriptor",
"descriptor",
")",
"{",
"final",
"String",
"specGAV",
"=",
"String",
".",
"format",
"(",
"\"%s:%s:%s\"",
",",
"descriptor",
".",
"getGroup",
"(",
")",
",",
"des... | Convenience method to determine if the given dependency descriptor represents an internal Gradle project or not.
@param project the Gradle project reference.
@param descriptor the dependency descriptor.
@return true if the descriptor represents a Gradle project, false otherwise. | [
"Convenience",
"method",
"to",
"determine",
"if",
"the",
"given",
"dependency",
"descriptor",
"represents",
"an",
"internal",
"Gradle",
"project",
"or",
"not",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java#L92-L95 |
64,902 | thorntail/thorntail | plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java | GradleDependencyResolutionHelper.resolveArtifacts | public static Set<ArtifactSpec> resolveArtifacts(Project project, Collection<ArtifactSpec> specs, boolean transitive,
boolean excludeDefaults) {
if (project == null) {
throw new IllegalArgumentException("Gradle project reference cannot be null.");... | java | public static Set<ArtifactSpec> resolveArtifacts(Project project, Collection<ArtifactSpec> specs, boolean transitive,
boolean excludeDefaults) {
if (project == null) {
throw new IllegalArgumentException("Gradle project reference cannot be null.");... | [
"public",
"static",
"Set",
"<",
"ArtifactSpec",
">",
"resolveArtifacts",
"(",
"Project",
"project",
",",
"Collection",
"<",
"ArtifactSpec",
">",
"specs",
",",
"boolean",
"transitive",
",",
"boolean",
"excludeDefaults",
")",
"{",
"if",
"(",
"project",
"==",
"nu... | Resolve the given artifact specifications.
@param project the Gradle project reference.
@param specs the specifications that need to be resolved.
@param transitive should the artifacts be resolved transitively?
@param excludeDefaults should we skip resolving artifacts that belong to the Thorntai... | [
"Resolve",
"the",
"given",
"artifact",
"specifications",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java#L106-L157 |
64,903 | thorntail/thorntail | plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java | GradleDependencyResolutionHelper.determineProjectDependencies | public static Map<DependencyDescriptor, Set<DependencyDescriptor>>
determineProjectDependencies(Project project, String configuration, boolean resolveChildrenTransitively) {
if (project == null) {
throw new IllegalArgumentException("Gradle project reference cannot be null.");
}
p... | java | public static Map<DependencyDescriptor, Set<DependencyDescriptor>>
determineProjectDependencies(Project project, String configuration, boolean resolveChildrenTransitively) {
if (project == null) {
throw new IllegalArgumentException("Gradle project reference cannot be null.");
}
p... | [
"public",
"static",
"Map",
"<",
"DependencyDescriptor",
",",
"Set",
"<",
"DependencyDescriptor",
">",
">",
"determineProjectDependencies",
"(",
"Project",
"project",
",",
"String",
"configuration",
",",
"boolean",
"resolveChildrenTransitively",
")",
"{",
"if",
"(",
... | Determine the dependencies associated with a Gradle project. This method returns a Map whose key represents a top level
dependency associated with this project and the value represents a collection of dependencies that the "key" requires.
@param project the Gradle project reference.
@param configur... | [
"Determine",
"the",
"dependencies",
"associated",
"with",
"a",
"Gradle",
"project",
".",
"This",
"method",
"returns",
"a",
"Map",
"whose",
"key",
"represents",
"a",
"top",
"level",
"dependency",
"associated",
"with",
"this",
"project",
"and",
"the",
"value",
"... | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java#L168-L229 |
64,904 | thorntail/thorntail | plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java | GradleDependencyResolutionHelper.printDependencyMap | private static void printDependencyMap(Map<DependencyDescriptor, Set<DependencyDescriptor>> map, Project project) {
final String NEW_LINE = "\n";
if (project.getLogger().isEnabled(LogLevel.INFO)) {
StringBuilder builder = new StringBuilder(100);
builder.append("Resolved dependenc... | java | private static void printDependencyMap(Map<DependencyDescriptor, Set<DependencyDescriptor>> map, Project project) {
final String NEW_LINE = "\n";
if (project.getLogger().isEnabled(LogLevel.INFO)) {
StringBuilder builder = new StringBuilder(100);
builder.append("Resolved dependenc... | [
"private",
"static",
"void",
"printDependencyMap",
"(",
"Map",
"<",
"DependencyDescriptor",
",",
"Set",
"<",
"DependencyDescriptor",
">",
">",
"map",
",",
"Project",
"project",
")",
"{",
"final",
"String",
"NEW_LINE",
"=",
"\"\\n\"",
";",
"if",
"(",
"project",... | Temp method for printing out the dependency map. | [
"Temp",
"method",
"for",
"printing",
"out",
"the",
"dependency",
"map",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java#L300-L312 |
64,905 | thorntail/thorntail | plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java | GradleDependencyResolutionHelper.getAllProjects | private static Map<String, Project> getAllProjects(final Project project) {
return getCachedReference(project, "thorntail_project_gav_collection", () -> {
Map<String, Project> gavMap = new HashMap<>();
project.getRootProject().getAllprojects().forEach(p -> {
gavMap.put(p.... | java | private static Map<String, Project> getAllProjects(final Project project) {
return getCachedReference(project, "thorntail_project_gav_collection", () -> {
Map<String, Project> gavMap = new HashMap<>();
project.getRootProject().getAllprojects().forEach(p -> {
gavMap.put(p.... | [
"private",
"static",
"Map",
"<",
"String",
",",
"Project",
">",
"getAllProjects",
"(",
"final",
"Project",
"project",
")",
"{",
"return",
"getCachedReference",
"(",
"project",
",",
"\"thorntail_project_gav_collection\"",
",",
"(",
")",
"->",
"{",
"Map",
"<",
"... | Get the collection of Gradle projects along with their GAV definitions. This collection is used for determining if an
artifact specification represents a Gradle project or not.
@param project the Gradle project that is being analyzed.
@return a map of GAV coordinates for each of the available projects (returned as key... | [
"Get",
"the",
"collection",
"of",
"Gradle",
"projects",
"along",
"with",
"their",
"GAV",
"definitions",
".",
"This",
"collection",
"is",
"used",
"for",
"determining",
"if",
"an",
"artifact",
"specification",
"represents",
"a",
"Gradle",
"project",
"or",
"not",
... | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/plugins/gradle/gradle-plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleDependencyResolutionHelper.java#L321-L329 |
64,906 | thorntail/thorntail | core/spi/src/main/java/org/wildfly/swarm/spi/api/Defaultable.java | Defaultable.ifPresent | public void ifPresent(Consumer<? super T> consumer) {
T value = get(false);
if (value != null) {
consumer.accept(value);
}
} | java | public void ifPresent(Consumer<? super T> consumer) {
T value = get(false);
if (value != null) {
consumer.accept(value);
}
} | [
"public",
"void",
"ifPresent",
"(",
"Consumer",
"<",
"?",
"super",
"T",
">",
"consumer",
")",
"{",
"T",
"value",
"=",
"get",
"(",
"false",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"consumer",
".",
"accept",
"(",
"value",
")",
";",
"}... | If a default or explicit value is present, invoke the supplied consumer with it.
@param consumer The consumer. | [
"If",
"a",
"default",
"or",
"explicit",
"value",
"is",
"present",
"invoke",
"the",
"supplied",
"consumer",
"with",
"it",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/spi/src/main/java/org/wildfly/swarm/spi/api/Defaultable.java#L195-L201 |
64,907 | thorntail/thorntail | core/container/src/main/java/org/wildfly/swarm/internal/FileSystemLayout.java | FileSystemLayout.create | public static FileSystemLayout create() {
String userDir = System.getProperty(USER_DIR);
if (null == userDir) {
throw SwarmMessages.MESSAGES.systemPropertyNotFound(USER_DIR);
}
return create(userDir);
} | java | public static FileSystemLayout create() {
String userDir = System.getProperty(USER_DIR);
if (null == userDir) {
throw SwarmMessages.MESSAGES.systemPropertyNotFound(USER_DIR);
}
return create(userDir);
} | [
"public",
"static",
"FileSystemLayout",
"create",
"(",
")",
"{",
"String",
"userDir",
"=",
"System",
".",
"getProperty",
"(",
"USER_DIR",
")",
";",
"if",
"(",
"null",
"==",
"userDir",
")",
"{",
"throw",
"SwarmMessages",
".",
"MESSAGES",
".",
"systemPropertyN... | Derived form 'user.dir'
@return a FileSystemLayout instance | [
"Derived",
"form",
"user",
".",
"dir"
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/container/src/main/java/org/wildfly/swarm/internal/FileSystemLayout.java#L69-L77 |
64,908 | thorntail/thorntail | core/container/src/main/java/org/wildfly/swarm/internal/FileSystemLayout.java | FileSystemLayout.create | public static FileSystemLayout create(String root) {
// THORN-2178: Check if a System property has been set to a specific implementation class.
String implClassName = System.getProperty(CUSTOM_LAYOUT_CLASS);
if (implClassName != null) {
implClassName = implClassName.trim();
... | java | public static FileSystemLayout create(String root) {
// THORN-2178: Check if a System property has been set to a specific implementation class.
String implClassName = System.getProperty(CUSTOM_LAYOUT_CLASS);
if (implClassName != null) {
implClassName = implClassName.trim();
... | [
"public",
"static",
"FileSystemLayout",
"create",
"(",
"String",
"root",
")",
"{",
"// THORN-2178: Check if a System property has been set to a specific implementation class.",
"String",
"implClassName",
"=",
"System",
".",
"getProperty",
"(",
"CUSTOM_LAYOUT_CLASS",
")",
";",
... | Derived from explicit path
@param root the fs entry point
@return a FileSystemLayout instance | [
"Derived",
"from",
"explicit",
"path"
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/container/src/main/java/org/wildfly/swarm/internal/FileSystemLayout.java#L85-L133 |
64,909 | thorntail/thorntail | fractions/microprofile/microprofile-openapi/src/main/java/org/wildfly/swarm/microprofile/openapi/runtime/OpenApiDeploymentProcessor.java | OpenApiDeploymentProcessor.process | @Override
public void process() throws Exception {
// if the deployment is Implicit, we don't want to process it
if (deploymentContext != null && deploymentContext.isImplicit()) {
return;
}
try {
// First register OpenApiServletContextListener which triggers t... | java | @Override
public void process() throws Exception {
// if the deployment is Implicit, we don't want to process it
if (deploymentContext != null && deploymentContext.isImplicit()) {
return;
}
try {
// First register OpenApiServletContextListener which triggers t... | [
"@",
"Override",
"public",
"void",
"process",
"(",
")",
"throws",
"Exception",
"{",
"// if the deployment is Implicit, we don't want to process it",
"if",
"(",
"deploymentContext",
"!=",
"null",
"&&",
"deploymentContext",
".",
"isImplicit",
"(",
")",
")",
"{",
"return... | Process the deployment in order to produce an OpenAPI document.
@see org.wildfly.swarm.spi.api.DeploymentProcessor#process() | [
"Process",
"the",
"deployment",
"in",
"order",
"to",
"produce",
"an",
"OpenAPI",
"document",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/microprofile/microprofile-openapi/src/main/java/org/wildfly/swarm/microprofile/openapi/runtime/OpenApiDeploymentProcessor.java#L81-L102 |
64,910 | thorntail/thorntail | core/container/src/main/java/org/wildfly/swarm/cli/Option.java | Option.toURL | public static URL toURL(String value) throws MalformedURLException {
try {
URL url = new URL(value);
return url;
} catch (MalformedURLException e) {
try {
return new File(value).toURI().toURL();
} catch (MalformedURLException e2) {
... | java | public static URL toURL(String value) throws MalformedURLException {
try {
URL url = new URL(value);
return url;
} catch (MalformedURLException e) {
try {
return new File(value).toURI().toURL();
} catch (MalformedURLException e2) {
... | [
"public",
"static",
"URL",
"toURL",
"(",
"String",
"value",
")",
"throws",
"MalformedURLException",
"{",
"try",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"value",
")",
";",
"return",
"url",
";",
"}",
"catch",
"(",
"MalformedURLException",
"e",
")",
"{",... | Helper to attempt forming a URL from a String in a sensible fashion.
@param value The input string.
@return The correct URL, if possible. | [
"Helper",
"to",
"attempt",
"forming",
"a",
"URL",
"from",
"a",
"String",
"in",
"a",
"sensible",
"fashion",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/container/src/main/java/org/wildfly/swarm/cli/Option.java#L342-L354 |
64,911 | thorntail/thorntail | core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/util/BootstrapUtil.java | BootstrapUtil.explodeJar | public static void explodeJar(JarFile jarFile, String destDir) throws IOException {
Enumeration<java.util.jar.JarEntry> enu = jarFile.entries();
while (enu.hasMoreElements()) {
JarEntry je = enu.nextElement();
File fl = new File(destDir, je.getName());
if (!fl.exists... | java | public static void explodeJar(JarFile jarFile, String destDir) throws IOException {
Enumeration<java.util.jar.JarEntry> enu = jarFile.entries();
while (enu.hasMoreElements()) {
JarEntry je = enu.nextElement();
File fl = new File(destDir, je.getName());
if (!fl.exists... | [
"public",
"static",
"void",
"explodeJar",
"(",
"JarFile",
"jarFile",
",",
"String",
"destDir",
")",
"throws",
"IOException",
"{",
"Enumeration",
"<",
"java",
".",
"util",
".",
"jar",
".",
"JarEntry",
">",
"enu",
"=",
"jarFile",
".",
"entries",
"(",
")",
... | Extracts a jar file into a target destination directory
@param jarFile
@param destDir
@throws IOException | [
"Extracts",
"a",
"jar",
"file",
"into",
"a",
"target",
"destination",
"directory"
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/util/BootstrapUtil.java#L43-L66 |
64,912 | thorntail/thorntail | meta/fraction-metadata/src/main/java/org/wildfly/swarm/fractions/scanner/FilePresenceScanner.java | FilePresenceScanner.scan | public void scan(PathSource fileSource, Collection<FractionDetector<PathSource>> detectors, Consumer<File> handleFileAsZip) throws IOException {
detectors.stream()
.filter(d -> FileDetector.class.isAssignableFrom(d.getClass()))
.forEach(d -> d.detect(fileSource));
} | java | public void scan(PathSource fileSource, Collection<FractionDetector<PathSource>> detectors, Consumer<File> handleFileAsZip) throws IOException {
detectors.stream()
.filter(d -> FileDetector.class.isAssignableFrom(d.getClass()))
.forEach(d -> d.detect(fileSource));
} | [
"public",
"void",
"scan",
"(",
"PathSource",
"fileSource",
",",
"Collection",
"<",
"FractionDetector",
"<",
"PathSource",
">",
">",
"detectors",
",",
"Consumer",
"<",
"File",
">",
"handleFileAsZip",
")",
"throws",
"IOException",
"{",
"detectors",
".",
"stream",
... | scans all xml files | [
"scans",
"all",
"xml",
"files"
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/meta/fraction-metadata/src/main/java/org/wildfly/swarm/fractions/scanner/FilePresenceScanner.java#L39-L43 |
64,913 | thorntail/thorntail | fractions/microprofile/microprofile-jwt/src/main/java/org/wildfly/swarm/microprofile/jwtauth/deployment/auth/cdi/MPJWTExtension.java | MPJWTExtension.observesAfterBeanDiscovery | void observesAfterBeanDiscovery(@Observes final AfterBeanDiscovery event, final BeanManager beanManager) {
log.debugf("observesAfterBeanDiscovery, %s", claims);
installClaimValueProducerMethodsViaSyntheticBeans(event, beanManager);
} | java | void observesAfterBeanDiscovery(@Observes final AfterBeanDiscovery event, final BeanManager beanManager) {
log.debugf("observesAfterBeanDiscovery, %s", claims);
installClaimValueProducerMethodsViaSyntheticBeans(event, beanManager);
} | [
"void",
"observesAfterBeanDiscovery",
"(",
"@",
"Observes",
"final",
"AfterBeanDiscovery",
"event",
",",
"final",
"BeanManager",
"beanManager",
")",
"{",
"log",
".",
"debugf",
"(",
"\"observesAfterBeanDiscovery, %s\"",
",",
"claims",
")",
";",
"installClaimValueProducer... | Create producer methods for each ClaimValue injection site
@param event - AfterBeanDiscovery
@param beanManager - CDI bean manager | [
"Create",
"producer",
"methods",
"for",
"each",
"ClaimValue",
"injection",
"site"
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/microprofile/microprofile-jwt/src/main/java/org/wildfly/swarm/microprofile/jwtauth/deployment/auth/cdi/MPJWTExtension.java#L216-L219 |
64,914 | thorntail/thorntail | tools/src/main/java/org/wildfly/swarm/tools/DeclaredDependencies.java | DeclaredDependencies.getDirectDependencies | public Collection<ArtifactSpec> getDirectDependencies(boolean includeUnsolved, boolean includePresolved) {
Set<ArtifactSpec> deps = new LinkedHashSet<>();
if (includeUnsolved) {
deps.addAll(getDirectDeps());
}
if (includePresolved) {
deps.addAll(presolvedDependenc... | java | public Collection<ArtifactSpec> getDirectDependencies(boolean includeUnsolved, boolean includePresolved) {
Set<ArtifactSpec> deps = new LinkedHashSet<>();
if (includeUnsolved) {
deps.addAll(getDirectDeps());
}
if (includePresolved) {
deps.addAll(presolvedDependenc... | [
"public",
"Collection",
"<",
"ArtifactSpec",
">",
"getDirectDependencies",
"(",
"boolean",
"includeUnsolved",
",",
"boolean",
"includePresolved",
")",
"{",
"Set",
"<",
"ArtifactSpec",
">",
"deps",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"if",
"(",
"i... | Get the collection of direct dependencies included in this instance.
@param includeUnsolved include dependencies that may need further
@param includePresolved include the dependencies that do not need further resolution.
@return the collection of direct dependencies included in this instance. | [
"Get",
"the",
"collection",
"of",
"direct",
"dependencies",
"included",
"in",
"this",
"instance",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/tools/src/main/java/org/wildfly/swarm/tools/DeclaredDependencies.java#L81-L90 |
64,915 | thorntail/thorntail | tools/src/main/java/org/wildfly/swarm/tools/DeclaredDependencies.java | DeclaredDependencies.getTransientDependencies | public Set<ArtifactSpec> getTransientDependencies() {
if (null == allTransient) {
allTransient = getTransientDependencies(true, true);
}
return allTransient;
} | java | public Set<ArtifactSpec> getTransientDependencies() {
if (null == allTransient) {
allTransient = getTransientDependencies(true, true);
}
return allTransient;
} | [
"public",
"Set",
"<",
"ArtifactSpec",
">",
"getTransientDependencies",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"allTransient",
")",
"{",
"allTransient",
"=",
"getTransientDependencies",
"(",
"true",
",",
"true",
")",
";",
"}",
"return",
"allTransient",
";",
... | Get the collection of all transient dependencies defined in this instance.
@return the collection of all transient dependencies defined in this instance. | [
"Get",
"the",
"collection",
"of",
"all",
"transient",
"dependencies",
"defined",
"in",
"this",
"instance",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/tools/src/main/java/org/wildfly/swarm/tools/DeclaredDependencies.java#L97-L102 |
64,916 | thorntail/thorntail | tools/src/main/java/org/wildfly/swarm/tools/DeclaredDependencies.java | DeclaredDependencies.getTransientDependencies | public Set<ArtifactSpec> getTransientDependencies(boolean includeUnsolved, boolean includePresolved) {
Set<ArtifactSpec> deps = new HashSet<>();
List<DependencyTree<ArtifactSpec>> sources = new ArrayList<>();
if (includeUnsolved) {
sources.add(this);
}
if (includePres... | java | public Set<ArtifactSpec> getTransientDependencies(boolean includeUnsolved, boolean includePresolved) {
Set<ArtifactSpec> deps = new HashSet<>();
List<DependencyTree<ArtifactSpec>> sources = new ArrayList<>();
if (includeUnsolved) {
sources.add(this);
}
if (includePres... | [
"public",
"Set",
"<",
"ArtifactSpec",
">",
"getTransientDependencies",
"(",
"boolean",
"includeUnsolved",
",",
"boolean",
"includePresolved",
")",
"{",
"Set",
"<",
"ArtifactSpec",
">",
"deps",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"List",
"<",
"Dependenc... | Get the collection of transient dependencies defined in this instance.
@param includeUnsolved include dependencies that may need further
@param includePresolved include the dependencies that do not need further resolution.
@return the collection of transient dependencies defined in this instance. | [
"Get",
"the",
"collection",
"of",
"transient",
"dependencies",
"defined",
"in",
"this",
"instance",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/tools/src/main/java/org/wildfly/swarm/tools/DeclaredDependencies.java#L111-L124 |
64,917 | thorntail/thorntail | tools/src/main/java/org/wildfly/swarm/tools/DeclaredDependencies.java | DeclaredDependencies.getTransientDependencies | public Collection<ArtifactSpec> getTransientDependencies(ArtifactSpec artifact) {
Set<ArtifactSpec> deps = new HashSet<>();
if (this.isDirectDep(artifact)) {
deps.addAll(getTransientDeps(artifact));
}
if (presolvedDependencies.isDirectDep(artifact)) {
deps.addAll(... | java | public Collection<ArtifactSpec> getTransientDependencies(ArtifactSpec artifact) {
Set<ArtifactSpec> deps = new HashSet<>();
if (this.isDirectDep(artifact)) {
deps.addAll(getTransientDeps(artifact));
}
if (presolvedDependencies.isDirectDep(artifact)) {
deps.addAll(... | [
"public",
"Collection",
"<",
"ArtifactSpec",
">",
"getTransientDependencies",
"(",
"ArtifactSpec",
"artifact",
")",
"{",
"Set",
"<",
"ArtifactSpec",
">",
"deps",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"if",
"(",
"this",
".",
"isDirectDep",
"(",
"artifac... | Get the transient dependencies defined for the given artifact specification.
@param artifact the artifact specification.
@return the transient dependencies defined for the given artifact specification. | [
"Get",
"the",
"transient",
"dependencies",
"defined",
"for",
"the",
"given",
"artifact",
"specification",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/tools/src/main/java/org/wildfly/swarm/tools/DeclaredDependencies.java#L152-L161 |
64,918 | thorntail/thorntail | fractions/javaee/messaging/src/main/java/org/wildfly/swarm/messaging/EnhancedServer.java | EnhancedServer.remoteConnection | public EnhancedServer remoteConnection(String name) {
return remoteConnection(name, (config) -> {
});
}
/**
* Setup a named remote connection to a remote message broker.
*
* @param name The name of the connection.
* @param config The configuration.
* @return This serv... | java | public EnhancedServer remoteConnection(String name) {
return remoteConnection(name, (config) -> {
});
}
/**
* Setup a named remote connection to a remote message broker.
*
* @param name The name of the connection.
* @param config The configuration.
* @return This serv... | [
"public",
"EnhancedServer",
"remoteConnection",
"(",
"String",
"name",
")",
"{",
"return",
"remoteConnection",
"(",
"name",
",",
"(",
"config",
")",
"-",
">",
"{",
"}",
")",
";",
"}",
"/**\n * Setup a named remote connection to a remote message broker.\n *\n ... | Setup a default named remote connection to a remote message broker.
<p>By default, it sets up a connection
connecting to <code>localhost</code> at port <code>61616</code>.
The connection factory is named <code>java:/jms/<b>name</b></code>.</p>
@return This server. | [
"Setup",
"a",
"default",
"named",
"remote",
"connection",
"to",
"a",
"remote",
"message",
"broker",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/javaee/messaging/src/main/java/org/wildfly/swarm/messaging/EnhancedServer.java#L142-L219 |
64,919 | thorntail/thorntail | fractions/microprofile/microprofile-jwt/src/main/java/org/wildfly/swarm/microprofile/jwtauth/deployment/auth/cdi/CommonJwtProducer.java | CommonJwtProducer.generalJsonValueProducer | public JsonValue generalJsonValueProducer(InjectionPoint ip) {
String name = getName(ip);
Object value = getValue(name, false);
JsonValue jsonValue = wrapValue(value);
return jsonValue;
} | java | public JsonValue generalJsonValueProducer(InjectionPoint ip) {
String name = getName(ip);
Object value = getValue(name, false);
JsonValue jsonValue = wrapValue(value);
return jsonValue;
} | [
"public",
"JsonValue",
"generalJsonValueProducer",
"(",
"InjectionPoint",
"ip",
")",
"{",
"String",
"name",
"=",
"getName",
"(",
"ip",
")",
";",
"Object",
"value",
"=",
"getValue",
"(",
"name",
",",
"false",
")",
";",
"JsonValue",
"jsonValue",
"=",
"wrapValu... | Return the indicated claim value as a JsonValue
@param ip - injection point of the claim
@return a JsonValue wrapper | [
"Return",
"the",
"indicated",
"claim",
"value",
"as",
"a",
"JsonValue"
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/microprofile/microprofile-jwt/src/main/java/org/wildfly/swarm/microprofile/jwtauth/deployment/auth/cdi/CommonJwtProducer.java#L78-L83 |
64,920 | thorntail/thorntail | core/container/src/main/java/org/wildfly/swarm/container/runtime/RuntimeServer.java | RuntimeServer.cleanup | private void cleanup() throws IOException {
JarFileManager.INSTANCE.close();
TempFileManager.INSTANCE.close();
MavenResolvers.close();
} | java | private void cleanup() throws IOException {
JarFileManager.INSTANCE.close();
TempFileManager.INSTANCE.close();
MavenResolvers.close();
} | [
"private",
"void",
"cleanup",
"(",
")",
"throws",
"IOException",
"{",
"JarFileManager",
".",
"INSTANCE",
".",
"close",
"(",
")",
";",
"TempFileManager",
".",
"INSTANCE",
".",
"close",
"(",
")",
";",
"MavenResolvers",
".",
"close",
"(",
")",
";",
"}"
] | Clean up all open resources.
@throws IOException if the close operation fails. | [
"Clean",
"up",
"all",
"open",
"resources",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/container/src/main/java/org/wildfly/swarm/container/runtime/RuntimeServer.java#L321-L325 |
64,921 | thorntail/thorntail | arquillian/daemon/src/main/java/org/wildfly/swarm/arquillian/daemon/container/DaemonDeployableContainerBase.java | DaemonDeployableContainerBase.closeRemoteResources | private void closeRemoteResources() {
if (reader != null) {
try {
reader.close();
} catch (final IOException ignore) {
}
reader = null;
}
if (writer != null) {
writer.close();
writer = null;
}
... | java | private void closeRemoteResources() {
if (reader != null) {
try {
reader.close();
} catch (final IOException ignore) {
}
reader = null;
}
if (writer != null) {
writer.close();
writer = null;
}
... | [
"private",
"void",
"closeRemoteResources",
"(",
")",
"{",
"if",
"(",
"reader",
"!=",
"null",
")",
"{",
"try",
"{",
"reader",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"IOException",
"ignore",
")",
"{",
"}",
"reader",
"=",
"null",
";",
... | Safely close remote resources | [
"Safely",
"close",
"remote",
"resources"
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/arquillian/daemon/src/main/java/org/wildfly/swarm/arquillian/daemon/container/DaemonDeployableContainerBase.java#L205-L238 |
64,922 | thorntail/thorntail | core/bootstrap/src/main/java/org/jboss/modules/maven/ArtifactCoordinates.java | ArtifactCoordinates.fromString | public static ArtifactCoordinates fromString(String string) {
final Matcher matcher = VALID_PATTERN.matcher(string);
if (matcher.matches()) {
if (matcher.group(4) != null) {
return new ArtifactCoordinates(matcher.group(1), matcher.group(2), matcher.group(3), matcher.group(4))... | java | public static ArtifactCoordinates fromString(String string) {
final Matcher matcher = VALID_PATTERN.matcher(string);
if (matcher.matches()) {
if (matcher.group(4) != null) {
return new ArtifactCoordinates(matcher.group(1), matcher.group(2), matcher.group(3), matcher.group(4))... | [
"public",
"static",
"ArtifactCoordinates",
"fromString",
"(",
"String",
"string",
")",
"{",
"final",
"Matcher",
"matcher",
"=",
"VALID_PATTERN",
".",
"matcher",
"(",
"string",
")",
";",
"if",
"(",
"matcher",
".",
"matches",
"(",
")",
")",
"{",
"if",
"(",
... | Parse a string and produce artifact coordinates from it.
@param string the string to parse (must not be {@code null})
@return the artifact coordinates object (not {@code null}) | [
"Parse",
"a",
"string",
"and",
"produce",
"artifact",
"coordinates",
"from",
"it",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/bootstrap/src/main/java/org/jboss/modules/maven/ArtifactCoordinates.java#L72-L83 |
64,923 | thorntail/thorntail | core/bootstrap/src/main/java/org/jboss/modules/maven/ArtifactCoordinates.java | ArtifactCoordinates.relativeArtifactPath | public String relativeArtifactPath(char separator) {
String artifactId1 = getArtifactId();
String version1 = getVersion();
StringBuilder builder = new StringBuilder(getGroupId().replace('.', separator));
builder.append(separator).append(artifactId1).append(separator);
String path... | java | public String relativeArtifactPath(char separator) {
String artifactId1 = getArtifactId();
String version1 = getVersion();
StringBuilder builder = new StringBuilder(getGroupId().replace('.', separator));
builder.append(separator).append(artifactId1).append(separator);
String path... | [
"public",
"String",
"relativeArtifactPath",
"(",
"char",
"separator",
")",
"{",
"String",
"artifactId1",
"=",
"getArtifactId",
"(",
")",
";",
"String",
"version1",
"=",
"getVersion",
"(",
")",
";",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
... | Create a relative repository path for the given artifact coordinates.
@param separator the separator character to use (typically {@code '/'} or {@link File#separatorChar})
@return the path string | [
"Create",
"a",
"relative",
"repository",
"path",
"for",
"the",
"given",
"artifact",
"coordinates",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/bootstrap/src/main/java/org/jboss/modules/maven/ArtifactCoordinates.java#L140-L155 |
64,924 | thorntail/thorntail | core/spi/src/main/java/org/wildfly/swarm/spi/api/Module.java | Module.withImportIncludePath | public Module withImportIncludePath(String path) {
checkList(this.imports, INCLUDE);
this.imports.get(INCLUDE).add(path);
return this;
} | java | public Module withImportIncludePath(String path) {
checkList(this.imports, INCLUDE);
this.imports.get(INCLUDE).add(path);
return this;
} | [
"public",
"Module",
"withImportIncludePath",
"(",
"String",
"path",
")",
"{",
"checkList",
"(",
"this",
".",
"imports",
",",
"INCLUDE",
")",
";",
"this",
".",
"imports",
".",
"get",
"(",
"INCLUDE",
")",
".",
"add",
"(",
"path",
")",
";",
"return",
"thi... | Add a path to import from this module.
@param path The path to add.
@return this module descriptor. | [
"Add",
"a",
"path",
"to",
"import",
"from",
"this",
"module",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/spi/src/main/java/org/wildfly/swarm/spi/api/Module.java#L179-L183 |
64,925 | thorntail/thorntail | core/spi/src/main/java/org/wildfly/swarm/spi/api/Module.java | Module.withImportExcludePath | public Module withImportExcludePath(String path) {
checkList(this.imports, EXCLUDE);
this.imports.get(EXCLUDE).add(path);
return this;
} | java | public Module withImportExcludePath(String path) {
checkList(this.imports, EXCLUDE);
this.imports.get(EXCLUDE).add(path);
return this;
} | [
"public",
"Module",
"withImportExcludePath",
"(",
"String",
"path",
")",
"{",
"checkList",
"(",
"this",
".",
"imports",
",",
"EXCLUDE",
")",
";",
"this",
".",
"imports",
".",
"get",
"(",
"EXCLUDE",
")",
".",
"add",
"(",
"path",
")",
";",
"return",
"thi... | Add a path to exclude from importing from this module.
@param path The excluded path to add.
@return this module descriptor. | [
"Add",
"a",
"path",
"to",
"exclude",
"from",
"importing",
"from",
"this",
"module",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/spi/src/main/java/org/wildfly/swarm/spi/api/Module.java#L191-L195 |
64,926 | thorntail/thorntail | core/spi/src/main/java/org/wildfly/swarm/spi/api/Module.java | Module.withExportIncludePath | public Module withExportIncludePath(String path) {
checkList(this.exports, INCLUDE);
this.exports.get(INCLUDE).add(path);
return this;
} | java | public Module withExportIncludePath(String path) {
checkList(this.exports, INCLUDE);
this.exports.get(INCLUDE).add(path);
return this;
} | [
"public",
"Module",
"withExportIncludePath",
"(",
"String",
"path",
")",
"{",
"checkList",
"(",
"this",
".",
"exports",
",",
"INCLUDE",
")",
";",
"this",
".",
"exports",
".",
"get",
"(",
"INCLUDE",
")",
".",
"add",
"(",
"path",
")",
";",
"return",
"thi... | Add a path to export from this module.
@param path The path to add.
@return this module descriptor. | [
"Add",
"a",
"path",
"to",
"export",
"from",
"this",
"module",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/spi/src/main/java/org/wildfly/swarm/spi/api/Module.java#L221-L225 |
64,927 | thorntail/thorntail | core/spi/src/main/java/org/wildfly/swarm/spi/api/Module.java | Module.withExportExcludePath | public Module withExportExcludePath(String path) {
checkList(this.exports, EXCLUDE);
this.exports.get(EXCLUDE).add(path);
return this;
} | java | public Module withExportExcludePath(String path) {
checkList(this.exports, EXCLUDE);
this.exports.get(EXCLUDE).add(path);
return this;
} | [
"public",
"Module",
"withExportExcludePath",
"(",
"String",
"path",
")",
"{",
"checkList",
"(",
"this",
".",
"exports",
",",
"EXCLUDE",
")",
";",
"this",
".",
"exports",
".",
"get",
"(",
"EXCLUDE",
")",
".",
"add",
"(",
"path",
")",
";",
"return",
"thi... | Add a path to exclude from exporting from this module.
@param path The excluded path to add.
@return this module descriptor. | [
"Add",
"a",
"path",
"to",
"exclude",
"from",
"exporting",
"from",
"this",
"module",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/spi/src/main/java/org/wildfly/swarm/spi/api/Module.java#L233-L237 |
64,928 | thorntail/thorntail | meta/meta-spi/src/main/java/org/wildfly/swarm/spi/meta/PathSource.java | PathSource.getRelativePath | public String getRelativePath() {
if (basePath == null) {
return source.toString();
}
return basePath.relativize(source).toString();
} | java | public String getRelativePath() {
if (basePath == null) {
return source.toString();
}
return basePath.relativize(source).toString();
} | [
"public",
"String",
"getRelativePath",
"(",
")",
"{",
"if",
"(",
"basePath",
"==",
"null",
")",
"{",
"return",
"source",
".",
"toString",
"(",
")",
";",
"}",
"return",
"basePath",
".",
"relativize",
"(",
"source",
")",
".",
"toString",
"(",
")",
";",
... | Gets the relative file path, instead of the absolute.
@return Relative path from this file, if basePath was provided. | [
"Gets",
"the",
"relative",
"file",
"path",
"instead",
"of",
"the",
"absolute",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/meta/meta-spi/src/main/java/org/wildfly/swarm/spi/meta/PathSource.java#L58-L64 |
64,929 | thorntail/thorntail | fractions/jolokia/src/main/java/org/wildfly/swarm/jolokia/access/Section.java | Section.mbean | public Section mbean(String name, MBeanRule.Consumer config) {
MBeanRule rule = new MBeanRule(name);
config.accept(rule);
this.rules.add(rule);
return this;
} | java | public Section mbean(String name, MBeanRule.Consumer config) {
MBeanRule rule = new MBeanRule(name);
config.accept(rule);
this.rules.add(rule);
return this;
} | [
"public",
"Section",
"mbean",
"(",
"String",
"name",
",",
"MBeanRule",
".",
"Consumer",
"config",
")",
"{",
"MBeanRule",
"rule",
"=",
"new",
"MBeanRule",
"(",
"name",
")",
";",
"config",
".",
"accept",
"(",
"rule",
")",
";",
"this",
".",
"rules",
".",
... | Define a rule for a given MBean.
@param name The mbean name or pattern.
@param config Configuration.
@return This section. | [
"Define",
"a",
"rule",
"for",
"a",
"given",
"MBean",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/jolokia/src/main/java/org/wildfly/swarm/jolokia/access/Section.java#L41-L46 |
64,930 | thorntail/thorntail | core/bootstrap/src/main/java/org/jboss/modules/maven/MavenSettings.java | MavenSettings.openConnection | public URLConnection openConnection(URL url) throws IOException {
Proxy proxy = getProxyFor(url);
URLConnection conn = null;
if (proxy != null) {
conn = url.openConnection(proxy.getProxy());
proxy.authenticate(conn);
} else {
conn = url.openConnection... | java | public URLConnection openConnection(URL url) throws IOException {
Proxy proxy = getProxyFor(url);
URLConnection conn = null;
if (proxy != null) {
conn = url.openConnection(proxy.getProxy());
proxy.authenticate(conn);
} else {
conn = url.openConnection... | [
"public",
"URLConnection",
"openConnection",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"Proxy",
"proxy",
"=",
"getProxyFor",
"(",
"url",
")",
";",
"URLConnection",
"conn",
"=",
"null",
";",
"if",
"(",
"proxy",
"!=",
"null",
")",
"{",
"conn",
... | Opens a connection with appropriate proxy and credentials, if required.
@param url The URL to open.
@return The opened connection.
@throws IOException If an error occurs establishing the connection. | [
"Opens",
"a",
"connection",
"with",
"appropriate",
"proxy",
"and",
"credentials",
"if",
"required",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/bootstrap/src/main/java/org/jboss/modules/maven/MavenSettings.java#L413-L425 |
64,931 | thorntail/thorntail | fractions/jose/src/main/java/org/wildfly/swarm/jose/provider/JoseFactory.java | JoseFactory.instance | public static JoseFactory instance() {
if (instance == null) {
synchronized (JoseFactory.class) {
if (instance != null) {
return instance;
}
ClassLoader cl = AccessController.doPrivileged((PrivilegedAction<ClassLoader>) () -> Threa... | java | public static JoseFactory instance() {
if (instance == null) {
synchronized (JoseFactory.class) {
if (instance != null) {
return instance;
}
ClassLoader cl = AccessController.doPrivileged((PrivilegedAction<ClassLoader>) () -> Threa... | [
"public",
"static",
"JoseFactory",
"instance",
"(",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"synchronized",
"(",
"JoseFactory",
".",
"class",
")",
"{",
"if",
"(",
"instance",
"!=",
"null",
")",
"{",
"return",
"instance",
";",
"}",
"Cla... | Obtain the JoseFactory using the ServiceLoader pattern.
@return the factory instance | [
"Obtain",
"the",
"JoseFactory",
"using",
"the",
"ServiceLoader",
"pattern",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/jose/src/main/java/org/wildfly/swarm/jose/provider/JoseFactory.java#L37-L64 |
64,932 | thorntail/thorntail | fractions/jose/src/main/java/org/wildfly/swarm/jose/provider/JoseFactory.java | JoseFactory.loadSpi | private static JoseFactory loadSpi(ClassLoader cl) {
if (cl == null) {
return null;
}
// start from the root CL and go back down to the TCCL
JoseFactory instance = loadSpi(cl.getParent());
if (instance == null) {
ServiceLoader<JoseFactory> sl = ServiceLo... | java | private static JoseFactory loadSpi(ClassLoader cl) {
if (cl == null) {
return null;
}
// start from the root CL and go back down to the TCCL
JoseFactory instance = loadSpi(cl.getParent());
if (instance == null) {
ServiceLoader<JoseFactory> sl = ServiceLo... | [
"private",
"static",
"JoseFactory",
"loadSpi",
"(",
"ClassLoader",
"cl",
")",
"{",
"if",
"(",
"cl",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// start from the root CL and go back down to the TCCL",
"JoseFactory",
"instance",
"=",
"loadSpi",
"(",
"cl",
... | Look for a JoseFactory service implementation using the ServiceLoader.
@param cl - the ClassLoader to pass into the {@link ServiceLoader#load(Class, ClassLoader)} method.
@return the JoseFactory if found, null otherwise | [
"Look",
"for",
"a",
"JoseFactory",
"service",
"implementation",
"using",
"the",
"ServiceLoader",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/jose/src/main/java/org/wildfly/swarm/jose/provider/JoseFactory.java#L72-L102 |
64,933 | thorntail/thorntail | core/container/src/main/java/org/wildfly/swarm/container/runtime/wildfly/SwarmContentRepository.java | SwarmContentRepository.addService | public static void addService(ServiceTarget serviceTarget, SwarmContentRepository repository) {
serviceTarget.addService(SERVICE_NAME, repository)
.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
} | java | public static void addService(ServiceTarget serviceTarget, SwarmContentRepository repository) {
serviceTarget.addService(SERVICE_NAME, repository)
.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
} | [
"public",
"static",
"void",
"addService",
"(",
"ServiceTarget",
"serviceTarget",
",",
"SwarmContentRepository",
"repository",
")",
"{",
"serviceTarget",
".",
"addService",
"(",
"SERVICE_NAME",
",",
"repository",
")",
".",
"setInitialMode",
"(",
"ServiceController",
".... | Install the service. | [
"Install",
"the",
"service",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/container/src/main/java/org/wildfly/swarm/container/runtime/wildfly/SwarmContentRepository.java#L86-L90 |
64,934 | thorntail/thorntail | fractions/topology-webapp/src/main/java/org/wildfly/swarm/topology/webapp/TopologyWebAppFraction.java | TopologyWebAppFraction.proxyService | public void proxyService(String serviceName, String contextPath) {
if (proxiedServiceMappings().containsValue(contextPath)) {
throw new IllegalArgumentException("Cannot proxy multiple services under the same context path");
}
proxiedServiceMappings.put(serviceName, contextPath);
... | java | public void proxyService(String serviceName, String contextPath) {
if (proxiedServiceMappings().containsValue(contextPath)) {
throw new IllegalArgumentException("Cannot proxy multiple services under the same context path");
}
proxiedServiceMappings.put(serviceName, contextPath);
... | [
"public",
"void",
"proxyService",
"(",
"String",
"serviceName",
",",
"String",
"contextPath",
")",
"{",
"if",
"(",
"proxiedServiceMappings",
"(",
")",
".",
"containsValue",
"(",
"contextPath",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Ca... | Set up a load-balancing reverse proxy for the given service at the
given context path. Requests to this proxy will be load-balanced
among all instances of the service, as provided by our Topology.
@param serviceName the name of the service to proxy
@param contextPath the context path expose the proxy under | [
"Set",
"up",
"a",
"load",
"-",
"balancing",
"reverse",
"proxy",
"for",
"the",
"given",
"service",
"at",
"the",
"given",
"context",
"path",
".",
"Requests",
"to",
"this",
"proxy",
"will",
"be",
"load",
"-",
"balanced",
"among",
"all",
"instances",
"of",
"... | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/topology-webapp/src/main/java/org/wildfly/swarm/topology/webapp/TopologyWebAppFraction.java#L55-L60 |
64,935 | thorntail/thorntail | thorntail-runner/src/main/java/org/wildfly/swarm/runner/FatJarBuilder.java | FatJarBuilder.buildWar | private File buildWar(List<ArtifactOrFile> classPathEntries) {
try {
List<String> classesUrls = classPathEntries.stream()
.map(ArtifactOrFile::file)
.filter(this::isDirectory)
.filter(url -> url.contains("classes"))
.col... | java | private File buildWar(List<ArtifactOrFile> classPathEntries) {
try {
List<String> classesUrls = classPathEntries.stream()
.map(ArtifactOrFile::file)
.filter(this::isDirectory)
.filter(url -> url.contains("classes"))
.col... | [
"private",
"File",
"buildWar",
"(",
"List",
"<",
"ArtifactOrFile",
">",
"classPathEntries",
")",
"{",
"try",
"{",
"List",
"<",
"String",
">",
"classesUrls",
"=",
"classPathEntries",
".",
"stream",
"(",
")",
".",
"map",
"(",
"ArtifactOrFile",
"::",
"file",
... | builds war with classes inside
@param classPathEntries class path entries as ArtifactSpec or URLs
@return the war file | [
"builds",
"war",
"with",
"classes",
"inside"
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/thorntail-runner/src/main/java/org/wildfly/swarm/runner/FatJarBuilder.java#L151-L169 |
64,936 | thorntail/thorntail | arquillian/gradle-adapter/src/main/java/org/wildfly/swarm/arquillian/adapter/gradle/GradleDependencyDeclarationFactory.java | GradleDependencyDeclarationFactory.resolveDependencies | private static void resolveDependencies(Collection<ArtifactSpec> collection, ShrinkwrapArtifactResolvingHelper helper) {
// Identify the artifact specs that need resolution.
// Ideally, there should be none at this point.
collection.forEach(spec -> {
if (spec.file == null) {
... | java | private static void resolveDependencies(Collection<ArtifactSpec> collection, ShrinkwrapArtifactResolvingHelper helper) {
// Identify the artifact specs that need resolution.
// Ideally, there should be none at this point.
collection.forEach(spec -> {
if (spec.file == null) {
... | [
"private",
"static",
"void",
"resolveDependencies",
"(",
"Collection",
"<",
"ArtifactSpec",
">",
"collection",
",",
"ShrinkwrapArtifactResolvingHelper",
"helper",
")",
"{",
"// Identify the artifact specs that need resolution.",
"// Ideally, there should be none at this point.",
"c... | Resolve the given collection of ArtifactSpec references. This method attempts the resolution and ensures that the
references are updated to be as complete as possible.
@param collection the collection artifact specifications. | [
"Resolve",
"the",
"given",
"collection",
"of",
"ArtifactSpec",
"references",
".",
"This",
"method",
"attempts",
"the",
"resolution",
"and",
"ensures",
"that",
"the",
"references",
"are",
"updated",
"to",
"be",
"as",
"complete",
"as",
"possible",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/arquillian/gradle-adapter/src/main/java/org/wildfly/swarm/arquillian/adapter/gradle/GradleDependencyDeclarationFactory.java#L56-L70 |
64,937 | thorntail/thorntail | core/spi/src/main/java/org/wildfly/swarm/spi/api/SocketBindingGroup.java | SocketBindingGroup.socketBinding | public SocketBinding socketBinding(String name) {
return this.socketBindings.stream().filter(e -> e.name().equals(name)).findFirst().orElse(null);
} | java | public SocketBinding socketBinding(String name) {
return this.socketBindings.stream().filter(e -> e.name().equals(name)).findFirst().orElse(null);
} | [
"public",
"SocketBinding",
"socketBinding",
"(",
"String",
"name",
")",
"{",
"return",
"this",
".",
"socketBindings",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"e",
"->",
"e",
".",
"name",
"(",
")",
".",
"equals",
"(",
"name",
")",
")",
".",
"find... | Retrieve a socket-binding by name.
@param name The socket-binding name.
@return The socket-binding if present, otherwise {@code null}. | [
"Retrieve",
"a",
"socket",
"-",
"binding",
"by",
"name",
"."
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/spi/src/main/java/org/wildfly/swarm/spi/api/SocketBindingGroup.java#L118-L120 |
64,938 | thorntail/thorntail | fractions/microprofile/microprofile-jwt/src/main/java/org/wildfly/swarm/microprofile/jwtauth/deployment/auth/JWTAuthMethodExtension.java | JWTAuthMethodExtension.handleDeployment | @Override
public void handleDeployment(DeploymentInfo deploymentInfo, ServletContext servletContext) {
deploymentInfo.addAuthenticationMechanism("MP-JWT", new JWTAuthMechanismFactory());
deploymentInfo.addInnerHandlerChainWrapper(MpJwtPrincipalHandler::new);
} | java | @Override
public void handleDeployment(DeploymentInfo deploymentInfo, ServletContext servletContext) {
deploymentInfo.addAuthenticationMechanism("MP-JWT", new JWTAuthMechanismFactory());
deploymentInfo.addInnerHandlerChainWrapper(MpJwtPrincipalHandler::new);
} | [
"@",
"Override",
"public",
"void",
"handleDeployment",
"(",
"DeploymentInfo",
"deploymentInfo",
",",
"ServletContext",
"servletContext",
")",
"{",
"deploymentInfo",
".",
"addAuthenticationMechanism",
"(",
"\"MP-JWT\"",
",",
"new",
"JWTAuthMechanismFactory",
"(",
")",
")... | This registers the JWTAuthMechanismFactory under the "MP-JWT" mechanism name
@param deploymentInfo - the deployment to augment
@param servletContext - the ServletContext for the deployment | [
"This",
"registers",
"the",
"JWTAuthMechanismFactory",
"under",
"the",
"MP",
"-",
"JWT",
"mechanism",
"name"
] | 4a391b68ffae98c6e66d30a3bfb99dadc9509f14 | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/microprofile/microprofile-jwt/src/main/java/org/wildfly/swarm/microprofile/jwtauth/deployment/auth/JWTAuthMethodExtension.java#L35-L39 |
64,939 | OpenHFT/Chronicle-Map | src/main/java/net/openhft/chronicle/hash/impl/stage/iter/IterationAlloc.java | IterationAlloc.alloc | @Override
public long alloc(int chunks, long prevPos, int prevChunks) {
long ret = s.allocReturnCode(chunks);
if (prevPos >= 0)
s.free(prevPos, prevChunks);
if (ret >= 0)
return ret;
while (true) {
s.nextTier();
ret = s.allocReturnCode(... | java | @Override
public long alloc(int chunks, long prevPos, int prevChunks) {
long ret = s.allocReturnCode(chunks);
if (prevPos >= 0)
s.free(prevPos, prevChunks);
if (ret >= 0)
return ret;
while (true) {
s.nextTier();
ret = s.allocReturnCode(... | [
"@",
"Override",
"public",
"long",
"alloc",
"(",
"int",
"chunks",
",",
"long",
"prevPos",
",",
"int",
"prevChunks",
")",
"{",
"long",
"ret",
"=",
"s",
".",
"allocReturnCode",
"(",
"chunks",
")",
";",
"if",
"(",
"prevPos",
">=",
"0",
")",
"s",
".",
... | Move only to next tiers, to avoid double visiting of relocated entries during iteration | [
"Move",
"only",
"to",
"next",
"tiers",
"to",
"avoid",
"double",
"visiting",
"of",
"relocated",
"entries",
"during",
"iteration"
] | 0b09733cc96302f96be4394a261699eeb021fe37 | https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/hash/impl/stage/iter/IterationAlloc.java#L33-L46 |
64,940 | OpenHFT/Chronicle-Map | src/main/java/net/openhft/chronicle/hash/impl/util/BuildVersion.java | BuildVersion.getVersionFromPom | private static String getVersionFromPom() {
final String absolutePath = new File(BuildVersion.class.getResource(BuildVersion.class
.getSimpleName() + ".class").getPath())
.getParentFile().getParentFile().getParentFile().getParentFile().getParentFile()
.getParentF... | java | private static String getVersionFromPom() {
final String absolutePath = new File(BuildVersion.class.getResource(BuildVersion.class
.getSimpleName() + ".class").getPath())
.getParentFile().getParentFile().getParentFile().getParentFile().getParentFile()
.getParentF... | [
"private",
"static",
"String",
"getVersionFromPom",
"(",
")",
"{",
"final",
"String",
"absolutePath",
"=",
"new",
"File",
"(",
"BuildVersion",
".",
"class",
".",
"getResource",
"(",
"BuildVersion",
".",
"class",
".",
"getSimpleName",
"(",
")",
"+",
"\".class\"... | reads the pom file to get this version, only to be used for development or within the IDE.
@return gets the version from the pom.xml | [
"reads",
"the",
"pom",
"file",
"to",
"get",
"this",
"version",
"only",
"to",
"be",
"used",
"for",
"development",
"or",
"within",
"the",
"IDE",
"."
] | 0b09733cc96302f96be4394a261699eeb021fe37 | https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/hash/impl/util/BuildVersion.java#L91-L113 |
64,941 | akexorcist/Android-RoundCornerProgressBar | library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java | BaseRoundCornerProgressBar.setupStyleable | public void setupStyleable(Context context, AttributeSet attrs) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RoundCornerProgress);
radius = (int) typedArray.getDimension(R.styleable.RoundCornerProgress_rcRadius, dp2px(DEFAULT_PROGRESS_RADIUS));
padding = (int) typ... | java | public void setupStyleable(Context context, AttributeSet attrs) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RoundCornerProgress);
radius = (int) typedArray.getDimension(R.styleable.RoundCornerProgress_rcRadius, dp2px(DEFAULT_PROGRESS_RADIUS));
padding = (int) typ... | [
"public",
"void",
"setupStyleable",
"(",
"Context",
"context",
",",
"AttributeSet",
"attrs",
")",
"{",
"TypedArray",
"typedArray",
"=",
"context",
".",
"obtainStyledAttributes",
"(",
"attrs",
",",
"R",
".",
"styleable",
".",
"RoundCornerProgress",
")",
";",
"rad... | Retrieve initial parameter from view attribute | [
"Retrieve",
"initial",
"parameter",
"from",
"view",
"attribute"
] | b3ba8c028671d3e9949b141931f3b985ceba9bfa | https://github.com/akexorcist/Android-RoundCornerProgressBar/blob/b3ba8c028671d3e9949b141931f3b985ceba9bfa/library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java#L135-L156 |
64,942 | akexorcist/Android-RoundCornerProgressBar | library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java | BaseRoundCornerProgressBar.onSizeChanged | @Override
protected void onSizeChanged(int newWidth, int newHeight, int oldWidth, int oldHeight) {
super.onSizeChanged(newWidth, newHeight, oldWidth, oldHeight);
if(!isInEditMode()) {
totalWidth = newWidth;
drawAll();
postDelayed(new Runnable() {
@... | java | @Override
protected void onSizeChanged(int newWidth, int newHeight, int oldWidth, int oldHeight) {
super.onSizeChanged(newWidth, newHeight, oldWidth, oldHeight);
if(!isInEditMode()) {
totalWidth = newWidth;
drawAll();
postDelayed(new Runnable() {
@... | [
"@",
"Override",
"protected",
"void",
"onSizeChanged",
"(",
"int",
"newWidth",
",",
"int",
"newHeight",
",",
"int",
"oldWidth",
",",
"int",
"oldHeight",
")",
"{",
"super",
".",
"onSizeChanged",
"(",
"newWidth",
",",
"newHeight",
",",
"oldWidth",
",",
"oldHei... | Progress bar always refresh when view size has changed | [
"Progress",
"bar",
"always",
"refresh",
"when",
"view",
"size",
"has",
"changed"
] | b3ba8c028671d3e9949b141931f3b985ceba9bfa | https://github.com/akexorcist/Android-RoundCornerProgressBar/blob/b3ba8c028671d3e9949b141931f3b985ceba9bfa/library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java#L159-L173 |
64,943 | akexorcist/Android-RoundCornerProgressBar | library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java | BaseRoundCornerProgressBar.drawBackgroundProgress | @SuppressWarnings("deprecation")
private void drawBackgroundProgress() {
GradientDrawable backgroundDrawable = createGradientDrawable(colorBackground);
int newRadius = radius - (padding / 2);
backgroundDrawable.setCornerRadii(new float[]{newRadius, newRadius, newRadius, newRadius, newRadius,... | java | @SuppressWarnings("deprecation")
private void drawBackgroundProgress() {
GradientDrawable backgroundDrawable = createGradientDrawable(colorBackground);
int newRadius = radius - (padding / 2);
backgroundDrawable.setCornerRadii(new float[]{newRadius, newRadius, newRadius, newRadius, newRadius,... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"void",
"drawBackgroundProgress",
"(",
")",
"{",
"GradientDrawable",
"backgroundDrawable",
"=",
"createGradientDrawable",
"(",
"colorBackground",
")",
";",
"int",
"newRadius",
"=",
"radius",
"-",
"(",
... | Draw progress background | [
"Draw",
"progress",
"background"
] | b3ba8c028671d3e9949b141931f3b985ceba9bfa | https://github.com/akexorcist/Android-RoundCornerProgressBar/blob/b3ba8c028671d3e9949b141931f3b985ceba9bfa/library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java#L186-L196 |
64,944 | akexorcist/Android-RoundCornerProgressBar | library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java | BaseRoundCornerProgressBar.createGradientDrawable | protected GradientDrawable createGradientDrawable(int color) {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setShape(GradientDrawable.RECTANGLE);
gradientDrawable.setColor(color);
return gradientDrawable;
} | java | protected GradientDrawable createGradientDrawable(int color) {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setShape(GradientDrawable.RECTANGLE);
gradientDrawable.setColor(color);
return gradientDrawable;
} | [
"protected",
"GradientDrawable",
"createGradientDrawable",
"(",
"int",
"color",
")",
"{",
"GradientDrawable",
"gradientDrawable",
"=",
"new",
"GradientDrawable",
"(",
")",
";",
"gradientDrawable",
".",
"setShape",
"(",
"GradientDrawable",
".",
"RECTANGLE",
")",
";",
... | Create an empty color rectangle gradient drawable | [
"Create",
"an",
"empty",
"color",
"rectangle",
"gradient",
"drawable"
] | b3ba8c028671d3e9949b141931f3b985ceba9bfa | https://github.com/akexorcist/Android-RoundCornerProgressBar/blob/b3ba8c028671d3e9949b141931f3b985ceba9bfa/library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java#L199-L204 |
64,945 | akexorcist/Android-RoundCornerProgressBar | library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java | BaseRoundCornerProgressBar.setupReverse | private void setupReverse(LinearLayout layoutProgress) {
RelativeLayout.LayoutParams progressParams = (RelativeLayout.LayoutParams) layoutProgress.getLayoutParams();
removeLayoutParamsRule(progressParams);
if (isReverse) {
progressParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
... | java | private void setupReverse(LinearLayout layoutProgress) {
RelativeLayout.LayoutParams progressParams = (RelativeLayout.LayoutParams) layoutProgress.getLayoutParams();
removeLayoutParamsRule(progressParams);
if (isReverse) {
progressParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
... | [
"private",
"void",
"setupReverse",
"(",
"LinearLayout",
"layoutProgress",
")",
"{",
"RelativeLayout",
".",
"LayoutParams",
"progressParams",
"=",
"(",
"RelativeLayout",
".",
"LayoutParams",
")",
"layoutProgress",
".",
"getLayoutParams",
"(",
")",
";",
"removeLayoutPar... | Change progress position by depending on isReverse flag | [
"Change",
"progress",
"position",
"by",
"depending",
"on",
"isReverse",
"flag"
] | b3ba8c028671d3e9949b141931f3b985ceba9bfa | https://github.com/akexorcist/Android-RoundCornerProgressBar/blob/b3ba8c028671d3e9949b141931f3b985ceba9bfa/library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java#L220-L235 |
64,946 | akexorcist/Android-RoundCornerProgressBar | library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java | BaseRoundCornerProgressBar.removeLayoutParamsRule | private void removeLayoutParamsRule(RelativeLayout.LayoutParams layoutParams) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
layoutParams.removeRule(RelativeLayout.ALIGN_PARENT_RIGHT);
layoutParams.removeRule(RelativeLayout.ALIGN_PARENT_END);
layoutParam... | java | private void removeLayoutParamsRule(RelativeLayout.LayoutParams layoutParams) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
layoutParams.removeRule(RelativeLayout.ALIGN_PARENT_RIGHT);
layoutParams.removeRule(RelativeLayout.ALIGN_PARENT_END);
layoutParam... | [
"private",
"void",
"removeLayoutParamsRule",
"(",
"RelativeLayout",
".",
"LayoutParams",
"layoutParams",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODES",
".",
"JELLY_BEAN_MR1",
")",
"{",
"layoutParams",
".",
"rem... | Remove all of relative align rule | [
"Remove",
"all",
"of",
"relative",
"align",
"rule"
] | b3ba8c028671d3e9949b141931f3b985ceba9bfa | https://github.com/akexorcist/Android-RoundCornerProgressBar/blob/b3ba8c028671d3e9949b141931f3b985ceba9bfa/library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java#L242-L252 |
64,947 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/Connection.java | Connection.sendTCP | public int sendTCP (Object object) {
if (object == null) throw new IllegalArgumentException("object cannot be null.");
try {
int length = tcp.send(this, object);
if (length == 0) {
if (TRACE) trace("kryonet", this + " TCP had nothing to send.");
} else if (DEBUG) {
String objectString = object == n... | java | public int sendTCP (Object object) {
if (object == null) throw new IllegalArgumentException("object cannot be null.");
try {
int length = tcp.send(this, object);
if (length == 0) {
if (TRACE) trace("kryonet", this + " TCP had nothing to send.");
} else if (DEBUG) {
String objectString = object == n... | [
"public",
"int",
"sendTCP",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"object cannot be null.\"",
")",
";",
"try",
"{",
"int",
"length",
"=",
"tcp",
".",
"send",
"(",
"this... | Sends the object over the network using TCP.
@return The number of bytes sent.
@see Kryo#register(Class, com.esotericsoftware.kryo.Serializer) | [
"Sends",
"the",
"object",
"over",
"the",
"network",
"using",
"TCP",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/Connection.java#L84-L108 |
64,948 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/Connection.java | Connection.sendUDP | public int sendUDP (Object object) {
if (object == null) throw new IllegalArgumentException("object cannot be null.");
SocketAddress address = udpRemoteAddress;
if (address == null && udp != null) address = udp.connectedAddress;
if (address == null && isConnected) throw new IllegalStateException("Connection is ... | java | public int sendUDP (Object object) {
if (object == null) throw new IllegalArgumentException("object cannot be null.");
SocketAddress address = udpRemoteAddress;
if (address == null && udp != null) address = udp.connectedAddress;
if (address == null && isConnected) throw new IllegalStateException("Connection is ... | [
"public",
"int",
"sendUDP",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"object cannot be null.\"",
")",
";",
"SocketAddress",
"address",
"=",
"udpRemoteAddress",
";",
"if",
"(",
... | Sends the object over the network using UDP.
@return The number of bytes sent.
@see Kryo#register(Class, com.esotericsoftware.kryo.Serializer)
@throws IllegalStateException if this connection was not opened with both TCP and UDP. | [
"Sends",
"the",
"object",
"over",
"the",
"network",
"using",
"UDP",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/Connection.java#L114-L147 |
64,949 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/Connection.java | Connection.getRemoteAddressTCP | public InetSocketAddress getRemoteAddressTCP () {
SocketChannel socketChannel = tcp.socketChannel;
if (socketChannel != null) {
Socket socket = tcp.socketChannel.socket();
if (socket != null) {
return (InetSocketAddress)socket.getRemoteSocketAddress();
}
}
return null;
} | java | public InetSocketAddress getRemoteAddressTCP () {
SocketChannel socketChannel = tcp.socketChannel;
if (socketChannel != null) {
Socket socket = tcp.socketChannel.socket();
if (socket != null) {
return (InetSocketAddress)socket.getRemoteSocketAddress();
}
}
return null;
} | [
"public",
"InetSocketAddress",
"getRemoteAddressTCP",
"(",
")",
"{",
"SocketChannel",
"socketChannel",
"=",
"tcp",
".",
"socketChannel",
";",
"if",
"(",
"socketChannel",
"!=",
"null",
")",
"{",
"Socket",
"socket",
"=",
"tcp",
".",
"socketChannel",
".",
"socket",... | Returns the IP address and port of the remote end of the TCP connection, or null if this connection is not connected. | [
"Returns",
"the",
"IP",
"address",
"and",
"port",
"of",
"the",
"remote",
"end",
"of",
"the",
"TCP",
"connection",
"or",
"null",
"if",
"this",
"connection",
"is",
"not",
"connected",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/Connection.java#L283-L292 |
64,950 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/Connection.java | Connection.getRemoteAddressUDP | public InetSocketAddress getRemoteAddressUDP () {
InetSocketAddress connectedAddress = udp.connectedAddress;
if (connectedAddress != null) return connectedAddress;
return udpRemoteAddress;
} | java | public InetSocketAddress getRemoteAddressUDP () {
InetSocketAddress connectedAddress = udp.connectedAddress;
if (connectedAddress != null) return connectedAddress;
return udpRemoteAddress;
} | [
"public",
"InetSocketAddress",
"getRemoteAddressUDP",
"(",
")",
"{",
"InetSocketAddress",
"connectedAddress",
"=",
"udp",
".",
"connectedAddress",
";",
"if",
"(",
"connectedAddress",
"!=",
"null",
")",
"return",
"connectedAddress",
";",
"return",
"udpRemoteAddress",
"... | Returns the IP address and port of the remote end of the UDP connection, or null if this connection is not connected. | [
"Returns",
"the",
"IP",
"address",
"and",
"port",
"of",
"the",
"remote",
"end",
"of",
"the",
"UDP",
"connection",
"or",
"null",
"if",
"this",
"connection",
"is",
"not",
"connected",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/Connection.java#L295-L299 |
64,951 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java | ObjectSpace.close | public void close () {
Connection[] connections = this.connections;
for (int i = 0; i < connections.length; i++)
connections[i].removeListener(invokeListener);
synchronized (instancesLock) {
ArrayList<ObjectSpace> temp = new ArrayList(Arrays.asList(instances));
temp.remove(this);
instances = temp.toA... | java | public void close () {
Connection[] connections = this.connections;
for (int i = 0; i < connections.length; i++)
connections[i].removeListener(invokeListener);
synchronized (instancesLock) {
ArrayList<ObjectSpace> temp = new ArrayList(Arrays.asList(instances));
temp.remove(this);
instances = temp.toA... | [
"public",
"void",
"close",
"(",
")",
"{",
"Connection",
"[",
"]",
"connections",
"=",
"this",
".",
"connections",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"connections",
".",
"length",
";",
"i",
"++",
")",
"connections",
"[",
"i",
"]",... | Causes this ObjectSpace to stop listening to the connections for method invocation messages. | [
"Causes",
"this",
"ObjectSpace",
"to",
"stop",
"listening",
"to",
"the",
"connections",
"for",
"method",
"invocation",
"messages",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java#L170-L182 |
64,952 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java | ObjectSpace.addConnection | public void addConnection (Connection connection) {
if (connection == null) throw new IllegalArgumentException("connection cannot be null.");
synchronized (connectionsLock) {
Connection[] newConnections = new Connection[connections.length + 1];
newConnections[0] = connection;
System.arraycopy(connections,... | java | public void addConnection (Connection connection) {
if (connection == null) throw new IllegalArgumentException("connection cannot be null.");
synchronized (connectionsLock) {
Connection[] newConnections = new Connection[connections.length + 1];
newConnections[0] = connection;
System.arraycopy(connections,... | [
"public",
"void",
"addConnection",
"(",
"Connection",
"connection",
")",
"{",
"if",
"(",
"connection",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"connection cannot be null.\"",
")",
";",
"synchronized",
"(",
"connectionsLock",
")",
"{",
... | Allows the remote end of the specified connection to access objects registered in this ObjectSpace. | [
"Allows",
"the",
"remote",
"end",
"of",
"the",
"specified",
"connection",
"to",
"access",
"objects",
"registered",
"in",
"this",
"ObjectSpace",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java#L185-L198 |
64,953 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java | ObjectSpace.removeConnection | public void removeConnection (Connection connection) {
if (connection == null) throw new IllegalArgumentException("connection cannot be null.");
connection.removeListener(invokeListener);
synchronized (connectionsLock) {
ArrayList<Connection> temp = new ArrayList(Arrays.asList(connections));
temp.remove(c... | java | public void removeConnection (Connection connection) {
if (connection == null) throw new IllegalArgumentException("connection cannot be null.");
connection.removeListener(invokeListener);
synchronized (connectionsLock) {
ArrayList<Connection> temp = new ArrayList(Arrays.asList(connections));
temp.remove(c... | [
"public",
"void",
"removeConnection",
"(",
"Connection",
"connection",
")",
"{",
"if",
"(",
"connection",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"connection cannot be null.\"",
")",
";",
"connection",
".",
"removeListener",
"(",
"invok... | Removes the specified connection, it will no longer be able to access objects registered in this ObjectSpace. | [
"Removes",
"the",
"specified",
"connection",
"it",
"will",
"no",
"longer",
"be",
"able",
"to",
"access",
"objects",
"registered",
"in",
"this",
"ObjectSpace",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java#L201-L213 |
64,954 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java | ObjectSpace.getRegisteredObject | static Object getRegisteredObject (Connection connection, int objectID) {
ObjectSpace[] instances = ObjectSpace.instances;
for (int i = 0, n = instances.length; i < n; i++) {
ObjectSpace objectSpace = instances[i];
// Check if the connection is in this ObjectSpace.
Connection[] connections = objectSpace.co... | java | static Object getRegisteredObject (Connection connection, int objectID) {
ObjectSpace[] instances = ObjectSpace.instances;
for (int i = 0, n = instances.length; i < n; i++) {
ObjectSpace objectSpace = instances[i];
// Check if the connection is in this ObjectSpace.
Connection[] connections = objectSpace.co... | [
"static",
"Object",
"getRegisteredObject",
"(",
"Connection",
"connection",
",",
"int",
"objectID",
")",
"{",
"ObjectSpace",
"[",
"]",
"instances",
"=",
"ObjectSpace",
".",
"instances",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"n",
"=",
"instances",
"."... | Returns the first object registered with the specified ID in any of the ObjectSpaces the specified connection belongs
to. | [
"Returns",
"the",
"first",
"object",
"registered",
"with",
"the",
"specified",
"ID",
"in",
"any",
"of",
"the",
"ObjectSpaces",
"the",
"specified",
"connection",
"belongs",
"to",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java#L651-L665 |
64,955 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java | ObjectSpace.getRegisteredID | static int getRegisteredID (Connection connection, Object object) {
ObjectSpace[] instances = ObjectSpace.instances;
for (int i = 0, n = instances.length; i < n; i++) {
ObjectSpace objectSpace = instances[i];
// Check if the connection is in this ObjectSpace.
Connection[] connections = objectSpace.connecti... | java | static int getRegisteredID (Connection connection, Object object) {
ObjectSpace[] instances = ObjectSpace.instances;
for (int i = 0, n = instances.length; i < n; i++) {
ObjectSpace objectSpace = instances[i];
// Check if the connection is in this ObjectSpace.
Connection[] connections = objectSpace.connecti... | [
"static",
"int",
"getRegisteredID",
"(",
"Connection",
"connection",
",",
"Object",
"object",
")",
"{",
"ObjectSpace",
"[",
"]",
"instances",
"=",
"ObjectSpace",
".",
"instances",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"n",
"=",
"instances",
".",
"l... | Returns the first ID registered for the specified object with any of the ObjectSpaces the specified connection belongs to,
or Integer.MAX_VALUE if not found. | [
"Returns",
"the",
"first",
"ID",
"registered",
"for",
"the",
"specified",
"object",
"with",
"any",
"of",
"the",
"ObjectSpaces",
"the",
"specified",
"connection",
"belongs",
"to",
"or",
"Integer",
".",
"MAX_VALUE",
"if",
"not",
"found",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java#L669-L683 |
64,956 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java | ObjectSpace.registerClasses | static public void registerClasses (final Kryo kryo) {
kryo.register(Object[].class);
kryo.register(InvokeMethod.class);
FieldSerializer<InvokeMethodResult> resultSerializer = new FieldSerializer<InvokeMethodResult>(kryo,
InvokeMethodResult.class) {
public void write (Kryo kryo, Output output, InvokeMethod... | java | static public void registerClasses (final Kryo kryo) {
kryo.register(Object[].class);
kryo.register(InvokeMethod.class);
FieldSerializer<InvokeMethodResult> resultSerializer = new FieldSerializer<InvokeMethodResult>(kryo,
InvokeMethodResult.class) {
public void write (Kryo kryo, Output output, InvokeMethod... | [
"static",
"public",
"void",
"registerClasses",
"(",
"final",
"Kryo",
"kryo",
")",
"{",
"kryo",
".",
"register",
"(",
"Object",
"[",
"]",
".",
"class",
")",
";",
"kryo",
".",
"register",
"(",
"InvokeMethod",
".",
"class",
")",
";",
"FieldSerializer",
"<",... | Registers the classes needed to use ObjectSpaces. This should be called before any connections are opened.
@see Kryo#register(Class, Serializer) | [
"Registers",
"the",
"classes",
"needed",
"to",
"use",
"ObjectSpaces",
".",
"This",
"should",
"be",
"called",
"before",
"any",
"connections",
"are",
"opened",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java#L687-L721 |
64,957 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/util/ObjectIntMap.java | ObjectIntMap.ensureCapacity | public void ensureCapacity (int additionalCapacity) {
int sizeNeeded = size + additionalCapacity;
if (sizeNeeded >= threshold) resize(ObjectMap.nextPowerOfTwo((int)(sizeNeeded / loadFactor)));
} | java | public void ensureCapacity (int additionalCapacity) {
int sizeNeeded = size + additionalCapacity;
if (sizeNeeded >= threshold) resize(ObjectMap.nextPowerOfTwo((int)(sizeNeeded / loadFactor)));
} | [
"public",
"void",
"ensureCapacity",
"(",
"int",
"additionalCapacity",
")",
"{",
"int",
"sizeNeeded",
"=",
"size",
"+",
"additionalCapacity",
";",
"if",
"(",
"sizeNeeded",
">=",
"threshold",
")",
"resize",
"(",
"ObjectMap",
".",
"nextPowerOfTwo",
"(",
"(",
"int... | Increases the size of the backing array to acommodate the specified number of additional items. Useful before adding many
items to avoid multiple backing array resizes. | [
"Increases",
"the",
"size",
"of",
"the",
"backing",
"array",
"to",
"acommodate",
"the",
"specified",
"number",
"of",
"additional",
"items",
".",
"Useful",
"before",
"adding",
"many",
"items",
"to",
"avoid",
"multiple",
"backing",
"array",
"resizes",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/util/ObjectIntMap.java#L443-L446 |
64,958 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/Client.java | Client.discoverHost | public InetAddress discoverHost (int udpPort, int timeoutMillis) {
DatagramSocket socket = null;
try {
socket = new DatagramSocket();
broadcast(udpPort, socket);
socket.setSoTimeout(timeoutMillis);
DatagramPacket packet = discoveryHandler.onRequestNewDatagramPacket();
try {
socket.receive(packet)... | java | public InetAddress discoverHost (int udpPort, int timeoutMillis) {
DatagramSocket socket = null;
try {
socket = new DatagramSocket();
broadcast(udpPort, socket);
socket.setSoTimeout(timeoutMillis);
DatagramPacket packet = discoveryHandler.onRequestNewDatagramPacket();
try {
socket.receive(packet)... | [
"public",
"InetAddress",
"discoverHost",
"(",
"int",
"udpPort",
",",
"int",
"timeoutMillis",
")",
"{",
"DatagramSocket",
"socket",
"=",
"null",
";",
"try",
"{",
"socket",
"=",
"new",
"DatagramSocket",
"(",
")",
";",
"broadcast",
"(",
"udpPort",
",",
"socket"... | Broadcasts a UDP message on the LAN to discover any running servers. The address of the first server to respond is
returned.
@param udpPort The UDP port of the server.
@param timeoutMillis The number of milliseconds to wait for a response.
@return the first server found, or null if no server responded. | [
"Broadcasts",
"a",
"UDP",
"message",
"on",
"the",
"LAN",
"to",
"discover",
"any",
"running",
"servers",
".",
"The",
"address",
"of",
"the",
"first",
"server",
"to",
"respond",
"is",
"returned",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/Client.java#L480-L503 |
64,959 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/Client.java | Client.discoverHosts | public List<InetAddress> discoverHosts (int udpPort, int timeoutMillis) {
List<InetAddress> hosts = new ArrayList<InetAddress>();
DatagramSocket socket = null;
try {
socket = new DatagramSocket();
broadcast(udpPort, socket);
socket.setSoTimeout(timeoutMillis);
while (true) {
DatagramPacket packet ... | java | public List<InetAddress> discoverHosts (int udpPort, int timeoutMillis) {
List<InetAddress> hosts = new ArrayList<InetAddress>();
DatagramSocket socket = null;
try {
socket = new DatagramSocket();
broadcast(udpPort, socket);
socket.setSoTimeout(timeoutMillis);
while (true) {
DatagramPacket packet ... | [
"public",
"List",
"<",
"InetAddress",
">",
"discoverHosts",
"(",
"int",
"udpPort",
",",
"int",
"timeoutMillis",
")",
"{",
"List",
"<",
"InetAddress",
">",
"hosts",
"=",
"new",
"ArrayList",
"<",
"InetAddress",
">",
"(",
")",
";",
"DatagramSocket",
"socket",
... | Broadcasts a UDP message on the LAN to discover any running servers.
@param udpPort The UDP port of the server.
@param timeoutMillis The number of milliseconds to wait for a response. | [
"Broadcasts",
"a",
"UDP",
"message",
"on",
"the",
"LAN",
"to",
"discover",
"any",
"running",
"servers",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/Client.java#L508-L534 |
64,960 | EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/Server.java | Server.sendToAllTCP | public void sendToAllTCP (Object object) {
Connection[] connections = this.connections;
for (int i = 0, n = connections.length; i < n; i++) {
Connection connection = connections[i];
connection.sendTCP(object);
}
} | java | public void sendToAllTCP (Object object) {
Connection[] connections = this.connections;
for (int i = 0, n = connections.length; i < n; i++) {
Connection connection = connections[i];
connection.sendTCP(object);
}
} | [
"public",
"void",
"sendToAllTCP",
"(",
"Object",
"object",
")",
"{",
"Connection",
"[",
"]",
"connections",
"=",
"this",
".",
"connections",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"n",
"=",
"connections",
".",
"length",
";",
"i",
"<",
"n",
";",
... | BOZO - Provide mechanism for sending to multiple clients without serializing multiple times. | [
"BOZO",
"-",
"Provide",
"mechanism",
"for",
"sending",
"to",
"multiple",
"clients",
"without",
"serializing",
"multiple",
"times",
"."
] | 2ed19b4743667664d15e3778447e579855ba3a65 | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/Server.java#L465-L471 |
64,961 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-logback/src/main/java/com/googlecode/jmxtrans/model/output/NagiosWriter.java | NagiosWriter.internalWrite | @Override
public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {
checkFile(query);
List<String> typeNames = getTypeNames();
for (Result result : results) {
String[] keyString = KeyUtils.getKeyString(server, query, result, typeNames, null).split("\\.");
if (... | java | @Override
public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {
checkFile(query);
List<String> typeNames = getTypeNames();
for (Result result : results) {
String[] keyString = KeyUtils.getKeyString(server, query, result, typeNames, null).split("\\.");
if (... | [
"@",
"Override",
"public",
"void",
"internalWrite",
"(",
"Server",
"server",
",",
"Query",
"query",
",",
"ImmutableList",
"<",
"Result",
">",
"results",
")",
"throws",
"Exception",
"{",
"checkFile",
"(",
"query",
")",
";",
"List",
"<",
"String",
">",
"type... | The meat of the output. Nagios format.. | [
"The",
"meat",
"of",
"the",
"output",
".",
"Nagios",
"format",
".."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-logback/src/main/java/com/googlecode/jmxtrans/model/output/NagiosWriter.java#L167-L198 |
64,962 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-logback/src/main/java/com/googlecode/jmxtrans/model/output/NagiosWriter.java | NagiosWriter.nagiosCheckValue | protected String nagiosCheckValue(String value, String composeRange) {
List<String> simpleRange = Arrays.asList(composeRange.split(","));
double doubleValue = Double.parseDouble(value);
if (composeRange.isEmpty()) {
return "0";
}
if (simpleRange.size() == 1) {
if (composeRange.endsWith(",")) {
if ... | java | protected String nagiosCheckValue(String value, String composeRange) {
List<String> simpleRange = Arrays.asList(composeRange.split(","));
double doubleValue = Double.parseDouble(value);
if (composeRange.isEmpty()) {
return "0";
}
if (simpleRange.size() == 1) {
if (composeRange.endsWith(",")) {
if ... | [
"protected",
"String",
"nagiosCheckValue",
"(",
"String",
"value",
",",
"String",
"composeRange",
")",
"{",
"List",
"<",
"String",
">",
"simpleRange",
"=",
"Arrays",
".",
"asList",
"(",
"composeRange",
".",
"split",
"(",
"\",\"",
")",
")",
";",
"double",
"... | Define if a value is in a critical, warning or ok state. | [
"Define",
"if",
"a",
"value",
"is",
"in",
"a",
"critical",
"warning",
"or",
"ok",
"state",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-logback/src/main/java/com/googlecode/jmxtrans/model/output/NagiosWriter.java#L236-L268 |
64,963 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/TCollectorUDPWriter.java | TCollectorUDPWriter.prepareSender | @Override
public void prepareSender() throws LifecycleException {
if (host == null || port == null) {
throw new LifecycleException("Host and port for " + this.getClass().getSimpleName() + " output can't be null");
}
try {
this.dgSocket = new DatagramSocket();
this.address = new InetSocketAddress(host,... | java | @Override
public void prepareSender() throws LifecycleException {
if (host == null || port == null) {
throw new LifecycleException("Host and port for " + this.getClass().getSimpleName() + " output can't be null");
}
try {
this.dgSocket = new DatagramSocket();
this.address = new InetSocketAddress(host,... | [
"@",
"Override",
"public",
"void",
"prepareSender",
"(",
")",
"throws",
"LifecycleException",
"{",
"if",
"(",
"host",
"==",
"null",
"||",
"port",
"==",
"null",
")",
"{",
"throw",
"new",
"LifecycleException",
"(",
"\"Host and port for \"",
"+",
"this",
".",
"... | Setup at start of the writer. | [
"Setup",
"at",
"start",
"of",
"the",
"writer",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/TCollectorUDPWriter.java#L106-L120 |
64,964 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/TCollectorUDPWriter.java | TCollectorUDPWriter.sendOutput | @Override
protected void sendOutput(String metricLine) throws IOException {
DatagramPacket packet;
byte[] data;
data = metricLine.getBytes("UTF-8");
packet = new DatagramPacket(data, 0, data.length, this.address);
this.dgSocket.send(packet);
} | java | @Override
protected void sendOutput(String metricLine) throws IOException {
DatagramPacket packet;
byte[] data;
data = metricLine.getBytes("UTF-8");
packet = new DatagramPacket(data, 0, data.length, this.address);
this.dgSocket.send(packet);
} | [
"@",
"Override",
"protected",
"void",
"sendOutput",
"(",
"String",
"metricLine",
")",
"throws",
"IOException",
"{",
"DatagramPacket",
"packet",
";",
"byte",
"[",
"]",
"data",
";",
"data",
"=",
"metricLine",
".",
"getBytes",
"(",
"\"UTF-8\"",
")",
";",
"packe... | Send a single metric to TCollector.
@param metricLine - the line containing the metric name, value, and tags for a single metric; excludes the
"put" keyword expected by OpenTSDB and the trailing newline character. | [
"Send",
"a",
"single",
"metric",
"to",
"TCollector",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/TCollectorUDPWriter.java#L128-L137 |
64,965 | jmxtrans/jmxtrans | jmxtrans-utils/src/main/java/com/googlecode/jmxtrans/util/NumberUtils.java | NumberUtils.isNumeric | public static boolean isNumeric(Object value) {
if (value == null) return false;
if (value instanceof Number) return true;
if (value instanceof String) {
String stringValue = (String) value;
if (isNullOrEmpty(stringValue)) return true;
return isNumber(stringValue);
}
return false;
} | java | public static boolean isNumeric(Object value) {
if (value == null) return false;
if (value instanceof Number) return true;
if (value instanceof String) {
String stringValue = (String) value;
if (isNullOrEmpty(stringValue)) return true;
return isNumber(stringValue);
}
return false;
} | [
"public",
"static",
"boolean",
"isNumeric",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"value",
"instanceof",
"Number",
")",
"return",
"true",
";",
"if",
"(",
"value",
"instanceof",
"String... | Useful for figuring out if an Object is a number. | [
"Useful",
"for",
"figuring",
"out",
"if",
"an",
"Object",
"is",
"a",
"number",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-utils/src/main/java/com/googlecode/jmxtrans/util/NumberUtils.java#L35-L44 |
64,966 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/OpenTSDBGenericWriter.java | OpenTSDBGenericWriter.internalWrite | @Override
public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {
this.startOutput();
for (String formattedResult : messageFormatter.formatResults(results, server)) {
log.debug("Sending result: {}", formattedResult);
this.sendOutput(formattedResult);
}
th... | java | @Override
public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {
this.startOutput();
for (String formattedResult : messageFormatter.formatResults(results, server)) {
log.debug("Sending result: {}", formattedResult);
this.sendOutput(formattedResult);
}
th... | [
"@",
"Override",
"public",
"void",
"internalWrite",
"(",
"Server",
"server",
",",
"Query",
"query",
",",
"ImmutableList",
"<",
"Result",
">",
"results",
")",
"throws",
"Exception",
"{",
"this",
".",
"startOutput",
"(",
")",
";",
"for",
"(",
"String",
"form... | Write the results of the query.
@param server
@param query - the query and its results.
@param results | [
"Write",
"the",
"results",
"of",
"the",
"query",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/OpenTSDBGenericWriter.java#L144-L152 |
64,967 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/KeyUtils.java | KeyUtils.getKeyString | public static String getKeyString(Server server, Query query, Result result, List<String> typeNames, String rootPrefix) {
StringBuilder sb = new StringBuilder();
addRootPrefix(rootPrefix, sb);
addAlias(server, sb);
addSeparator(sb);
addMBeanIdentifier(query, result, sb);
addSeparator(sb);
addTypeName(quer... | java | public static String getKeyString(Server server, Query query, Result result, List<String> typeNames, String rootPrefix) {
StringBuilder sb = new StringBuilder();
addRootPrefix(rootPrefix, sb);
addAlias(server, sb);
addSeparator(sb);
addMBeanIdentifier(query, result, sb);
addSeparator(sb);
addTypeName(quer... | [
"public",
"static",
"String",
"getKeyString",
"(",
"Server",
"server",
",",
"Query",
"query",
",",
"Result",
"result",
",",
"List",
"<",
"String",
">",
"typeNames",
",",
"String",
"rootPrefix",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(... | Gets the key string.
@param server
@param query the query
@param result the result
@param typeNames the type names
@param rootPrefix the root prefix
@return the key string | [
"Gets",
"the",
"key",
"string",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/KeyUtils.java#L46-L56 |
64,968 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/KeyUtils.java | KeyUtils.getKeyString | public static String getKeyString(Query query, Result result, List<String> typeNames) {
StringBuilder sb = new StringBuilder();
addMBeanIdentifier(query, result, sb);
addSeparator(sb);
addTypeName(query, result, typeNames, sb);
addKeyString(query, result, sb);
return sb.toString();
} | java | public static String getKeyString(Query query, Result result, List<String> typeNames) {
StringBuilder sb = new StringBuilder();
addMBeanIdentifier(query, result, sb);
addSeparator(sb);
addTypeName(query, result, typeNames, sb);
addKeyString(query, result, sb);
return sb.toString();
} | [
"public",
"static",
"String",
"getKeyString",
"(",
"Query",
"query",
",",
"Result",
"result",
",",
"List",
"<",
"String",
">",
"typeNames",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"addMBeanIdentifier",
"(",
"query",
",",
... | Gets the key string, without rootPrefix nor Alias
@param query the query
@param result the result
@param typeNames the type names
@return the key string | [
"Gets",
"the",
"key",
"string",
"without",
"rootPrefix",
"nor",
"Alias"
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/KeyUtils.java#L66-L73 |
64,969 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/KeyUtils.java | KeyUtils.getPrefixedKeyString | public static String getPrefixedKeyString(Query query, Result result, List<String> typeNames) {
StringBuilder sb = new StringBuilder();
addTypeName(query, result, typeNames, sb);
addKeyString(query, result, sb);
return sb.toString();
} | java | public static String getPrefixedKeyString(Query query, Result result, List<String> typeNames) {
StringBuilder sb = new StringBuilder();
addTypeName(query, result, typeNames, sb);
addKeyString(query, result, sb);
return sb.toString();
} | [
"public",
"static",
"String",
"getPrefixedKeyString",
"(",
"Query",
"query",
",",
"Result",
"result",
",",
"List",
"<",
"String",
">",
"typeNames",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"addTypeName",
"(",
"query",
",",... | Gets the key string, without rootPrefix or Alias
@param query the query
@param result the result
@param typeNames the type names
@return the key string | [
"Gets",
"the",
"key",
"string",
"without",
"rootPrefix",
"or",
"Alias"
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/KeyUtils.java#L89-L94 |
64,970 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/KeyUtils.java | KeyUtils.addMBeanIdentifier | private static void addMBeanIdentifier(Query query, Result result, StringBuilder sb) {
if (result.getKeyAlias() != null) {
sb.append(result.getKeyAlias());
} else if (query.isUseObjDomainAsKey()) {
sb.append(StringUtils.cleanupStr(result.getObjDomain(), query.isAllowDottedKeys()));
} else {
sb.append(Str... | java | private static void addMBeanIdentifier(Query query, Result result, StringBuilder sb) {
if (result.getKeyAlias() != null) {
sb.append(result.getKeyAlias());
} else if (query.isUseObjDomainAsKey()) {
sb.append(StringUtils.cleanupStr(result.getObjDomain(), query.isAllowDottedKeys()));
} else {
sb.append(Str... | [
"private",
"static",
"void",
"addMBeanIdentifier",
"(",
"Query",
"query",
",",
"Result",
"result",
",",
"StringBuilder",
"sb",
")",
"{",
"if",
"(",
"result",
".",
"getKeyAlias",
"(",
")",
"!=",
"null",
")",
"{",
"sb",
".",
"append",
"(",
"result",
".",
... | Adds a key to the StringBuilder
It uses in order of preference:
1. resultAlias if that was specified as part of the query
2. The domain portion of the ObjectName in the query if useObjDomainAsKey is set to true
3. else, the Class Name of the MBean. I.e. ClassName will be used by default if the
user doesn't specify an... | [
"Adds",
"a",
"key",
"to",
"the",
"StringBuilder"
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/KeyUtils.java#L127-L135 |
64,971 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-ganglia/src/main/java/com/googlecode/jmxtrans/model/output/GangliaWriter.java | GangliaWriter.validateSetup | @Override
public void validateSetup(Server server, Query query) throws ValidationException {
// Determine the spoofed hostname
spoofedHostName = getSpoofedHostName(server.getHost(), server.getAlias());
log.debug("Validated Ganglia metric [" +
HOST + ": " + host + ", " +
PORT + ": " + port + ", " +
A... | java | @Override
public void validateSetup(Server server, Query query) throws ValidationException {
// Determine the spoofed hostname
spoofedHostName = getSpoofedHostName(server.getHost(), server.getAlias());
log.debug("Validated Ganglia metric [" +
HOST + ": " + host + ", " +
PORT + ": " + port + ", " +
A... | [
"@",
"Override",
"public",
"void",
"validateSetup",
"(",
"Server",
"server",
",",
"Query",
"query",
")",
"throws",
"ValidationException",
"{",
"// Determine the spoofed hostname",
"spoofedHostName",
"=",
"getSpoofedHostName",
"(",
"server",
".",
"getHost",
"(",
")",
... | Parse and validate settings. | [
"Parse",
"and",
"validate",
"settings",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-ganglia/src/main/java/com/googlecode/jmxtrans/model/output/GangliaWriter.java#L152-L169 |
64,972 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-ganglia/src/main/java/com/googlecode/jmxtrans/model/output/GangliaWriter.java | GangliaWriter.internalWrite | @Override
public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {
for (final Result result : results) {
final String name = KeyUtils.getKeyString(query, result, getTypeNames());
Object transformedValue = valueTransformer.apply(result.getValue());
GMetricType... | java | @Override
public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {
for (final Result result : results) {
final String name = KeyUtils.getKeyString(query, result, getTypeNames());
Object transformedValue = valueTransformer.apply(result.getValue());
GMetricType... | [
"@",
"Override",
"public",
"void",
"internalWrite",
"(",
"Server",
"server",
",",
"Query",
"query",
",",
"ImmutableList",
"<",
"Result",
">",
"results",
")",
"throws",
"Exception",
"{",
"for",
"(",
"final",
"Result",
"result",
":",
"results",
")",
"{",
"fi... | Send query result values to Ganglia. | [
"Send",
"query",
"result",
"values",
"to",
"Ganglia",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-ganglia/src/main/java/com/googlecode/jmxtrans/model/output/GangliaWriter.java#L192-L205 |
64,973 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-ganglia/src/main/java/com/googlecode/jmxtrans/model/output/GangliaWriter.java | GangliaWriter.getType | private static GMetricType getType(final Object obj) {
// FIXME This is far from covering all cases.
// FIXME Wasteful use of high capacity types (eg Short => INT32)
// Direct mapping when possible
if (obj instanceof Long || obj instanceof Integer || obj instanceof Byte || obj instanceof Short)
return GMet... | java | private static GMetricType getType(final Object obj) {
// FIXME This is far from covering all cases.
// FIXME Wasteful use of high capacity types (eg Short => INT32)
// Direct mapping when possible
if (obj instanceof Long || obj instanceof Integer || obj instanceof Byte || obj instanceof Short)
return GMet... | [
"private",
"static",
"GMetricType",
"getType",
"(",
"final",
"Object",
"obj",
")",
"{",
"// FIXME This is far from covering all cases.",
"// FIXME Wasteful use of high capacity types (eg Short => INT32)",
"// Direct mapping when possible",
"if",
"(",
"obj",
"instanceof",
"Long",
... | Guess the Ganglia gmetric type to use for a given object.
@param obj the object to inspect
@return an appropriate {@link GMetricType}, {@link GMetricType#STRING} by default | [
"Guess",
"the",
"Ganglia",
"gmetric",
"type",
"to",
"use",
"for",
"a",
"given",
"object",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-ganglia/src/main/java/com/googlecode/jmxtrans/model/output/GangliaWriter.java#L254-L282 |
64,974 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java | Settings.getBooleanSetting | public static Boolean getBooleanSetting(Map<String, Object> settings, String key, Boolean defaultVal) {
final Object value = settings.get(key);
if (value == null) {
return defaultVal;
}
if (value instanceof Boolean) {
return (Boolean) value;
}
if (value instanceof String) {
return Boolean.valueOf(... | java | public static Boolean getBooleanSetting(Map<String, Object> settings, String key, Boolean defaultVal) {
final Object value = settings.get(key);
if (value == null) {
return defaultVal;
}
if (value instanceof Boolean) {
return (Boolean) value;
}
if (value instanceof String) {
return Boolean.valueOf(... | [
"public",
"static",
"Boolean",
"getBooleanSetting",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"settings",
",",
"String",
"key",
",",
"Boolean",
"defaultVal",
")",
"{",
"final",
"Object",
"value",
"=",
"settings",
".",
"get",
"(",
"key",
")",
";",
"i... | Gets a Boolean value for the key, returning the default value given if
not specified or not a valid boolean value.
@param settings
@param key the key to get the boolean setting for
@param defaultVal the default value to return if the setting was not specified
or was not coercible to a Boolean value
@return the... | [
"Gets",
"a",
"Boolean",
"value",
"for",
"the",
"key",
"returning",
"the",
"default",
"value",
"given",
"if",
"not",
"specified",
"or",
"not",
"a",
"valid",
"boolean",
"value",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java#L62-L75 |
64,975 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java | Settings.getIntegerSetting | public static Integer getIntegerSetting(Map<String, Object> settings, String key, Integer defaultVal) {
final Object value = settings.get(key);
if (value == null) {
return defaultVal;
}
if (value instanceof Number) {
return ((Number) value).intValue();
}
if (value instanceof String) {
try {
re... | java | public static Integer getIntegerSetting(Map<String, Object> settings, String key, Integer defaultVal) {
final Object value = settings.get(key);
if (value == null) {
return defaultVal;
}
if (value instanceof Number) {
return ((Number) value).intValue();
}
if (value instanceof String) {
try {
re... | [
"public",
"static",
"Integer",
"getIntegerSetting",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"settings",
",",
"String",
"key",
",",
"Integer",
"defaultVal",
")",
"{",
"final",
"Object",
"value",
"=",
"settings",
".",
"get",
"(",
"key",
")",
";",
"i... | Gets an Integer value for the key, returning the default value given if
not specified or not a valid numeric value.
@param settings
@param key the key to get the Integer setting for
@param defaultVal the default value to return if the setting was not specified
or was not coercible to an Integer value
@return t... | [
"Gets",
"an",
"Integer",
"value",
"for",
"the",
"key",
"returning",
"the",
"default",
"value",
"given",
"if",
"not",
"specified",
"or",
"not",
"a",
"valid",
"numeric",
"value",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java#L88-L105 |
64,976 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java | Settings.getStringSetting | public static String getStringSetting(Map<String, Object> settings, String key, String defaultVal) {
final Object value = settings.get(key);
return value != null ? value.toString() : defaultVal;
} | java | public static String getStringSetting(Map<String, Object> settings, String key, String defaultVal) {
final Object value = settings.get(key);
return value != null ? value.toString() : defaultVal;
} | [
"public",
"static",
"String",
"getStringSetting",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"settings",
",",
"String",
"key",
",",
"String",
"defaultVal",
")",
"{",
"final",
"Object",
"value",
"=",
"settings",
".",
"get",
"(",
"key",
")",
";",
"retu... | Gets a String value for the setting, returning the default value if not
specified.
@param settings
@param key the key to get the String setting for
@param defaultVal the default value to return if the setting was not specified
@return the String value for the setting | [
"Gets",
"a",
"String",
"value",
"for",
"the",
"setting",
"returning",
"the",
"default",
"value",
"if",
"not",
"specified",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java#L117-L120 |
64,977 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java | Settings.getIntSetting | protected static int getIntSetting(Map<String, Object> settings, String key, int defaultVal) throws IllegalArgumentException {
if (settings.containsKey(key)) {
final Object objectValue = settings.get(key);
if (objectValue == null) {
throw new IllegalArgumentException("Setting '" + key + " null");
}
fi... | java | protected static int getIntSetting(Map<String, Object> settings, String key, int defaultVal) throws IllegalArgumentException {
if (settings.containsKey(key)) {
final Object objectValue = settings.get(key);
if (objectValue == null) {
throw new IllegalArgumentException("Setting '" + key + " null");
}
fi... | [
"protected",
"static",
"int",
"getIntSetting",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"settings",
",",
"String",
"key",
",",
"int",
"defaultVal",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"settings",
".",
"containsKey",
"(",
"key",
"... | Gets an int value for the setting, returning the default value if not
specified.
@param settings
@param key the key to get the int value for
@param defaultVal default value if the setting was not specified
@return the int value for the setting
@throws IllegalArgumentException if setting does not contain an int | [
"Gets",
"an",
"int",
"value",
"for",
"the",
"setting",
"returning",
"the",
"default",
"value",
"if",
"not",
"specified",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java#L133-L148 |
64,978 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-velocity/src/main/java/com/googlecode/jmxtrans/model/output/VelocityWriter.java | VelocityWriter.getVelocityEngine | protected VelocityEngine getVelocityEngine(List<String> paths) {
VelocityEngine ve = new VelocityEngine();
ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "file");
ve.setProperty("cp.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
ve.setProperty("cp.resource.loader.ca... | java | protected VelocityEngine getVelocityEngine(List<String> paths) {
VelocityEngine ve = new VelocityEngine();
ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "file");
ve.setProperty("cp.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
ve.setProperty("cp.resource.loader.ca... | [
"protected",
"VelocityEngine",
"getVelocityEngine",
"(",
"List",
"<",
"String",
">",
"paths",
")",
"{",
"VelocityEngine",
"ve",
"=",
"new",
"VelocityEngine",
"(",
")",
";",
"ve",
".",
"setProperty",
"(",
"RuntimeConstants",
".",
"RESOURCE_LOADER",
",",
"\"file\"... | Sets velocity up to load resources from a list of paths. | [
"Sets",
"velocity",
"up",
"to",
"load",
"resources",
"from",
"a",
"list",
"of",
"paths",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-velocity/src/main/java/com/googlecode/jmxtrans/model/output/VelocityWriter.java#L89-L100 |
64,979 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/util/ProcessConfigUtils.java | ProcessConfigUtils.parseProcess | public JmxProcess parseProcess(File file) throws IOException {
String fileName = file.getName();
ObjectMapper mapper = fileName.endsWith(".yml") || fileName.endsWith(".yaml") ? yamlMapper : jsonMapper;
JsonNode jsonNode = mapper.readTree(file);
JmxProcess jmx = mapper.treeToValue(jsonNode, JmxProcess.class);
... | java | public JmxProcess parseProcess(File file) throws IOException {
String fileName = file.getName();
ObjectMapper mapper = fileName.endsWith(".yml") || fileName.endsWith(".yaml") ? yamlMapper : jsonMapper;
JsonNode jsonNode = mapper.readTree(file);
JmxProcess jmx = mapper.treeToValue(jsonNode, JmxProcess.class);
... | [
"public",
"JmxProcess",
"parseProcess",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"String",
"fileName",
"=",
"file",
".",
"getName",
"(",
")",
";",
"ObjectMapper",
"mapper",
"=",
"fileName",
".",
"endsWith",
"(",
"\".yml\"",
")",
"||",
"fileNam... | Uses jackson to load json configuration from a File into a full object
tree representation of that json. | [
"Uses",
"jackson",
"to",
"load",
"json",
"configuration",
"from",
"a",
"File",
"into",
"a",
"full",
"object",
"tree",
"representation",
"of",
"that",
"json",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/util/ProcessConfigUtils.java#L59-L66 |
64,980 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/support/opentsdb/OpenTSDBMessageFormatter.java | OpenTSDBMessageFormatter.addTags | void addTags(StringBuilder resultString, Server server) {
if (hostnameTag) {
addTag(resultString, "host", server.getLabel());
}
// Add the constant tag names and values.
for (Map.Entry<String, String> tagEntry : tags.entrySet()) {
addTag(resultString, tagEntry.getKey(), tagEntry.getValue());
}
} | java | void addTags(StringBuilder resultString, Server server) {
if (hostnameTag) {
addTag(resultString, "host", server.getLabel());
}
// Add the constant tag names and values.
for (Map.Entry<String, String> tagEntry : tags.entrySet()) {
addTag(resultString, tagEntry.getKey(), tagEntry.getValue());
}
} | [
"void",
"addTags",
"(",
"StringBuilder",
"resultString",
",",
"Server",
"server",
")",
"{",
"if",
"(",
"hostnameTag",
")",
"{",
"addTag",
"(",
"resultString",
",",
"\"host\"",
",",
"server",
".",
"getLabel",
"(",
")",
")",
";",
"}",
"// Add the constant tag ... | Add tags to the given result string, including a "host" tag with the name of the server and all of the tags
defined in the "settings" entry in the configuration file within the "tag" element.
@param resultString - the string containing the metric name, timestamp, value, and possibly other content. | [
"Add",
"tags",
"to",
"the",
"given",
"result",
"string",
"including",
"a",
"host",
"tag",
"with",
"the",
"name",
"of",
"the",
"server",
"and",
"all",
"of",
"the",
"tags",
"defined",
"in",
"the",
"settings",
"entry",
"in",
"the",
"configuration",
"file",
... | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/support/opentsdb/OpenTSDBMessageFormatter.java#L102-L111 |
64,981 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/support/opentsdb/OpenTSDBMessageFormatter.java | OpenTSDBMessageFormatter.addTag | void addTag(StringBuilder resultString, String tagName, String tagValue) {
resultString.append(" ");
resultString.append(sanitizeString(tagName));
resultString.append("=");
resultString.append(sanitizeString(tagValue));
} | java | void addTag(StringBuilder resultString, String tagName, String tagValue) {
resultString.append(" ");
resultString.append(sanitizeString(tagName));
resultString.append("=");
resultString.append(sanitizeString(tagValue));
} | [
"void",
"addTag",
"(",
"StringBuilder",
"resultString",
",",
"String",
"tagName",
",",
"String",
"tagValue",
")",
"{",
"resultString",
".",
"append",
"(",
"\" \"",
")",
";",
"resultString",
".",
"append",
"(",
"sanitizeString",
"(",
"tagName",
")",
")",
";",... | Add one tag, with the provided name and value, to the given result string.
@param resultString - the string containing the metric name, timestamp, value, and possibly other content.
@return String - the new result string with the tag appended. | [
"Add",
"one",
"tag",
"with",
"the",
"provided",
"name",
"and",
"value",
"to",
"the",
"given",
"result",
"string",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/support/opentsdb/OpenTSDBMessageFormatter.java#L119-L124 |
64,982 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/support/opentsdb/OpenTSDBMessageFormatter.java | OpenTSDBMessageFormatter.formatResultString | private void formatResultString(StringBuilder resultString, String metricName, long epoch, Object value) {
resultString.append(sanitizeString(metricName));
resultString.append(" ");
resultString.append(Long.toString(epoch));
resultString.append(" ");
resultString.append(sanitizeString(value.toString()));
} | java | private void formatResultString(StringBuilder resultString, String metricName, long epoch, Object value) {
resultString.append(sanitizeString(metricName));
resultString.append(" ");
resultString.append(Long.toString(epoch));
resultString.append(" ");
resultString.append(sanitizeString(value.toString()));
} | [
"private",
"void",
"formatResultString",
"(",
"StringBuilder",
"resultString",
",",
"String",
"metricName",
",",
"long",
"epoch",
",",
"Object",
"value",
")",
"{",
"resultString",
".",
"append",
"(",
"sanitizeString",
"(",
"metricName",
")",
")",
";",
"resultStr... | Format the result string given the class name and attribute name of the source value, the timestamp, and the
value.
@param epoch - the timestamp of the metric.
@param value - value of the attribute to use as the metric value.
@return String - the formatted result string. | [
"Format",
"the",
"result",
"string",
"given",
"the",
"class",
"name",
"and",
"attribute",
"name",
"of",
"the",
"source",
"value",
"the",
"timestamp",
"and",
"the",
"value",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/support/opentsdb/OpenTSDBMessageFormatter.java#L134-L140 |
64,983 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/support/opentsdb/OpenTSDBMessageFormatter.java | OpenTSDBMessageFormatter.processOneMetric | protected void processOneMetric(List<String> resultStrings, Server server, Result result, Object value, String addTagName,
String addTagValue) {
String metricName = this.metricNameStrategy.formatName(result);
//
// Skip any non-numeric values since OpenTSDB only supports numeric metrics.
//
if (isNu... | java | protected void processOneMetric(List<String> resultStrings, Server server, Result result, Object value, String addTagName,
String addTagValue) {
String metricName = this.metricNameStrategy.formatName(result);
//
// Skip any non-numeric values since OpenTSDB only supports numeric metrics.
//
if (isNu... | [
"protected",
"void",
"processOneMetric",
"(",
"List",
"<",
"String",
">",
"resultStrings",
",",
"Server",
"server",
",",
"Result",
"result",
",",
"Object",
"value",
",",
"String",
"addTagName",
",",
"String",
"addTagValue",
")",
"{",
"String",
"metricName",
"=... | Process a single metric from the given JMX query result with the specified value. | [
"Process",
"a",
"single",
"metric",
"from",
"the",
"given",
"JMX",
"query",
"result",
"with",
"the",
"specified",
"value",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/support/opentsdb/OpenTSDBMessageFormatter.java#L180-L205 |
64,984 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/StackdriverWriter.java | StackdriverWriter.getGatewayMessage | private String getGatewayMessage(final List<Result> results) throws IOException {
int valueCount = 0;
Writer writer = new StringWriter();
JsonGenerator g = jsonFactory.createGenerator(writer);
g.writeStartObject();
g.writeNumberField("timestamp", System.currentTimeMillis() / 1000);
g.writeNumberField("proto... | java | private String getGatewayMessage(final List<Result> results) throws IOException {
int valueCount = 0;
Writer writer = new StringWriter();
JsonGenerator g = jsonFactory.createGenerator(writer);
g.writeStartObject();
g.writeNumberField("timestamp", System.currentTimeMillis() / 1000);
g.writeNumberField("proto... | [
"private",
"String",
"getGatewayMessage",
"(",
"final",
"List",
"<",
"Result",
">",
"results",
")",
"throws",
"IOException",
"{",
"int",
"valueCount",
"=",
"0",
";",
"Writer",
"writer",
"=",
"new",
"StringWriter",
"(",
")",
";",
"JsonGenerator",
"g",
"=",
... | Take query results, make a JSON String
@param results List of Result objects
@return a String containing a JSON message, or null if there are no values to report
@throws IOException if there is some problem generating the JSON, should be uncommon | [
"Take",
"query",
"results",
"make",
"a",
"JSON",
"String"
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/StackdriverWriter.java#L279-L360 |
64,985 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/StackdriverWriter.java | StackdriverWriter.doSend | private void doSend(final String gatewayMessage) {
HttpURLConnection urlConnection = null;
try {
if (proxy == null) {
urlConnection = (HttpURLConnection) gatewayUrl.openConnection();
} else {
urlConnection = (HttpURLConnection) gatewayUrl.openConnection(proxy);
}
urlConnection.setRequestMethod(... | java | private void doSend(final String gatewayMessage) {
HttpURLConnection urlConnection = null;
try {
if (proxy == null) {
urlConnection = (HttpURLConnection) gatewayUrl.openConnection();
} else {
urlConnection = (HttpURLConnection) gatewayUrl.openConnection(proxy);
}
urlConnection.setRequestMethod(... | [
"private",
"void",
"doSend",
"(",
"final",
"String",
"gatewayMessage",
")",
"{",
"HttpURLConnection",
"urlConnection",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"proxy",
"==",
"null",
")",
"{",
"urlConnection",
"=",
"(",
"HttpURLConnection",
")",
"gatewayUrl",
... | Post the formatted results to the gateway URL over HTTP
@param gatewayMessage String in the Stackdriver custom metrics JSON format containing the data points | [
"Post",
"the",
"formatted",
"results",
"to",
"the",
"gateway",
"URL",
"over",
"HTTP"
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/StackdriverWriter.java#L367-L413 |
64,986 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java | JmxTransformer.doMain | private void doMain() throws Exception {
// Start the process
this.start();
while (true) {
// look for some terminator
// attempt to read off queue
// process message
// TODO : Make something here, maybe watch for files?
try {
Thread.sleep(5);
} catch (Exception e) {
log.info("shutting ... | java | private void doMain() throws Exception {
// Start the process
this.start();
while (true) {
// look for some terminator
// attempt to read off queue
// process message
// TODO : Make something here, maybe watch for files?
try {
Thread.sleep(5);
} catch (Exception e) {
log.info("shutting ... | [
"private",
"void",
"doMain",
"(",
")",
"throws",
"Exception",
"{",
"// Start the process",
"this",
".",
"start",
"(",
")",
";",
"while",
"(",
"true",
")",
"{",
"// look for some terminator",
"// attempt to read off queue",
"// process message",
"// TODO : Make something... | The real main method. | [
"The",
"real",
"main",
"method",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java#L156-L174 |
64,987 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java | JmxTransformer.stopWriterAndClearMasterServerList | private void stopWriterAndClearMasterServerList() {
for (Server server : this.masterServersList) {
for (OutputWriter writer : server.getOutputWriters()) {
try {
writer.close();
} catch (LifecycleException ex) {
log.error("Eror stopping writer: {}", writer);
}
}
for (Query query : server... | java | private void stopWriterAndClearMasterServerList() {
for (Server server : this.masterServersList) {
for (OutputWriter writer : server.getOutputWriters()) {
try {
writer.close();
} catch (LifecycleException ex) {
log.error("Eror stopping writer: {}", writer);
}
}
for (Query query : server... | [
"private",
"void",
"stopWriterAndClearMasterServerList",
"(",
")",
"{",
"for",
"(",
"Server",
"server",
":",
"this",
".",
"masterServersList",
")",
"{",
"for",
"(",
"OutputWriter",
"writer",
":",
"server",
".",
"getOutputWriters",
"(",
")",
")",
"{",
"try",
... | Shut down the output writers and clear the master server list
Used both during shutdown and when re-reading config files | [
"Shut",
"down",
"the",
"output",
"writers",
"and",
"clear",
"the",
"master",
"server",
"list",
"Used",
"both",
"during",
"shutdown",
"and",
"when",
"re",
"-",
"reading",
"config",
"files"
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java#L252-L273 |
64,988 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java | JmxTransformer.startupWatchdir | private void startupWatchdir() throws Exception {
File dirToWatch;
if (this.configuration.getProcessConfigDirOrFile().isFile()) {
dirToWatch = new File(FilenameUtils.getFullPath(this.configuration.getProcessConfigDirOrFile().getAbsolutePath()));
} else {
dirToWatch = this.configuration.getProcessConfigDirOr... | java | private void startupWatchdir() throws Exception {
File dirToWatch;
if (this.configuration.getProcessConfigDirOrFile().isFile()) {
dirToWatch = new File(FilenameUtils.getFullPath(this.configuration.getProcessConfigDirOrFile().getAbsolutePath()));
} else {
dirToWatch = this.configuration.getProcessConfigDirOr... | [
"private",
"void",
"startupWatchdir",
"(",
")",
"throws",
"Exception",
"{",
"File",
"dirToWatch",
";",
"if",
"(",
"this",
".",
"configuration",
".",
"getProcessConfigDirOrFile",
"(",
")",
".",
"isFile",
"(",
")",
")",
"{",
"dirToWatch",
"=",
"new",
"File",
... | Startup the watchdir service. | [
"Startup",
"the",
"watchdir",
"service",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java#L278-L289 |
64,989 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java | JmxTransformer.executeStandalone | public void executeStandalone(JmxProcess process) throws Exception {
this.masterServersList = process.getServers();
this.serverScheduler.start();
this.processServersIntoJobs();
// Sleep for 10 seconds to wait for jobs to complete.
// There should be a better way, but it seems that way isn't working
// ri... | java | public void executeStandalone(JmxProcess process) throws Exception {
this.masterServersList = process.getServers();
this.serverScheduler.start();
this.processServersIntoJobs();
// Sleep for 10 seconds to wait for jobs to complete.
// There should be a better way, but it seems that way isn't working
// ri... | [
"public",
"void",
"executeStandalone",
"(",
"JmxProcess",
"process",
")",
"throws",
"Exception",
"{",
"this",
".",
"masterServersList",
"=",
"process",
".",
"getServers",
"(",
")",
";",
"this",
".",
"serverScheduler",
".",
"start",
"(",
")",
";",
"this",
"."... | Handy method which runs the JmxProcess | [
"Handy",
"method",
"which",
"runs",
"the",
"JmxProcess"
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java#L294-L305 |
64,990 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java | JmxTransformer.processFilesIntoServers | private void processFilesIntoServers() throws LifecycleException {
// Shutdown the outputwriters and clear the current server list - this gives us a clean
// start when re-reading the json config files
try {
this.stopWriterAndClearMasterServerList();
} catch (Exception e) {
log.error("Error while clearing... | java | private void processFilesIntoServers() throws LifecycleException {
// Shutdown the outputwriters and clear the current server list - this gives us a clean
// start when re-reading the json config files
try {
this.stopWriterAndClearMasterServerList();
} catch (Exception e) {
log.error("Error while clearing... | [
"private",
"void",
"processFilesIntoServers",
"(",
")",
"throws",
"LifecycleException",
"{",
"// Shutdown the outputwriters and clear the current server list - this gives us a clean",
"// start when re-reading the json config files",
"try",
"{",
"this",
".",
"stopWriterAndClearMasterServ... | Processes all the json files and manages the dedup process | [
"Processes",
"all",
"the",
"json",
"files",
"and",
"manages",
"the",
"dedup",
"process"
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java#L344-L355 |
64,991 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java | JmxTransformer.isProcessConfigFile | private boolean isProcessConfigFile(File file) {
if (this.configuration.getProcessConfigDirOrFile().isFile()) {
return file.equals(this.configuration.getProcessConfigDirOrFile());
}
// If the file doesn't exist anymore, treat it as a regular file (to handle file deletion events)
if(file.exists() && !file.is... | java | private boolean isProcessConfigFile(File file) {
if (this.configuration.getProcessConfigDirOrFile().isFile()) {
return file.equals(this.configuration.getProcessConfigDirOrFile());
}
// If the file doesn't exist anymore, treat it as a regular file (to handle file deletion events)
if(file.exists() && !file.is... | [
"private",
"boolean",
"isProcessConfigFile",
"(",
"File",
"file",
")",
"{",
"if",
"(",
"this",
".",
"configuration",
".",
"getProcessConfigDirOrFile",
"(",
")",
".",
"isFile",
"(",
")",
")",
"{",
"return",
"file",
".",
"equals",
"(",
"this",
".",
"configur... | Are we a file and a JSON or YAML file? | [
"Are",
"we",
"a",
"file",
"and",
"a",
"JSON",
"or",
"YAML",
"file?"
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/JmxTransformer.java#L460-L472 |
64,992 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/Server.java | Server.getServerConnection | @Override
@JsonIgnore
public JMXConnector getServerConnection() throws IOException {
JMXServiceURL url = getJmxServiceURL();
return JMXConnectorFactory.connect(url, this.getEnvironment());
} | java | @Override
@JsonIgnore
public JMXConnector getServerConnection() throws IOException {
JMXServiceURL url = getJmxServiceURL();
return JMXConnectorFactory.connect(url, this.getEnvironment());
} | [
"@",
"Override",
"@",
"JsonIgnore",
"public",
"JMXConnector",
"getServerConnection",
"(",
")",
"throws",
"IOException",
"{",
"JMXServiceURL",
"url",
"=",
"getJmxServiceURL",
"(",
")",
";",
"return",
"JMXConnectorFactory",
".",
"connect",
"(",
"url",
",",
"this",
... | Helper method for connecting to a Server. You need to close the resulting
connection. | [
"Helper",
"method",
"for",
"connecting",
"to",
"a",
"Server",
".",
"You",
"need",
"to",
"close",
"the",
"resulting",
"connection",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/Server.java#L343-L348 |
64,993 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-logback/src/main/java/com/googlecode/jmxtrans/model/output/KeyOutWriter.java | KeyOutWriter.validateSetup | @Override
public void validateSetup(Server server, Query query) throws ValidationException {
// Check if we've already created a logger for this file. If so, use it.
Logger logger;
if (loggers.containsKey(outputFile)) {
logger = getLogger(outputFile);
}else{
// need to create a logger
try {
logger... | java | @Override
public void validateSetup(Server server, Query query) throws ValidationException {
// Check if we've already created a logger for this file. If so, use it.
Logger logger;
if (loggers.containsKey(outputFile)) {
logger = getLogger(outputFile);
}else{
// need to create a logger
try {
logger... | [
"@",
"Override",
"public",
"void",
"validateSetup",
"(",
"Server",
"server",
",",
"Query",
"query",
")",
"throws",
"ValidationException",
"{",
"// Check if we've already created a logger for this file. If so, use it.",
"Logger",
"logger",
";",
"if",
"(",
"loggers",
".",
... | Creates the logging | [
"Creates",
"the",
"logging"
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-logback/src/main/java/com/googlecode/jmxtrans/model/output/KeyOutWriter.java#L129-L145 |
64,994 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-logback/src/main/java/com/googlecode/jmxtrans/model/output/KeyOutWriter.java | KeyOutWriter.internalWrite | @Override
public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {
graphiteWriter.write(logwriter, server, query, results);
} | java | @Override
public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {
graphiteWriter.write(logwriter, server, query, results);
} | [
"@",
"Override",
"public",
"void",
"internalWrite",
"(",
"Server",
"server",
",",
"Query",
"query",
",",
"ImmutableList",
"<",
"Result",
">",
"results",
")",
"throws",
"Exception",
"{",
"graphiteWriter",
".",
"write",
"(",
"logwriter",
",",
"server",
",",
"q... | The meat of the output. Reuses the GraphiteWriter2 class but writes in a logfile
instead of a network socket. | [
"The",
"meat",
"of",
"the",
"output",
".",
"Reuses",
"the",
"GraphiteWriter2",
"class",
"but",
"writes",
"in",
"a",
"logfile",
"instead",
"of",
"a",
"network",
"socket",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-logback/src/main/java/com/googlecode/jmxtrans/model/output/KeyOutWriter.java#L193-L196 |
64,995 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-cloudwatch/src/main/java/com/googlecode/jmxtrans/model/output/CloudWatchWriter.java | CloudWatchWriter.createCloudWatchClient | private AmazonCloudWatchClient createCloudWatchClient() {
AmazonCloudWatchClient cloudWatchClient = new AmazonCloudWatchClient(new InstanceProfileCredentialsProvider());
cloudWatchClient.setRegion(checkNotNull(Regions.getCurrentRegion(), "Problems getting AWS metadata"));
return cloudWatchClient;
} | java | private AmazonCloudWatchClient createCloudWatchClient() {
AmazonCloudWatchClient cloudWatchClient = new AmazonCloudWatchClient(new InstanceProfileCredentialsProvider());
cloudWatchClient.setRegion(checkNotNull(Regions.getCurrentRegion(), "Problems getting AWS metadata"));
return cloudWatchClient;
} | [
"private",
"AmazonCloudWatchClient",
"createCloudWatchClient",
"(",
")",
"{",
"AmazonCloudWatchClient",
"cloudWatchClient",
"=",
"new",
"AmazonCloudWatchClient",
"(",
"new",
"InstanceProfileCredentialsProvider",
"(",
")",
")",
";",
"cloudWatchClient",
".",
"setRegion",
"(",... | Configuring the CloudWatch client.
Credentials are loaded from the Amazon EC2 Instance Metadata Service | [
"Configuring",
"the",
"CloudWatch",
"client",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-cloudwatch/src/main/java/com/googlecode/jmxtrans/model/output/CloudWatchWriter.java#L96-L100 |
64,996 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/JexlNamingStrategy.java | JexlNamingStrategy.formatName | @Override
public String formatName(Result result) {
String formatted;
JexlContext context = new MapContext();
this.populateContext(context, result);
try {
formatted = (String) this.parsedExpr.evaluate(context);
} catch (JexlException jexlExc) {
LOG.error("error applying JEXL expression to query result... | java | @Override
public String formatName(Result result) {
String formatted;
JexlContext context = new MapContext();
this.populateContext(context, result);
try {
formatted = (String) this.parsedExpr.evaluate(context);
} catch (JexlException jexlExc) {
LOG.error("error applying JEXL expression to query result... | [
"@",
"Override",
"public",
"String",
"formatName",
"(",
"Result",
"result",
")",
"{",
"String",
"formatted",
";",
"JexlContext",
"context",
"=",
"new",
"MapContext",
"(",
")",
";",
"this",
".",
"populateContext",
"(",
"context",
",",
"result",
")",
";",
"t... | Format the name for the given result.
@param result - the result of a JMX query.
@return String - the formatted string resulting from the expression, or null if the formatting fails. | [
"Format",
"the",
"name",
"for",
"the",
"given",
"result",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/JexlNamingStrategy.java#L100-L114 |
64,997 | jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/JexlNamingStrategy.java | JexlNamingStrategy.populateContext | protected void populateContext(JexlContext context, Result result) {
context.set(VAR_CLASSNAME, result.getClassName());
context.set(VAR_ATTRIBUTE_NAME, result.getAttributeName());
context.set(VAR_CLASSNAME_ALIAS, result.getKeyAlias());
Map<String, String> typeNameMap = TypeNameValue.extractMap(result.getTypeNa... | java | protected void populateContext(JexlContext context, Result result) {
context.set(VAR_CLASSNAME, result.getClassName());
context.set(VAR_ATTRIBUTE_NAME, result.getAttributeName());
context.set(VAR_CLASSNAME_ALIAS, result.getKeyAlias());
Map<String, String> typeNameMap = TypeNameValue.extractMap(result.getTypeNa... | [
"protected",
"void",
"populateContext",
"(",
"JexlContext",
"context",
",",
"Result",
"result",
")",
"{",
"context",
".",
"set",
"(",
"VAR_CLASSNAME",
",",
"result",
".",
"getClassName",
"(",
")",
")",
";",
"context",
".",
"set",
"(",
"VAR_ATTRIBUTE_NAME",
"... | Populate the context with values from the result.
@param context - the expression context used when evaluating JEXL expressions.
@param result - the result of a JMX query. | [
"Populate",
"the",
"context",
"with",
"values",
"from",
"the",
"result",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/JexlNamingStrategy.java#L126-L141 |
64,998 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-jrobin/src/main/java/com/googlecode/jmxtrans/model/output/RRDToolWriter.java | RRDToolWriter.getDataSourceName | public String getDataSourceName(String typeName, String attributeName, List<String> valuePath) {
String result;
String entry = StringUtils.join(valuePath, '.');
if (typeName != null) {
result = typeName + attributeName + entry;
} else {
result = attributeName + entry;
}
if (attributeName.length() > 1... | java | public String getDataSourceName(String typeName, String attributeName, List<String> valuePath) {
String result;
String entry = StringUtils.join(valuePath, '.');
if (typeName != null) {
result = typeName + attributeName + entry;
} else {
result = attributeName + entry;
}
if (attributeName.length() > 1... | [
"public",
"String",
"getDataSourceName",
"(",
"String",
"typeName",
",",
"String",
"attributeName",
",",
"List",
"<",
"String",
">",
"valuePath",
")",
"{",
"String",
"result",
";",
"String",
"entry",
"=",
"StringUtils",
".",
"join",
"(",
"valuePath",
",",
"'... | rrd datasources must be less than 21 characters in length, so work to
make it shorter. Not ideal at all, but works fairly well it seems. | [
"rrd",
"datasources",
"must",
"be",
"less",
"than",
"21",
"characters",
"in",
"length",
"so",
"work",
"to",
"make",
"it",
"shorter",
".",
"Not",
"ideal",
"at",
"all",
"but",
"works",
"fairly",
"well",
"it",
"seems",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-jrobin/src/main/java/com/googlecode/jmxtrans/model/output/RRDToolWriter.java#L108-L127 |
64,999 | jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-jrobin/src/main/java/com/googlecode/jmxtrans/model/output/RRDToolWriter.java | RRDToolWriter.rrdToolUpdate | protected void rrdToolUpdate(String template, String data) throws Exception {
List<String> commands = new ArrayList<>();
commands.add(binaryPath + "/rrdtool");
commands.add("update");
commands.add(outputFile.getCanonicalPath());
commands.add("-t");
commands.add(template);
commands.add("N:" + data);
Pro... | java | protected void rrdToolUpdate(String template, String data) throws Exception {
List<String> commands = new ArrayList<>();
commands.add(binaryPath + "/rrdtool");
commands.add("update");
commands.add(outputFile.getCanonicalPath());
commands.add("-t");
commands.add(template);
commands.add("N:" + data);
Pro... | [
"protected",
"void",
"rrdToolUpdate",
"(",
"String",
"template",
",",
"String",
"data",
")",
"throws",
"Exception",
"{",
"List",
"<",
"String",
">",
"commands",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"commands",
".",
"add",
"(",
"binaryPath",
"+",
... | Executes the rrdtool update command. | [
"Executes",
"the",
"rrdtool",
"update",
"command",
"."
] | 496f342de3bcf2c2226626374b7a16edf8f4ba2a | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-jrobin/src/main/java/com/googlecode/jmxtrans/model/output/RRDToolWriter.java#L187-L199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.