public
Description: Exporting JMX mbeans made easy
Homepage:
Clone URL: git://github.com/martint/jmxutils.git
name age message
file .gitignore Tue Sep 29 22:45:15 -0700 2009 initial impl [Martin Traverso]
file README.md Fri Oct 02 16:49:07 -0700 2009 implement inheritance of @Managed annotation [Martin Traverso]
file jmxutils.iml Fri Oct 09 09:16:47 -0700 2009 target java 1.5 [Martin Traverso]
file jmxutils.ipr Fri Oct 09 09:16:47 -0700 2009 target java 1.5 [Martin Traverso]
file pom.xml Sun Nov 01 21:55:50 -0800 2009 fixed url for snapshot repo [Martin Traverso]
directory src/ Mon Nov 02 11:58:21 -0800 2009 Added comment [electrum]
README.md

Example

class ManagedObject
{
    @Managed
    public int getValue()
    {
       ...
    }

    @Managed
    public void setValue(int value)
    {
       ...
    }

    @Managed(description="do the operation")
    public void operation()
    {
       ...
    }
}

...
MBeanExporter exporter = new MBeanExporter(ManagementFactory.getPlatformMBeanServer());
exporter.export("test:name=X", new ManagedObject());

Guice support

Injector injector = Guice.createInjector(
            new MBeanModule() {
                @Override
                protected void configureMBeans()
                {
                    export(ManagedObject.class).as("test:name=X");
                    export(ManagedObject.class).annotatedWith(SomeAnnotation.class).as("test:name=Y");
                }
            }, ...);

License

Licensed under the Apache License, Version 2.0 (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.