\n\u003Ctask:annotation-driven executor=\"myExecutor\" scheduler=\"myScheduler\" />\n\u003Ctask:executor id=\"myExecutor\" pool-size=\"5\" />\n\u003Ctask:scheduler id=\"myScheduler\" pool-size=\"10\" />\n","xml","",[37,38,39,47,53,59],"code",{"__ignoreMap":35},[40,41,44],"span",{"class":42,"line":43},"line",1,[40,45,46],{},"\u003Cbean id=\"myClass\" class=\"my.project.path.myClass\" />\n",[40,48,50],{"class":42,"line":49},2,[40,51,52],{},"\u003Ctask:annotation-driven executor=\"myExecutor\" scheduler=\"myScheduler\" />\n",[40,54,56],{"class":42,"line":55},3,[40,57,58],{},"\u003Ctask:executor id=\"myExecutor\" pool-size=\"5\" />\n",[40,60,62],{"class":42,"line":61},4,[40,63,64],{},"\u003Ctask:scheduler id=\"myScheduler\" pool-size=\"10\" />\n",[22,66,68],{"id":67},"the-scheduled-annotation","The @Scheduled annotation",[18,70,71],{},"With the @Scheduled annotation you can execute your method as a cron job. Using this annotation requires that the method\nto be scheduled must be of type void and must not expect any arguments. The following examples show you how to use the\n@Scheduled annotation.",[18,73,74],{},"If you want periodic scheduling you can use the property fixedRate. In this example the method would be executed every\n42 seconds.",[30,76,80],{"className":77,"code":78,"language":79,"meta":35,"style":35},"language-java shiki shiki-themes github-light github-dark","@Scheduled(fixedRate = 42000)\npublic void execute() {\n // do something\n}\n","java",[37,81,82,87,92,97],{"__ignoreMap":35},[40,83,84],{"class":42,"line":43},[40,85,86],{},"@Scheduled(fixedRate = 42000)\n",[40,88,89],{"class":42,"line":49},[40,90,91],{},"public void execute() {\n",[40,93,94],{"class":42,"line":55},[40,95,96],{}," // do something\n",[40,98,99],{"class":42,"line":61},[40,100,101],{},"}\n",[18,103,104],{},"If you prefer cron expressions you can use them either. The following example is analogue to the example above only\nusing cron expressions. The annotated method would be executed each full minute and every 7 seconds.",[30,106,108],{"className":77,"code":107,"language":79,"meta":35,"style":35},"@Scheduled(cron = \"*/7 * * * * *\")\npublic void execute() {\n // do something\n}\n",[37,109,110,115,119,123],{"__ignoreMap":35},[40,111,112],{"class":42,"line":43},[40,113,114],{},"@Scheduled(cron = \"*/7 * * * * *\")\n",[40,116,117],{"class":42,"line":49},[40,118,91],{},[40,120,121],{"class":42,"line":55},[40,122,96],{},[40,124,125],{"class":42,"line":61},[40,126,101],{},[18,128,129],{},"Without question you have much more possibilities with cron expressions than with periodic scheduling. In this example\nyour method would be executed every weekday (Monday to Friday) on 9.45 am.",[30,131,133],{"className":77,"code":132,"language":79,"meta":35,"style":35},"@Scheduled(cron = \"0 45 9 * * MON-FRI\")\npublic void execute() {\n // do something\n}\n",[37,134,135,140,144,148],{"__ignoreMap":35},[40,136,137],{"class":42,"line":43},[40,138,139],{},"@Scheduled(cron = \"0 45 9 * * MON-FRI\")\n",[40,141,142],{"class":42,"line":49},[40,143,91],{},[40,145,146],{"class":42,"line":55},[40,147,96],{},[40,149,150],{"class":42,"line":61},[40,151,101],{},[18,153,154],{},"A pretty cool feature is that you even can use placeholders for your cron expression which are resolved against the\nconfigured property-placeholder.",[30,156,158],{"className":77,"code":157,"language":79,"meta":35,"style":35},"@Scheduled(cron = \"${myclass.cron.execute.sth}\")\npublic void execute() {\n // do something\n}\n",[37,159,160,165,169,173],{"__ignoreMap":35},[40,161,162],{"class":42,"line":43},[40,163,164],{},"@Scheduled(cron = \"${myclass.cron.execute.sth}\")\n",[40,166,167],{"class":42,"line":49},[40,168,91],{},[40,170,171],{"class":42,"line":55},[40,172,96],{},[40,174,175],{"class":42,"line":61},[40,176,101],{},[18,178,179],{},"Define where the properties are loaded from within your application context:",[30,181,183],{"className":32,"code":182,"language":34,"meta":35,"style":35},"\u003Ccontext:property-placeholder location=\"classpath:application.properties\"/>\n",[37,184,185],{"__ignoreMap":35},[40,186,187],{"class":42,"line":43},[40,188,182],{},[18,190,191],{},"Then the properties are loaded from the file which contains your cron-expressions like this:",[30,193,197],{"className":194,"code":195,"language":196,"meta":35,"style":35},"language-plaintext shiki shiki-themes github-light github-dark","myclass.cron.execute.sth=0 45 9 * * MON-FRI\n","plaintext",[37,198,199],{"__ignoreMap":35},[40,200,201],{"class":42,"line":43},[40,202,195],{},[22,204,206],{"id":205},"the-async-annotation","The @Async annotation",[18,208,209],{},"The @Async annotation allows you to invoke your method asynchronously. The execution of the method will occur in a task\nthat has been submitted to the TaskExecutor defined in your application context. Contrary to the methods annotated with\nthe @Scheduled annotations the methods you annotate with @Async may be of other type than void and can expect arguments.",[18,211,212],{},"This is a simple example of a @Async annotated method without a return value.",[30,214,216],{"className":77,"code":215,"language":79,"meta":35,"style":35},"@Async\nvoid execute(String string) {\n // do something asynchronously\n}\n",[37,217,218,223,228,233],{"__ignoreMap":35},[40,219,220],{"class":42,"line":43},[40,221,222],{},"@Async\n",[40,224,225],{"class":42,"line":49},[40,226,227],{},"void execute(String string) {\n",[40,229,230],{"class":42,"line":55},[40,231,232],{}," // do something asynchronously\n",[40,234,235],{"class":42,"line":61},[40,236,101],{},[18,238,239],{},"Like mentioned above your @Async annotated method may have a return value. However this return value must be of type\nFuture. This means that first the other tasks are performed and then is called get() on that Future.",[30,241,243],{"className":77,"code":242,"language":79,"meta":35,"style":35},"@Async\nFuture\u003CString> execute(String string) {\n // do something asynchronously\n}\n",[37,244,245,249,254,258],{"__ignoreMap":35},[40,246,247],{"class":42,"line":43},[40,248,222],{},[40,250,251],{"class":42,"line":49},[40,252,253],{},"Future\u003CString> execute(String string) {\n",[40,255,256],{"class":42,"line":55},[40,257,232],{},[40,259,260],{"class":42,"line":61},[40,261,101],{},[22,263,265],{"id":264},"further-information","Further information",[18,267,268,269],{},"Have a look at\nthe ",[270,271,275],"a",{"href":272,"rel":273},"http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/htmlsingle/spring-framework-reference.html#scheduling",[274],"nofollow","Spring Framework Reference Documentation",[277,278,279],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":35,"searchDepth":49,"depth":49,"links":281},[282,283,284,285],{"id":24,"depth":55,"text":25},{"id":67,"depth":55,"text":68},{"id":205,"depth":55,"text":206},{"id":264,"depth":55,"text":265},[287,288],"azubi-blog","developer-blog","2012-06-13T15:49:15","You want to execute cron jobs or call your methods asynchronously? Thanks to Spring’s annotation support for scheduling\\nand asynchronous execution you can achieve this in a few minutes.","md","https://synyx.de/blog/scheduling-and-asynchronous-execution-with-spring/",{},true,"/blog/scheduling-and-asynchronous-execution-with-spring",{"title":7,"description":20},"blog/scheduling-and-asynchronous-execution-with-spring",[299,300,301,302,303,304],"async","scheduled","asynchronous","scheduling","spring","spring-annotations","You want to execute cron jobs or call your methods asynchronously? Thanks to Spring’s annotation support for scheduling and asynchronous execution you can achieve this in a few minutes. Some…","fzW4lb1yw0kNbXB83aAmQzrzjrslpT-gtiBvUzbdR7Q",{"id":308,"title":309,"author":310,"body":311,"category":985,"date":986,"description":987,"extension":291,"link":988,"meta":989,"navigation":294,"path":990,"seo":991,"slug":315,"stem":992,"tags":993,"teaser":1001,"__hash__":1002},"blog/blog/how-to-monitor-and-manage-your-java-application-with-jmx.md","How to monitor and manage your Java application with JMX",[9],{"type":11,"value":312,"toc":978},[313,316,319,335,422,425,429,432,526,529,536,540,555,561,566,589,592,597,602,626,629,654,659,664,688,694,733,742,746,749,754,757,764,769,772,778,781,784,818,821,871,875,878,881,942,945,949,955,962,969,976],[14,314,309],{"id":315},"how-to-monitor-and-manage-your-java-application-with-jmx",[18,317,318],{},"JMX (Java Management Extensions) provides the infrastructure to support monitoring and management of your Java\napplications. Resources you manage with JMX are called Managed Beans (MBeans). I want to show you how to quickly\nregister your own Service as MBean using Spring and Source-Level Metadata (JDK 5.0+ annotations).",[18,320,321,322,326,327,330,331,334],{},"The following sample is built on a tool that allows to manage the staffs’ applications for vacation digitally instead of\nusing paper. If a staff member applies for leave, the application gets the status ",[323,324,325],"em",{},"waiting",". Then an authorized person (\nthe boss) has to decide about this application. It may be set to ",[323,328,329],{},"allowed"," or to ",[323,332,333],{},"rejected",". It might be that you want\nto have an overview of the applications and their status and you may even want to remind the authorized persons via\nemail to review the pending applications. Even if the vacation management tool has a web-based frontend for doing the\nmost of the actions, I think it still makes a good example for describing how to use JMX in your Java application. The\nfollowing class is a skeleton of the class which shall be exposed to JMX as MBean.",[30,336,338],{"className":77,"code":337,"language":79,"meta":35,"style":35},"public class JmxDemo {\n private long numberOfWaitingApplications;\n public long getNumberOfWaitingApplications() {\n return numberOfWaitingApplications;\n }\n public long countApplicationsInStatus(String status) {\n // do something and return number of applications with the given status\n }\n public List\u003CString> showWaitingApplications() {\n // do something and return a list of all waiting applications\n }\n public String remindBossAboutWaitingApplications() {\n // remind the boss via email to decide about the waiting applications\n }\n}\n",[37,339,340,345,350,355,360,366,372,378,383,389,395,400,406,412,417],{"__ignoreMap":35},[40,341,342],{"class":42,"line":43},[40,343,344],{},"public class JmxDemo {\n",[40,346,347],{"class":42,"line":49},[40,348,349],{}," private long numberOfWaitingApplications;\n",[40,351,352],{"class":42,"line":55},[40,353,354],{}," public long getNumberOfWaitingApplications() {\n",[40,356,357],{"class":42,"line":61},[40,358,359],{}," return numberOfWaitingApplications;\n",[40,361,363],{"class":42,"line":362},5,[40,364,365],{}," }\n",[40,367,369],{"class":42,"line":368},6,[40,370,371],{}," public long countApplicationsInStatus(String status) {\n",[40,373,375],{"class":42,"line":374},7,[40,376,377],{}," // do something and return number of applications with the given status\n",[40,379,381],{"class":42,"line":380},8,[40,382,365],{},[40,384,386],{"class":42,"line":385},9,[40,387,388],{}," public List\u003CString> showWaitingApplications() {\n",[40,390,392],{"class":42,"line":391},10,[40,393,394],{}," // do something and return a list of all waiting applications\n",[40,396,398],{"class":42,"line":397},11,[40,399,365],{},[40,401,403],{"class":42,"line":402},12,[40,404,405],{}," public String remindBossAboutWaitingApplications() {\n",[40,407,409],{"class":42,"line":408},13,[40,410,411],{}," // remind the boss via email to decide about the waiting applications\n",[40,413,415],{"class":42,"line":414},14,[40,416,365],{},[40,418,420],{"class":42,"line":419},15,[40,421,101],{},[18,423,424],{},"If you want to use this class as a MBean, a few steps are necessary.",[22,426,428],{"id":427},"_1-not-yet-another-xml-file","1. Not yet another xml file…",[18,430,431],{},"It’s best you create an extra xml file (let’s call it jmxContext.xml) for JMX configuration and import it in your\napplicationContext.xml. In your jmxContext.xml you define your MBean and the MBeanExporter.",[30,433,435],{"className":32,"code":434,"language":34,"meta":35,"style":35},"\n\u003Cbean id=\"jmxDemo\" class=\"org.synyx.urlaubsverwaltung.jmx.JmxDemo\">\n \u003C!-- maybe you need contructor-injection -->\n \u003C!-- \u003Cconstructor-arg ref=\"myService\" /> -->\n\u003C/bean>\n \u003C!-- you may just copy the following lines -->\n\u003Cbean id=\"exporter\" class=\"org.springframework.jmx.export.MBeanExporter\" lazy-init=\"false\">\n\u003Cproperty name=\"autodetect\" value=\"true\"/>\n\u003Cproperty name=\"namingStrategy\" ref=\"namingStrategy\"/>\n\u003Cproperty name=\"assembler\" ref=\"assembler\"/>\n\u003C/bean>\n\u003Cbean id=\"jmxAttributeSource\" class=\"org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource\"/>\n\u003Cbean id=\"assembler\" class=\"org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler\">\n\u003Cproperty name=\"attributeSource\" ref=\"jmxAttributeSource\"/>\n\u003C/bean>\n\u003Cbean id=\"namingStrategy\" class=\"org.springframework.jmx.export.naming.MetadataNamingStrategy\">\n\u003Cproperty name=\"attributeSource\" ref=\"jmxAttributeSource\"/>\n\u003C/bean>\n",[37,436,437,442,447,452,457,462,467,472,477,482,487,491,496,501,506,510,516,521],{"__ignoreMap":35},[40,438,439],{"class":42,"line":43},[40,440,441],{"emptyLinePlaceholder":294},"\n",[40,443,444],{"class":42,"line":49},[40,445,446],{},"\u003Cbean id=\"jmxDemo\" class=\"org.synyx.urlaubsverwaltung.jmx.JmxDemo\">\n",[40,448,449],{"class":42,"line":55},[40,450,451],{}," \u003C!-- maybe you need contructor-injection -->\n",[40,453,454],{"class":42,"line":61},[40,455,456],{}," \u003C!-- \u003Cconstructor-arg ref=\"myService\" /> -->\n",[40,458,459],{"class":42,"line":362},[40,460,461],{},"\u003C/bean>\n",[40,463,464],{"class":42,"line":368},[40,465,466],{}," \u003C!-- you may just copy the following lines -->\n",[40,468,469],{"class":42,"line":374},[40,470,471],{},"\u003Cbean id=\"exporter\" class=\"org.springframework.jmx.export.MBeanExporter\" lazy-init=\"false\">\n",[40,473,474],{"class":42,"line":380},[40,475,476],{},"\u003Cproperty name=\"autodetect\" value=\"true\"/>\n",[40,478,479],{"class":42,"line":385},[40,480,481],{},"\u003Cproperty name=\"namingStrategy\" ref=\"namingStrategy\"/>\n",[40,483,484],{"class":42,"line":391},[40,485,486],{},"\u003Cproperty name=\"assembler\" ref=\"assembler\"/>\n",[40,488,489],{"class":42,"line":397},[40,490,461],{},[40,492,493],{"class":42,"line":402},[40,494,495],{},"\u003Cbean id=\"jmxAttributeSource\" class=\"org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource\"/>\n",[40,497,498],{"class":42,"line":408},[40,499,500],{},"\u003Cbean id=\"assembler\" class=\"org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler\">\n",[40,502,503],{"class":42,"line":414},[40,504,505],{},"\u003Cproperty name=\"attributeSource\" ref=\"jmxAttributeSource\"/>\n",[40,507,508],{"class":42,"line":419},[40,509,461],{},[40,511,513],{"class":42,"line":512},16,[40,514,515],{},"\u003Cbean id=\"namingStrategy\" class=\"org.springframework.jmx.export.naming.MetadataNamingStrategy\">\n",[40,517,519],{"class":42,"line":518},17,[40,520,505],{},[40,522,524],{"class":42,"line":523},18,[40,525,461],{},[18,527,528],{},"If your application is running inside a container such as Tomcat, you even don’t have to configure the MBeanServer\nbecause the container has its own one.",[18,530,531,532,535],{},"Setting MBeanExporter’s property ",[323,533,534],{},"autodetect"," to true, means that the MBeanExporter will register all the Beans within\nyour application’s context that are annotated in the way described in the next section as MBeans.",[22,537,539],{"id":538},"_2-lets-transform-your-spring-bean-to-a-managed-bean","2. Let’s transform your Spring Bean to a Managed Bean!",[18,541,542,543,546,547,550,551,554],{},"Spring uses information provided by annotations to generate MBeans. The attributes of the annotations are speaking for\nthemselves so further description isn’t necessary. To mark a Bean for export, it has to be annotated with\n",[323,544,545],{},"@ManagedResource",", Attributes are annotated with ",[323,548,549],{},"@ManagedAttribute"," and Methods with ",[323,552,553],{},"@ManagedOperation",".",[18,556,557],{},[558,559,560],"strong",{},"2.1 Bean",[18,562,563,564,554],{},"Mark your Bean with ",[323,565,545],{},[30,567,569],{"className":77,"code":568,"language":79,"meta":35,"style":35},"@ManagedResource(objectName = \"mbeans:name=myJmxDemoBean\", description = \"My managed Bean.\")\npublic class JmxDemo {\n // lot of stuff\n}\n",[37,570,571,576,580,585],{"__ignoreMap":35},[40,572,573],{"class":42,"line":43},[40,574,575],{},"@ManagedResource(objectName = \"mbeans:name=myJmxDemoBean\", description = \"My managed Bean.\")\n",[40,577,578],{"class":42,"line":49},[40,579,344],{},[40,581,582],{"class":42,"line":55},[40,583,584],{}," // lot of stuff\n",[40,586,587],{"class":42,"line":61},[40,588,101],{},[18,590,591],{},"Make sure that your MBean doesn’t contain ‘MBean’ in its name since it would be treated as a StandardMBean causing your\nannotations not to work.",[18,593,594],{},[558,595,596],{},"2.2 Attributes",[18,598,599,600,554],{},"Annotate the Getter and Setter with ",[323,601,549],{},[30,603,605],{"className":77,"code":604,"language":79,"meta":35,"style":35},"@ManagedAttribute(description = \"Get the number of all waiting applications\" )\npublic long getNumberOfWaitingApplications() {\n return numberOfWaitingApplications;\n}\n",[37,606,607,612,617,622],{"__ignoreMap":35},[40,608,609],{"class":42,"line":43},[40,610,611],{},"@ManagedAttribute(description = \"Get the number of all waiting applications\" )\n",[40,613,614],{"class":42,"line":49},[40,615,616],{},"public long getNumberOfWaitingApplications() {\n",[40,618,619],{"class":42,"line":55},[40,620,621],{}," return numberOfWaitingApplications;\n",[40,623,624],{"class":42,"line":61},[40,625,101],{},[18,627,628],{},"Exposing attributes may be:",[630,631,632,636,639,642,645,648,651],"ul",{},[633,634,635],"li",{},"Basic types",[633,637,638],{},"Primitives and their wrappers",[633,640,641],{},"String",[633,643,644],{},"BigDecimal",[633,646,647],{},"BigInteger",[633,649,650],{},"Date",[633,652,653],{},"Arrays and collections of basic types",[18,655,656],{},[558,657,658],{},"2.2 Methods",[18,660,661,662,554],{},"Annotate each method you wish to expose with ",[323,663,553],{},[30,665,667],{"className":77,"code":666,"language":79,"meta":35,"style":35},"@ManagedOperation(description = \"Shows a list of all waiting applications with some information.\")\npublic List\u003CString> showWaitingApplications() {\n // do something and return a list of all waiting applications\n}\n",[37,668,669,674,679,684],{"__ignoreMap":35},[40,670,671],{"class":42,"line":43},[40,672,673],{},"@ManagedOperation(description = \"Shows a list of all waiting applications with some information.\")\n",[40,675,676],{"class":42,"line":49},[40,677,678],{},"public List\u003CString> showWaitingApplications() {\n",[40,680,681],{"class":42,"line":55},[40,682,683],{}," // do something and return a list of all waiting applications\n",[40,685,686],{"class":42,"line":61},[40,687,101],{},[18,689,690,691,554],{},"If your methods have parameters you can describe them further with ",[323,692,693],{},"@ManagedOperationParameters",[30,695,697],{"className":77,"code":696,"language":79,"meta":35,"style":35},"@ManagedOperation(description = \"Get the number of all applications that have the given status.\")\n@ManagedOperationParameters({\n @ManagedOperationParameter(name = \"status\", description = \"The status may be waiting, allowed, rejected or cancelled.\")\n})\npublic long countApplicationsInStatus(String state) {\n // do something and return number of applications with the given status\n}\n",[37,698,699,704,709,714,719,724,729],{"__ignoreMap":35},[40,700,701],{"class":42,"line":43},[40,702,703],{},"@ManagedOperation(description = \"Get the number of all applications that have the given status.\")\n",[40,705,706],{"class":42,"line":49},[40,707,708],{},"@ManagedOperationParameters({\n",[40,710,711],{"class":42,"line":55},[40,712,713],{}," @ManagedOperationParameter(name = \"status\", description = \"The status may be waiting, allowed, rejected or cancelled.\")\n",[40,715,716],{"class":42,"line":61},[40,717,718],{},"})\n",[40,720,721],{"class":42,"line":362},[40,722,723],{},"public long countApplicationsInStatus(String state) {\n",[40,725,726],{"class":42,"line":368},[40,727,728],{}," // do something and return number of applications with the given status\n",[40,730,731],{"class":42,"line":374},[40,732,101],{},[18,734,735,736,738,739,741],{},"Make sure to annotate your Getter/Setter with ",[323,737,549],{}," and not with ",[323,740,553],{},". Otherwise your\nmethods won’t work.",[22,743,745],{"id":744},"_3-try-it","3. Try it!",[18,747,748],{},"You can now use the functions of your MBean either with JConsole or with other tools. (e.g. JMinix)",[18,750,751],{},[558,752,753],{},"3.1 JConsole",[18,755,756],{},"JConsole is part of Oracle’s JDK, so you can just start it by executing the JConsole command in your JDK’s\nbinary-folder. You can connect to local or to remote Java Virtual Machines. If you are running your application on the\nsame host as JConsole it should show up at the ‘Local Process’ section.",[18,758,759],{},[760,761],"img",{"alt":762,"src":763},"\"jconsole\"","https://media.synyx.de/uploads//2012/04/jconsole.png",[18,765,766],{},[558,767,768],{},"3.2 JMinix",[18,770,771],{},"If you want to have a JMX entry point in your web application instead of using JConsole, JMinix might be the right\nchoice for you.",[18,773,774],{},[760,775],{"alt":776,"src":777},"\"JMinix\"","https://media.synyx.de/uploads//2012/04/jminix.png",[18,779,780],{},"You can include it easily in your Maven based web application:",[18,782,783],{},"Add JMinix as dependency in your pom.xml",[30,785,787],{"className":32,"code":786,"language":34,"meta":35,"style":35},"\n\u003Cdependency>\n \u003CgroupId>org.jminix\u003C/groupId>\n \u003CartifactId>jminix\u003C/artifactId>\n \u003Cversion>1.0.0\u003C/version>\n\u003C/dependency>\n",[37,788,789,793,798,803,808,813],{"__ignoreMap":35},[40,790,791],{"class":42,"line":43},[40,792,441],{"emptyLinePlaceholder":294},[40,794,795],{"class":42,"line":49},[40,796,797],{},"\u003Cdependency>\n",[40,799,800],{"class":42,"line":55},[40,801,802],{}," \u003CgroupId>org.jminix\u003C/groupId>\n",[40,804,805],{"class":42,"line":61},[40,806,807],{}," \u003CartifactId>jminix\u003C/artifactId>\n",[40,809,810],{"class":42,"line":362},[40,811,812],{}," \u003Cversion>1.0.0\u003C/version>\n",[40,814,815],{"class":42,"line":368},[40,816,817],{},"\u003C/dependency>\n",[18,819,820],{},"JMinix uses a simple HttpServlet that you have to register and map to an url-pattern in your web.xml",[30,822,824],{"className":32,"code":823,"language":34,"meta":35,"style":35},"\u003C!-- JMX -->\n\u003Cservlet>\n \u003Cservlet-name>JmxMiniConsoleServlet\u003C/servlet-name>\n \u003Cservlet-class>org.jminix.console.servlet.MiniConsoleServlet\u003C/servlet-class>\n\u003C/servlet>\n\u003Cservlet-mapping>\n\u003Cservlet-name>JmxMiniConsoleServlet\u003C/servlet-name>\n\u003Curl-pattern>/jmx/*\u003C/url-pattern>\n\u003C/servlet-mapping>\n",[37,825,826,831,836,841,846,851,856,861,866],{"__ignoreMap":35},[40,827,828],{"class":42,"line":43},[40,829,830],{},"\u003C!-- JMX -->\n",[40,832,833],{"class":42,"line":49},[40,834,835],{},"\u003Cservlet>\n",[40,837,838],{"class":42,"line":55},[40,839,840],{}," \u003Cservlet-name>JmxMiniConsoleServlet\u003C/servlet-name>\n",[40,842,843],{"class":42,"line":61},[40,844,845],{}," \u003Cservlet-class>org.jminix.console.servlet.MiniConsoleServlet\u003C/servlet-class>\n",[40,847,848],{"class":42,"line":362},[40,849,850],{},"\u003C/servlet>\n",[40,852,853],{"class":42,"line":368},[40,854,855],{},"\u003Cservlet-mapping>\n",[40,857,858],{"class":42,"line":374},[40,859,860],{},"\u003Cservlet-name>JmxMiniConsoleServlet\u003C/servlet-name>\n",[40,862,863],{"class":42,"line":380},[40,864,865],{},"\u003Curl-pattern>/jmx/*\u003C/url-pattern>\n",[40,867,868],{"class":42,"line":385},[40,869,870],{},"\u003C/servlet-mapping>\n",[22,872,874],{"id":873},"_4-notifications","4. Notifications",[18,876,877],{},"Notifications (javax.management.Notification) can be broadcast from your component to notify about something interesting\nhappening. This is only a simple example of using Notifications.",[18,879,880],{},"Example: You want to be notified if a user logs in.",[30,882,884],{"className":77,"code":883,"language":79,"meta":35,"style":35},"@ManagedResource(objectName = \"mbeans:name=myJmxDemoBean\", description = \"Manage some 'Urlaubsverwaltung' problems.\")\npublic class JmxDemoReady implements NotificationPublisherAware {\n // lot of stuff\n private NotificationPublisher notificationPublisher;\n public void notifyAboutLogin(String msg) {\n notificationPublisher.sendNotification(new Notification(\"Login Action\", this, 0, msg));\n }\n @Override\n public void setNotificationPublisher(NotificationPublisher notificationPublisher) {\n this.notificationPublisher = notificationPublisher;\n }\n}\n",[37,885,886,891,896,900,905,910,915,919,924,929,934,938],{"__ignoreMap":35},[40,887,888],{"class":42,"line":43},[40,889,890],{},"@ManagedResource(objectName = \"mbeans:name=myJmxDemoBean\", description = \"Manage some 'Urlaubsverwaltung' problems.\")\n",[40,892,893],{"class":42,"line":49},[40,894,895],{},"public class JmxDemoReady implements NotificationPublisherAware {\n",[40,897,898],{"class":42,"line":55},[40,899,584],{},[40,901,902],{"class":42,"line":61},[40,903,904],{}," private NotificationPublisher notificationPublisher;\n",[40,906,907],{"class":42,"line":362},[40,908,909],{}," public void notifyAboutLogin(String msg) {\n",[40,911,912],{"class":42,"line":368},[40,913,914],{}," notificationPublisher.sendNotification(new Notification(\"Login Action\", this, 0, msg));\n",[40,916,917],{"class":42,"line":374},[40,918,365],{},[40,920,921],{"class":42,"line":380},[40,922,923],{}," @Override\n",[40,925,926],{"class":42,"line":385},[40,927,928],{}," public void setNotificationPublisher(NotificationPublisher notificationPublisher) {\n",[40,930,931],{"class":42,"line":391},[40,932,933],{}," this.notificationPublisher = notificationPublisher;\n",[40,935,936],{"class":42,"line":397},[40,937,365],{},[40,939,940],{"class":42,"line":402},[40,941,101],{},[18,943,944],{},"With the NotificationPublisher you are able to create Notifications in a very simple way. At the right place in your\ncode, you inject your JmxDemo Bean and call the method notifyAboutLogin() when a user logs in. JConsole now displays a\nthird menu item called ‘Notifications’, besides ‘Attributes’ and ‘Operations’. If you click on ‘Subscribe’, you get a\nNotification every time a user logs in your web application.",[22,946,948],{"id":947},"_5-further-information","5. Further information:",[18,950,951],{},[270,952,275],{"href":953,"rel":954},"http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/jmx.html",[274],[18,956,957],{},[270,958,961],{"href":959,"rel":960},"http://docs.oracle.com/javase/1.5.0/docs/guide/management/jconsole.html",[274],"About JConsole",[18,963,964],{},[270,965,968],{"href":966,"rel":967},"http://code.google.com/p/jminix/",[274],"About JMinix",[18,970,971],{},[270,972,975],{"href":973,"rel":974},"http://blog.synyx.de/2011/11/elektronische-urlaubsverwaltung-made-by-youngsters",[274],"About the vacation management web application",[277,977,279],{},{"title":35,"searchDepth":49,"depth":49,"links":979},[980,981,982,983,984],{"id":427,"depth":55,"text":428},{"id":538,"depth":55,"text":539},{"id":744,"depth":55,"text":745},{"id":873,"depth":55,"text":874},{"id":947,"depth":55,"text":948},[287,288],"2012-05-07T17:56:12","JMX (Java Management Extensions) provides the infrastructure to support monitoring and management of your Java\\napplications. Resources you manage with JMX are called Managed Beans (MBeans). I want to show you how to quickly\\nregister your own Service as MBean using Spring and Source-Level Metadata (JDK 5.0+ annotations).","https://synyx.de/blog/how-to-monitor-and-manage-your-java-application-with-jmx/",{},"/blog/how-to-monitor-and-manage-your-java-application-with-jmx",{"title":309,"description":318},"blog/how-to-monitor-and-manage-your-java-application-with-jmx",[994,995,996,997,998,999,1000,303],"annotation","jconsole","jminix","jmx","mbeans","metadata","notifications","JMX (Java Management Extensions) provides the infrastructure to support monitoring and management of your Java applications. Resources you manage with JMX are called Managed Beans (MBeans). I want to show…","Lf-pqL8fxMUtFEesPQZ2fYbpNoUAqH8DOQaGCkCDsBA",[1004,1007,1010,1013,1016,1019,1022,1025,1028,1030,1033,1036,1039,1042,1045,1048,1051,1054,1057,1060,1063,1066,1068,1071,1074,1077,1080,1082,1085,1088,1091,1094,1097,1100,1103,1106,1109,1112,1115,1118,1121,1124,1127,1130,1133,1136,1139,1142,1145,1148,1151,1154,1157,1160,1163,1166,1169,1172,1175,1178,1181,1184,1187,1190,1193,1196,1199,1202,1205,1208,1211,1214,1217,1220,1223,1226,1229,1232,1235,1238,1241,1244,1247,1250,1253,1256,1259,1262,1265,1268,1271,1274,1277,1280,1283,1286,1289,1292,1295,1297,1300,1303,1306,1309,1311,1314,1317,1320,1323,1326,1329,1332,1335,1338,1341,1344,1347,1350,1353,1356,1359,1362,1365,1368,1371,1374,1377,1380,1383,1386,1388,1391,1394,1397,1400,1403,1406,1409,1412,1415,1418,1421],{"slug":1005,"name":1006},"abel","Jennifer Abel",{"slug":1008,"name":1009},"allmendinger","Otto Allmendinger",{"slug":1011,"name":1012},"antony","Ben Antony",{"slug":1014,"name":1015},"arrasz","Joachim Arrasz",{"slug":1017,"name":1018},"bauer","David Bauer",{"slug":1020,"name":1021},"bechtold","Janine Bechtold",{"slug":1023,"name":1024},"boersig","Jasmin Börsig",{"slug":1026,"name":1027},"buch","Fabian Buch",{"slug":9,"name":1029},"Aljona Buchloh",{"slug":1031,"name":1032},"burgard","Julia Burgard",{"slug":1034,"name":1035},"caspar-schwedes","Caspar Schwedes",{"slug":1037,"name":1038},"christina-schmitt","Christina Schmitt",{"slug":1040,"name":1041},"clausen","Michael Clausen",{"slug":1043,"name":1044},"contargo_poetzsch","Thomas Pötzsch",{"slug":1046,"name":1047},"damrath","Sebastian Damrath",{"slug":1049,"name":1050},"daniel","Markus Daniel",{"slug":1052,"name":1053},"dasch","Julia Dasch",{"slug":1055,"name":1056},"denman","Joffrey Denman",{"slug":1058,"name":1059},"dfuchs","Daniel Fuchs",{"slug":1061,"name":1062},"dobler","Max Dobler",{"slug":1064,"name":1065},"dobriakov","Vladimir Dobriakov",{"slug":1067,"name":1067},"dreiqbik",{"slug":1069,"name":1070},"dschaefer","Denise Schäfer",{"slug":1072,"name":1073},"dschneider","Dominik Schneider",{"slug":1075,"name":1076},"duerlich","Isabell Duerlich",{"slug":1078,"name":1079},"dutkowski","Bernd Dutkowski",{"slug":1081,"name":1081},"eifler",{"slug":1083,"name":1084},"essig","Tim Essig",{"slug":1086,"name":1087},"ferstl","Maximilian Ferstl",{"slug":1089,"name":1090},"fey","Prisca Fey",{"slug":1092,"name":1093},"frank","Leonard Frank",{"slug":1095,"name":1096},"franke","Arnold Franke",{"slug":1098,"name":1099},"frischer","Nicolette Rudmann",{"slug":1101,"name":1102},"fuchs","Petra Fuchs",{"slug":1104,"name":1105},"gari","Sarah Gari",{"slug":1107,"name":1108},"gast","Gast",{"slug":1110,"name":1111},"graf","Johannes Graf",{"slug":1113,"name":1114},"grammlich","Daniela Grammlich",{"slug":1116,"name":1117},"guthardt","Sabrina Guthardt",{"slug":1119,"name":1120},"haeussler","Johannes Häussler",{"slug":1122,"name":1123},"hammann","Daniel Hammann",{"slug":1125,"name":1126},"heetel","Julian Heetel",{"slug":1128,"name":1129},"heft","Florian Heft",{"slug":1131,"name":1132},"heib","Sebastian Heib",{"slug":1134,"name":1135},"heisler","Ida Heisler",{"slug":1137,"name":1138},"helm","Patrick Helm",{"slug":1140,"name":1141},"herbold","Michael Herbold",{"slug":1143,"name":1144},"hofmann","Peter Hofmann",{"slug":1146,"name":1147},"hopf","Florian Hopf",{"slug":1149,"name":1150},"jaud","Alina Jaud",{"slug":1152,"name":1153},"jayasinghe","Robin De Silva Jayasinghe",{"slug":1155,"name":1156},"jbuch","Jonathan Buch",{"slug":1158,"name":1159},"junghanss","Gitta Junghanß",{"slug":1161,"name":1162},"kadyietska","Khrystyna Kadyietska",{"slug":1164,"name":1165},"kannegiesser","Marc Kannegiesser",{"slug":1167,"name":1168},"karoly","Robert Károly",{"slug":1170,"name":1171},"karrasz","Katja Arrasz-Schepanski",{"slug":1173,"name":1174},"kaufmann","Florian Kaufmann",{"slug":1176,"name":1177},"kesler","Mike Kesler",{"slug":1179,"name":1180},"kirchgaessner","Bettina Kirchgäßner",{"slug":1182,"name":1183},"klem","Yannic Klem",{"slug":1185,"name":1186},"klenk","Timo Klenk",{"slug":1188,"name":1189},"knell","Tobias Knell",{"slug":1191,"name":1192},"knoll","Anna-Lena Knoll",{"slug":1194,"name":1195},"knorre","Matthias Knorre",{"slug":1197,"name":1198},"koenig","Melanie König",{"slug":1200,"name":1201},"kraft","Thomas Kraft",{"slug":1203,"name":1204},"krupicka","Florian Krupicka",{"slug":1206,"name":1207},"kuehn","Christian Kühn",{"slug":1209,"name":1210},"lange","Christian Lange",{"slug":1212,"name":1213},"larrasz","Luca Arrasz",{"slug":1215,"name":1216},"leist","Sascha Leist",{"slug":1218,"name":1219},"lihs","Michael Lihs",{"slug":1221,"name":1222},"linsin","David Linsin",{"slug":1224,"name":1225},"maniyar","Christian Maniyar",{"slug":1227,"name":1228},"martin","Björnie",{"slug":1230,"name":1231},"martin-koch","Martin Koch",{"slug":1233,"name":1234},"matt","Tobias Matt",{"slug":1236,"name":1237},"mennerich","Christian Mennerich",{"slug":1239,"name":1240},"menz","Alexander Menz",{"slug":1242,"name":1243},"meseck","Frederick Meseck",{"slug":1245,"name":1246},"messner","Oliver Messner",{"slug":1248,"name":1249},"michael-ploed","Michael Plöd",{"slug":1251,"name":1252},"mies","Marius Mies",{"slug":1254,"name":1255},"mihai","Alina Mihai",{"slug":1257,"name":1258},"moeller","Jörg Möller",{"slug":1260,"name":1261},"mohr","Rebecca Mohr",{"slug":1263,"name":1264},"moretti","David Moretti",{"slug":1266,"name":1267},"mueller","Sven Müller",{"slug":1269,"name":1270},"muessig","Alexander Müssig",{"slug":1272,"name":1273},"neupokoev","Grigory Neupokoev",{"slug":1275,"name":1276},"nussbaecher","Carmen Nussbächer",{"slug":1278,"name":1279},"ochs","Pascal Ochs",{"slug":1281,"name":1282},"oelhoff","Jan Oelhoff",{"slug":1284,"name":1285},"oengel","Yasin Öngel",{"slug":1287,"name":1288},"oezsoy","Enis Özsoy",{"slug":1290,"name":1291},"posch","Maya Posch",{"slug":1293,"name":1294},"ralfmueller","Ralf Müller",{"slug":1296,"name":1296},"redakteur",{"slug":1298,"name":1299},"reich","Michael Reich",{"slug":1301,"name":1302},"reinhard","Karl-Ludwig Reinhard",{"slug":1304,"name":1305},"rmueller","Rebecca Müller",{"slug":1307,"name":1308},"rosum","Jan Rosum",{"slug":1310,"name":1310},"rueckert",{"slug":1312,"name":1313},"ruessel","Sascha Rüssel",{"slug":1315,"name":1316},"sauter","Moritz Sauter",{"slug":1318,"name":1319},"schaefer","Julian Schäfer",{"slug":1321,"name":1322},"scherer","Petra Scherer",{"slug":1324,"name":1325},"schlicht","Anne Schlicht",{"slug":1327,"name":1328},"schmidt","Jürgen Schmidt",{"slug":1330,"name":1331},"schneider","Tobias Schneider",{"slug":1333,"name":1334},"seber","Benjamin Seber",{"slug":1336,"name":1337},"sommer","Marc Sommer",{"slug":1339,"name":1340},"speaker-fels","Jakob Fels",{"slug":1342,"name":1343},"speaker-gierke","Oliver Gierke",{"slug":1345,"name":1346},"speaker-krupa","Malte Krupa",{"slug":1348,"name":1349},"speaker-mader","Jochen Mader",{"slug":1351,"name":1352},"speaker-meusel","Tim Meusel",{"slug":1354,"name":1355},"speaker-milke","Oliver Milke",{"slug":1357,"name":1358},"speaker-paluch","Mark Paluch",{"slug":1360,"name":1361},"speaker-schad","Jörg Schad",{"slug":1363,"name":1364},"speaker-schalanda","Jochen Schalanda",{"slug":1366,"name":1367},"speaker-schauder","Jens Schauder",{"slug":1369,"name":1370},"speaker-unterstein","Johannes Unterstein",{"slug":1372,"name":1373},"speaker-wolff","Eberhard Wolff",{"slug":1375,"name":1376},"speaker-zoerner","Stefan Zörner",{"slug":1378,"name":1379},"stefan-belger","Stefan Belger",{"slug":1381,"name":1382},"steinegger","Roland Steinegger",{"slug":1384,"name":1385},"stern","sternchen synyx",{"slug":1387,"name":1387},"synyx",{"slug":1389,"name":1390},"szulc","Mateusz Szulc",{"slug":1392,"name":1393},"tamara","Tamara Tunczinger",{"slug":1395,"name":1396},"theuer","Tobias Theuer",{"slug":1398,"name":1399},"thieme","Sandra Thieme",{"slug":1401,"name":1402},"thies-clasen","Marudor",{"slug":1404,"name":1405},"toernstroem","Olle Törnström",{"slug":1407,"name":1408},"ullinger","Max Ullinger",{"slug":1410,"name":1411},"ulrich","Stephan Ulrich",{"slug":1413,"name":1414},"wagner","Stefan Wagner",{"slug":1416,"name":1417},"weigel","Andreas Weigel",{"slug":1419,"name":1420},"werner","Fabian Werner",{"slug":1422,"name":1423},"wolke","Sören Wolke",["Reactive",1425],{"$scookieConsent":1426,"$ssite-config":1428},{"functional":1427,"analytics":1427},false,{"_priority":1429,"env":1433,"name":1434,"url":1435},{"name":1430,"env":1431,"url":1432},-10,-15,0,"production","nuxt-app","https://synyx.de",["Set"],["ShallowReactive",1438],{"category-annotation":-1,"authors":-1},"/blog/tags/annotation"]