Bindings, Platforms, and Innovation
This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.
Tracking change and innovation in the enterprise software development community
Posted by Werner Schuster on Jun 29, 2007 07:00 AM
One of the benefits of running on a mature platform such as Java is the availability of, well, mature features such as monitoring. Ola Bini, JRuby Core team member, found this to be useful for monitoring the memory behavior of a JRuby application:You get this for free, just by running JRuby with Java 6. You can attach to any Java process at all. Remotely too. And get this kind of information. Can your Ruby do that?The tool he used to monitor the JVM process was JConsole, which has been shipped with Java since version 5. Another way of accessing JMX information is now available: jmx4r by Jeff Mesnil allows to access JMX MBeans from JRuby code. Here a simple example:
require 'java'This connects to an MBean server on localhost with default connection parameters, but it's possible to use a custom JMX Service URL as well.
require 'jmx4r'
memory = JMX::MBean.find_by_name "java.lang:type=Memory"
memory.verbose = true
memory.gc
memory.verbose is an attribute which would normally have to be set with a verbose JMX method call. Jmx4r sets up an accessors in the class that represents the memory MBean. Information about the MBean is fetched and define_method is used to create the necessary methods for every attribute.method_missing, which is called when no method definition for a method call can be found. In the sample, memory.gc is a call to the Memory MBean's operation that runs the Garbage Collector - but such a method is not defined in the class of the memory object. Instead, the method_missing method is invoked, determines if there is an operation for this method name, and then invokes it using JMX APIs. logging = JMX::MBean.find_by_name "java.util.logging:type=Logging"
logging.logger_names.each do |logger_name|
logging.set_logger_level logger_name, "INFO"
end
JMX::MBean.establish_connection :host => "localhost",
:username => "jeff", :password => "secret"
Download the Free Adobe® Flex® Builder 3 Trial
Adobe® Rich Internet Application Project Portal
Effective Management of Static Analysis Vulnerabilities and Defects
This post is interesting. I was also watching Rich Kilmer the other day. Reference: Rich Kilmer on the Power of Ruby, and I was really intrigued by Ruby's features. I haven't used Ruby so far..
Rich says:
they wanted to be able to freeze these 300 JVM's at once.
I had a Ruby process that was running all 300 VM's were underneath it, and I could freeze it in about a half of second. All 300 of them.
To be fair, the metaprogramming ideas, like that find_by_name example, had come from Aaron Batalion's post
Werner, thanks for the article! The real work was already done by JMX and JRuby guys: I just needed to put a little glue to bind everything required to write simple management scripts in Ruby. Val, to be fair, I implemented the metaprogramming parts to glue JRuby with JMX without knowing about Aaron code[1] (he used missing_method for attributes while I went the define_method way for them). However once I saw his post, I took his better syntax to make the code looks like Ruby/Rails[2] rather than Java. [1] http://jmesnil.net/weblog/2007/05/31/jmx-scripts-using-jruby-part-ii/ [2] http://revolutiononrails.blogspot.com/2007/05/ruby-esque-jmx-part-2.html
This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.
This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.
This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.
This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.
This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.
After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.
IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.
Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.
3 comments
Watch Thread Reply