-
Notifications
You must be signed in to change notification settings - Fork 14
ARTEMIS-5427 integrate Jolokia's MBeanInfo cache #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| Licensed to the Apache Software Foundation (ASF) under one or more | ||
| contributor license agreements. See the NOTICE file distributed with | ||
| this work for additional information regarding copyright ownership. | ||
| The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| (the "License"); you may not use this file except in compliance with | ||
| the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>org.apache.activemq</groupId> | ||
| <artifactId>artemis-console-project</artifactId> | ||
| <version>1.3.0-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <groupId>org.apache.activemq</groupId> | ||
| <artifactId>artemis-console-cache-key-provider</artifactId> | ||
| <packaging>jar</packaging> | ||
|
|
||
|
|
||
| <name>ActiveMQ Artemis Console Cache Key Provider</name> | ||
|
|
||
| <properties> | ||
| <activemq.basedir>${project.parent.basedir}</activemq.basedir> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.jolokia</groupId> | ||
| <artifactId>jolokia-service-jmx</artifactId> | ||
| <version>${jolokia.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.activemq</groupId> | ||
| <artifactId>artemis-server</artifactId> | ||
| <version>${activemq.artemis.version}</version> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| </project> |
41 changes: 41 additions & 0 deletions
41
...y-provider/src/main/java/org/apache/activemq/artemis/jolokia/ArtemisCacheKeyProvider.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.activemq.artemis.jolokia; | ||
|
|
||
| import javax.management.ObjectInstance; | ||
|
|
||
| import org.jolokia.service.jmx.api.CacheKeyProvider; | ||
|
|
||
| public class ArtemisCacheKeyProvider extends CacheKeyProvider { | ||
|
|
||
| public ArtemisCacheKeyProvider(int pOrderId) { | ||
| super(pOrderId); | ||
| } | ||
|
|
||
| @Override | ||
| public String determineKey(ObjectInstance objectInstance) { | ||
| try { | ||
| if (Class.forName("org.apache.activemq.artemis.core.management.impl.AbstractControl").isAssignableFrom(Class.forName(objectInstance.getClassName()))) { | ||
| return objectInstance.getClassName(); | ||
| } | ||
| } catch (Exception e) { | ||
| // ignore | ||
| } | ||
|
|
||
| return null; | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
artemis-console-cache-key-provider/src/main/resources/META-INF/jolokia/services-default
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| org.apache.activemq.artemis.jolokia.ArtemisCacheKeyProvider,100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| <?xml version="1.0"?> | ||
|
|
||
| <!-- | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| --> | ||
|
|
||
| <!DOCTYPE module PUBLIC | ||
| "-//Puppy Crawl//DTD Check Configuration 1.3//EN" | ||
| "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> | ||
|
|
||
| <!-- See http://checkstyle.sourceforge.net/checks.html for documentation on available checks --> | ||
| <module name="Checker"> | ||
| <!-- Checks to see if a file contains a tab character. --> | ||
| <module name="FileTabCharacter"> | ||
| <property name="eachLine" value="true"/> | ||
| </module> | ||
|
|
||
| <!-- Checks for trailing whitespace. --> | ||
| <module name="RegexpSingleline"> | ||
| <!-- \s matches whitespace character, $ matches end of line. --> | ||
| <property name="format" value="\s+$"/> | ||
| <property name="message" value="Line has trailing spaces."/> | ||
| </module> | ||
|
|
||
| <module name="TreeWalker"> | ||
| <module name="AtclauseOrder"/> | ||
| <module name="NonEmptyAtclauseDescription"/> | ||
| <module name="SingleLineJavadoc"> | ||
| <property name="ignoreInlineTags" value="false"/> | ||
| </module> | ||
| <module name="InvalidJavadocPosition"/> | ||
| <module name="JavadocBlockTagLocation"/> | ||
| <module name="JavadocContentLocation"/> | ||
| <module name="JavadocLeadingAsteriskAlign" /> | ||
| <module name="JavadocMissingLeadingAsterisk"/> | ||
| <module name="JavadocMissingWhitespaceAfterAsterisk"/> | ||
|
|
||
| <!-- Checks for imports --> | ||
| <module name="AvoidStarImport"/> | ||
| <module name="RedundantImport"/> | ||
| <module name="UnusedImports"/> | ||
|
|
||
| <!-- Modifier Checks --> | ||
| <module name="ModifierOrder"/> | ||
| <module name="RedundantModifier"/> | ||
|
|
||
| <!-- Checks for common coding problems --> | ||
| <module name="EmptyStatement"/> | ||
| <!-- Checks that classes that override equals() also override hashCode(). --> | ||
| <module name="EqualsHashCode"/> | ||
| <!-- Checks for illegal instantiations where a factory method is preferred. --> | ||
| <module name="IllegalInstantiation"/> | ||
|
|
||
| <!-- Checks that long constants are defined with an upper ell. --> | ||
| <module name="UpperEll"/> | ||
| <!-- This check makes sure that all package annotations are in the package-info.java file. --> | ||
| <module name="PackageAnnotation"/> | ||
| <!-- Checks that if a class defines a covariant method equals, then it defines method equals(java.lang.Object). --> | ||
| <module name="CovariantEquals"/> | ||
| <!-- Checks the style of array type definitions. --> | ||
| <module name="ArrayTypeStyle"/> | ||
| <!-- Make sure left curly braces are on the same line. --> | ||
| <module name="LeftCurly"/> | ||
|
|
||
| <module name="RightCurly"/> | ||
| <module name="RightCurly"> | ||
| <property name="option" value="alone"/> | ||
| <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/> | ||
| </module> | ||
| <!-- Checks that there is no whitespace after certain tokens; e.g. "." and "!". --> | ||
| <module name="NoWhitespaceAfter"/> | ||
| <!-- Checks that there is no whitespace before certain tokens; e.g. "++" and ";". --> | ||
| <module name="NoWhitespaceBefore"/> | ||
| <!-- Checks that most tokens are surrounded by whitespace. RCURLY is omitted so we can do stuff like "new Thread(){...}.start()". --> | ||
| <module name="WhitespaceAround"> | ||
| <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND"/> | ||
| </module> | ||
| <module name="WhitespaceAfter"> | ||
| <property name="tokens" value="COMMA"/> | ||
| </module> | ||
| <module name="ParenPad"> | ||
| <property name="option" value="nospace"/> | ||
| </module> | ||
| <!-- Ensure there is no space between the identifier of a method definition, constructor definition, method call, or constructor invocation and the left parenthesis of the parameter list. --> | ||
| <module name="MethodParamPad"/> | ||
| <!-- Ensure proper indentation. --> | ||
| <module name="Indentation"> | ||
| <property name="basicOffset" value="3"/> | ||
| <property name="caseIndent" value="3"/> | ||
| <property name="throwsIndent" value="3"/> | ||
| <property name="arrayInitIndent" value="3"/> | ||
| <property name="lineWrappingIndentation" value="3"/> | ||
| </module> | ||
|
|
||
| <module name="IllegalImport"> | ||
| <property name="illegalPkgs" value="junit.framework"/> | ||
| </module> | ||
|
|
||
| <module name="WriteTag"> | ||
| <property name="tag" value="@author"/> | ||
| <property name="tagSeverity" value="error"/> | ||
| <property name="severity" value="ignore"/> | ||
| </module> | ||
|
|
||
| <module name="UnnecessarySemicolonInTryWithResources"/> | ||
|
|
||
| <!-- begin Sevntu checks, http://sevntu-checkstyle.github.io/sevntu.checkstyle/ --> | ||
| <module name="DiamondOperatorForVariableDefinition"/> | ||
| <module name="RequiredParameterForAnnotation"> | ||
| <property name="annotationName" value="Parameterized.Parameters"/> | ||
| <property name="requiredParameters" value="name"/> | ||
| </module> | ||
| <!-- end Sevntu checks --> | ||
| </module> | ||
| </module> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it need to go in the war? if it is picked up from the /lib dir, it will also work for jolokia deployed as an agent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried putting it into the broker's
libdirectory, but Jetty chokes on this:I didn't want to move a bunch of related jars out of the console and into the broker.