JMXは面倒臭い

1年半前,Apache Jakarta の Commonsを調査していた時,"Modeler"というパッケージに出くわした.当時はJMXなんて知る由も無く(というかModelerの説明書きを読んでJMXの存在を知った),Model MBeanを作成しやすくなるツールとの説明を読んでも,イマイチよくわからん,という感じだった.

The Modeler Component

Java Management Extensions (JMX) is an API that facilitates building management applications that can configure, and perform operations on, a server application. In general, each manageable component of the server application is represented by a Management Bean (or MBean, for short). JMX defines three types of MBeans, of which Model MBeans are the most flexible. Model MBeans provide a way to define MBeans for many different components, without having to write a specific MBean implementation class for each one.

However, this power comes at a price. It is necessary to set up a substantial amount of metadata about each MBean, including the attributes it should expose (similar to JavaBeans properties), the operations it should make available (similar to calling methods of a Java object via reflection), and other related information. The Modeler component is designed to make this process fairly painless -- the required metadata is configured from an XML description of each Model MBean to be supported. In addition, Modeler provides a factory mechanism to create the actual Model MBean instances themselves.

引用:http://jakarta.apache.org/commons/modeler/

今は違うね.Model MBeanよりももっと簡単に作れる筈の,Dynamic MBeanで既にめんどくさい状態っす・・・.

プロパティ5つ,外部公開メソッド数3つしかないようなMBeanとかでも,Metadataの記述コードとか,既にすげー多いんですが.止まらないミドルウェアを作るって大変なんだと,実感.

使う側は楽だけどなっ!