mbeans

how to modify ThreadPoolTaskExecutor at runtime through jmx

旧巷老猫 提交于 2019-12-04 16:49:22
I'm having trouble modifying my MBean properties through JConsole. I have a Threading bean which invoked with: public static void main(String[] args) throws Exception { // JMX new SimpleJmxAgent(); // spring executor context ApplicationContext ctx = new FileSystemXmlApplicationContext( "src/resources/ThreadContent.xml"); startThreads(ctx); } private static void startThreads(ApplicationContext ctx) { TaskExecutor tE = (TaskExecutor) ctx.getBean("TaskExecutor"); System.out.println("Starting threads"); for (int i = 0; i < 10; i++) { tE.execute(new RepeatingGrpPoC()); } ThreadContent.xml contains

Name for @ManagedOperation in Spring JMX

别等时光非礼了梦想. 提交于 2019-12-04 14:18:41
I used org.springframework.jmx.export.annotation.@ManagedOperation to expose a method as MBean. I want the operation name different from the method name, but managed operation doesn't have any attribute for it. For example: @ManagedOperation public synchronized void clearCache() { // do something } and I want this operation exposed with name = "ResetCache". Create a custom annotation: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface JmxName { String value(); } And a custom subclass of MetadataMBeanInfoAssembler : public class CustomMetadataMBeanInfoAssembler

Same JMX Mbean class for many application at same server

£可爱£侵袭症+ 提交于 2019-12-04 09:59:53
I have more than 5 spring web application and all of them are utilizing another common library. This common library has its own MBeans. Because of mandatory unique objectName constraint, my applications could not be deployed on same server. The way I am using MBeans are like this: @ManagedResource(objectName = "com.org.city:name=City", description = "City related operations") I would like to use same MBean class with different objectNames for all applications. What is the correct way to utilize it without duplicating my MBeans. Thanks bostaunieux I ran into the same issue, and built off of

Port MBean from JBoss 4.x to JBoss 7

梦想的初衷 提交于 2019-12-04 01:51:27
we're currently in the process of porting some of our projects from JBoss 4.x to JBoss 7. So far everything seems to work fine, except for our MBeans, which we're commonly using to provide simple management operations. I've been searching for quite a while now, but either I'm incapable of comming up with the correct search term or I'm missing some piece of knowledge to bridge the gap between MBean definition in JBoss 4.x and JBoss 7. Thus, hopefully someone can provide a hint on what I might be missing or where I'd have to read on (maybe some documentation, examples etc.) In Jboss 4.x our

Java MXBean custom types

一个人想着一个人 提交于 2019-12-03 17:15:24
I am trying to create an MXBean with a custom attribute, but I get javax.management.NotCompliantMBeanException IJmsDestinationMBean.getAttributes has parameter or return type that cannot be translated into an open type I have read that MXBean attributes have to be OpenType compatible. How would I make my attribute work this way? All the classes below are in the same package. class JmsDestinationMBean implements IJmsDestinationMBean{ protected JmsDestinationAttributes attributes = new JmsDestinationAttributes(); @Override public JmsDestinationAttributes getAttributes() { return this.attributes;

Java app performance counters viewed in Perfmon

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 18:07:25
I have a Java app running on Tomcat, and I would like to monitor counters using Windows Performance Monitor. Is this possible using a JMX adapter for the Java MBeans or by some other means? Since you tagged this with JMX and MBeans, I assume your counters are accessible from a Java MBean. If so you could use jconsole, provided with the Java SDK, to monitor the counters. Once you find your MBean in the MBeans tab, double click on the value and it will draw a nice line graph for easy monitoring. See JConsole Guide for more info. BenM The following tutorial might be of use: http://www.developer

Java app performance counters viewed in Perfmon

那年仲夏 提交于 2019-12-01 17:29:06
问题 I have a Java app running on Tomcat, and I would like to monitor counters using Windows Performance Monitor. Is this possible using a JMX adapter for the Java MBeans or by some other means? 回答1: Since you tagged this with JMX and MBeans, I assume your counters are accessible from a Java MBean. If so you could use jconsole, provided with the Java SDK, to monitor the counters. Once you find your MBean in the MBeans tab, double click on the value and it will draw a nice line graph for easy

How to get a MBean binding class instance

心已入冬 提交于 2019-12-01 10:47:47
I am trying to get the instance of a service class bound in jboss-service.xml using MBean. JBoss-Service.xml has defined a BasicThreadPool which we want to use it in our code. This is what it is in JBOSS-Service.xml . <mbean code="org.jboss.util.threadpool.BasicThreadPool" name="jboss.system:service=ThreadPool"> <attribute name="Name">JBoss System Threads</attribute> <attribute name="ThreadGroupName">System Threads</attribute> <attribute name="KeepAliveTime">60000</attribute> <attribute name="MaximumPoolSize">10</attribute> <attribute name="MaximumQueueSize">1000</attribute> <!-- The behavior

How to get a MBean binding class instance

丶灬走出姿态 提交于 2019-12-01 07:28:41
问题 I am trying to get the instance of a service class bound in jboss-service.xml using MBean. JBoss-Service.xml has defined a BasicThreadPool which we want to use it in our code. This is what it is in JBOSS-Service.xml . <mbean code="org.jboss.util.threadpool.BasicThreadPool" name="jboss.system:service=ThreadPool"> <attribute name="Name">JBoss System Threads</attribute> <attribute name="ThreadGroupName">System Threads</attribute> <attribute name="KeepAliveTime">60000</attribute> <attribute name=

access Mbeans on weblogic

非 Y 不嫁゛ 提交于 2019-12-01 00:54:46
From the documentation of oracle : Domain Runtime MBean Server : This MBean server also acts as a single point of access for MBeans that reside on Managed Servers. what i want to do is to use this fact to access all my custom mBeans scattered in several managed servers. for example assume that i have two nodes server-1 server-2 . how can i access all of the custom mBeans on both server-1 server-2 by connecting to the administrator node ? i dont want to remotly access each node to return the result i want a single entry point i managed to get the names of the servers and the states and other