THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Once your handler has been declared, you can use it in iPOJO components. To do so, you first have to be bound to your handler's namespace (using standard XML namespace declaration). Then you can configure the handler in your components type description. An example of bundle's metadata.xml
declaring components using the handler is shown hereafter :
Code Block | ||||
---|---|---|---|---|
| ||||
<ipojo xmlns:your-shortcut="the.namespace.of.your.handler"> ... <component className="your.component.class"> ... <your-shortcut:HandlerName param1="value1" ...> <!-- Configuration of your handler for this component type --> </your-shortcut{noformat}:HandlerName> ... </component> ... </ipojo> |
...
will be translated to:
Code Block | ||||
---|---|---|---|---|
| ||||
component { $classname="org.apache.felix.ipojo.test.scenarios.component.jmx.JMXSimple" $public="true" $name="org.apache.felix.ipojo.test.scenarios.component.jmx.JMXSimple" org.apache.felix.ipojo.handlers.jmx:config { $usesmosgi="false" $domain="my-domain" org.apache.felix.ipojo.handlers.jmx:property { $rights="w" $notification="true" $field="m_foo" $name="prop" } org.apache.felix.ipojo.handlers.jmx:method { $description="set the foo prop" $method="setFoo" } org.apache.felix.ipojo.handlers.jmx:method { $description="get the foo prop" $method="getFoo" } } } |
...