You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Clement Escoffier (JIRA)" <ji...@apache.org> on 2008/11/20 18:00:49 UTC

[jira] Resolved: (FELIX-825) Provide annotation for iPojo JMX Handler

     [ https://issues.apache.org/jira/browse/FELIX-825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier resolved FELIX-825.
-------------------------------------

    Resolution: Fixed

Fixed at revision 719260.

The annotations are provided in the annotation artifact, and require the latest iPOJO manipulator (trunk version). Here is an example of usage:
import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.handlers.jmx.Config;
import org.apache.felix.ipojo.handlers.jmx.Method;
import org.apache.felix.ipojo.handlers.jmx.Property;

@Component
@Config(domain="my-domain", usesMOSGi=false)
public class JMXSimpleMBean {

    @Property(name="prop", notification=true, rights="w")
    String m_foo;
    
    @Method(description="set the foo prop")
    public void setFoo(String mes) {
        System.out.println("Set foo to " + mes);
        m_foo = mes;
    }
    
    @Method(description="get the foo prop")
    public String getFoo() {
        return m_foo;
    }
}

I'll update the web site documentation ASAP.


> Provide annotation for iPojo JMX Handler
> ----------------------------------------
>
>                 Key: FELIX-825
>                 URL: https://issues.apache.org/jira/browse/FELIX-825
>             Project: Felix
>          Issue Type: Improvement
>          Components: iPOJO
>    Affects Versions: iPOJO-1.0.0
>         Environment: JRE 6 / Windows
>            Reporter: David GAY
>            Assignee: Clement Escoffier
>            Priority: Minor
>
> Could it be possible to provide annotations for iPojo JMX Handler like for example others annotations like @Component, @Provides, etc...
> It would be *very* nice to have full annotated pojo, instead of mixing basic iPojo annotation and XML configuration.
> For exemple :
> @Component(name="myComponent")
> @Provides()
> @JmxConfig(objectName="my.object.name:type=myType")
> public class MyServiceImpl implements MyService
> {
>     @JmxProperty(field="...",name="...",notification=true,right="r")
>     public boolean myProperty = false;
>     @JmxMethod(name="...",description="...")
>     public void enabledMyProperty()
>     {
>         myProperty = true;
>     }
>     
>     @JmxMethod(....)
>     public void disabledMyProperty()
>     {
>         myProperty = false;
>     }
>     //etc...
> }
> Regards.
> David

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.