-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
183 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
37 changes: 37 additions & 0 deletions
37
agent/core/src/main/java/org/jolokia/backend/plugin/MBeanPlugin.java
This file contains 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,37 @@ | ||
package org.jolokia.backend.plugin; | ||
|
||
/* | ||
* | ||
* Copyright 2014 Roland Huss | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
/** | ||
* Interface describing a plugin which can be used to register extra MBeans for enhancing the Jolokia API. | ||
* MBeanPlugins are looked up from the classpath and should be registered in <code>META-INF/mbean-plugins</code> | ||
* | ||
* @author roland | ||
* @since 12/01/15 | ||
*/ | ||
public interface MBeanPlugin { | ||
|
||
/** | ||
* Init method for the plugin. The plugin purpose is to register MBeans and to remember the context so | ||
* that it can be later used for doing JMX calls. The context should be propagated to the registered MBean so | ||
* that it can be reused for JMX lookups during its operation. | ||
* | ||
* @param ctx the context in order to access JMX | ||
*/ | ||
void init(MBeanPluginContext ctx); | ||
} |
46 changes: 46 additions & 0 deletions
46
agent/core/src/main/java/org/jolokia/backend/plugin/MBeanPluginContext.java
This file contains 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,46 @@ | ||
package org.jolokia.backend.plugin;/* | ||
* | ||
* Copyright 2014 Roland Huss | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
import javax.management.*; | ||
|
||
import org.jolokia.backend.executor.MBeanServerExecutor; | ||
|
||
/** | ||
* A {@link MBeanPlugin}'s context for accessing JMX with all known MBeanServers. Also it allows to register | ||
* on MBeans for offering own functionality. | ||
* | ||
* @author roland | ||
* @since 12/01/15 | ||
*/ | ||
public interface MBeanPluginContext extends MBeanServerExecutor { | ||
|
||
/** | ||
* Register a MBean under a certain name to the platform MBeanServer. No neeed to unregister, the MBean will be | ||
* automatically unregistered when shutting down the agent. It is recommended to use the domain <code>jolokia</code> | ||
* and a type <code>type=plugin</code> when registering MBeans. | ||
* | ||
* @param pMBean MBean to register | ||
* @param pOptionalName optional name under which the bean should be registered. If not provided, | ||
* it depends on whether the MBean to register implements {@link javax.management.MBeanRegistration} or | ||
* not. | ||
* | ||
* @return the name under which the MBean is registered. | ||
*/ | ||
public ObjectName registerMBean(Object pMBean,String ... pOptionalName) | ||
throws MalformedObjectNameException, NotCompliantMBeanException, InstanceAlreadyExistsException; | ||
|
||
} |
This file contains 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 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 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 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 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 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