You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Issac Garcia (JIRA)" <ji...@apache.org> on 2012/10/03 10:36:07 UTC

[jira] [Created] (FELIX-3699) Allow annotations to handle custom component definitions.

Issac Garcia created FELIX-3699:
-----------------------------------

             Summary: Allow annotations to handle custom component definitions.
                 Key: FELIX-3699
                 URL: https://issues.apache.org/jira/browse/FELIX-3699
             Project: Felix
          Issue Type: New Feature
          Components: iPOJO
            Reporter: Issac Garcia


Custom components are well handled in iPOJO using the metadata.xml, for example:

<CustomComponent classname="MyClass" name="myCustomComponent">
    <requires field="service"/>
</CustomComponent>

The custom component definition will, for example, add handlers and so on. It works very well and is nice that iPOJO allows that kind of extensions. 

But we can't declare a custom component by using annotations, for example doing:

@CustomComponent
public class MyClass {...}

It will be a nice if iPOJO allows to do it using annotations, since the same functionality must be possible with the metadata.mxl and with annotations.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3699) Allow annotations to handle custom component definitions.

Posted by "Issac Garcia (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480683#comment-13480683 ] 

Issac Garcia commented on FELIX-3699:
-------------------------------------

In that case, it should work your proposition.

I'll be waiting this new feature.

I can test it as soon as it becomes available in the development version
 Thanks
                
> Allow annotations to handle custom component definitions.
> ---------------------------------------------------------
>
>                 Key: FELIX-3699
>                 URL: https://issues.apache.org/jira/browse/FELIX-3699
>             Project: Felix
>          Issue Type: New Feature
>          Components: iPOJO
>            Reporter: Issac Garcia
>
> Custom components are well handled in iPOJO using the metadata.xml, for example:
> <CustomComponent classname="MyClass" name="myCustomComponent">
>     <requires field="service"/>
> </CustomComponent>
> The custom component definition will, for example, add handlers and so on. It works very well and is nice that iPOJO allows that kind of extensions. 
> But we can't declare a custom component by using annotations, for example doing:
> @CustomComponent
> public class MyClass {...}
> It will be a nice if iPOJO allows to do it using annotations, since the same functionality must be possible with the metadata.mxl and with annotations.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3699) Allow annotations to handle custom component definitions.

Posted by "Issac Garcia (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13471497#comment-13471497 ] 

Issac Garcia commented on FELIX-3699:
-------------------------------------

It should work to start using this functionality, 

I was thinking if it is possible to annotate our annotations to specify that they are ipojo components, for example:

@ipojonize
public @interface MyComponent {...}

And while manipulating, see if the custom annotation is described to manipulate the class.

Another option could be using default values to see if it is a custom component or not, for example: 

public @interface MyComponent {
  Boolean ipojonize() default true;
  ...
}

If not, your solutions could work anyway
Even if we want to minimize the configuration for the developer as much as possible.
In that case, we'll check what is the best approach:
to have a predefined parent pom with the componentAnnotation configured, 
or see if the maven-inherit-plugin allows us to extend the iPOJO plugin to configure it and hide this configuration for the developers of our custom components.


What do you think?


                
> Allow annotations to handle custom component definitions.
> ---------------------------------------------------------
>
>                 Key: FELIX-3699
>                 URL: https://issues.apache.org/jira/browse/FELIX-3699
>             Project: Felix
>          Issue Type: New Feature
>          Components: iPOJO
>            Reporter: Issac Garcia
>
> Custom components are well handled in iPOJO using the metadata.xml, for example:
> <CustomComponent classname="MyClass" name="myCustomComponent">
>     <requires field="service"/>
> </CustomComponent>
> The custom component definition will, for example, add handlers and so on. It works very well and is nice that iPOJO allows that kind of extensions. 
> But we can't declare a custom component by using annotations, for example doing:
> @CustomComponent
> public class MyClass {...}
> It will be a nice if iPOJO allows to do it using annotations, since the same functionality must be possible with the metadata.mxl and with annotations.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3699) Allow annotations to handle custom component definitions.

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470935#comment-13470935 ] 

Clement Escoffier commented on FELIX-3699:
------------------------------------------

Hi,

Would it be acceptable in your use case to configure the manipulator with the annotation ?

Something like:

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-ipojo-plugin</artifactId>
    <version>...</version>
    <configuration>
        <componentAnnotations>your.company.new.annotation,your.company.new.annotation2</componentAnnotations>     <!-- comma separated list -->
    </configuration>
</plugin>

We can map all attributes of the annotation to iPOJO's element attributes.



                
> Allow annotations to handle custom component definitions.
> ---------------------------------------------------------
>
>                 Key: FELIX-3699
>                 URL: https://issues.apache.org/jira/browse/FELIX-3699
>             Project: Felix
>          Issue Type: New Feature
>          Components: iPOJO
>            Reporter: Issac Garcia
>
> Custom components are well handled in iPOJO using the metadata.xml, for example:
> <CustomComponent classname="MyClass" name="myCustomComponent">
>     <requires field="service"/>
> </CustomComponent>
> The custom component definition will, for example, add handlers and so on. It works very well and is nice that iPOJO allows that kind of extensions. 
> But we can't declare a custom component by using annotations, for example doing:
> @CustomComponent
> public class MyClass {...}
> It will be a nice if iPOJO allows to do it using annotations, since the same functionality must be possible with the metadata.mxl and with annotations.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3699) Allow annotations to handle custom component definitions.

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480673#comment-13480673 ] 

Clement Escoffier commented on FELIX-3699:
------------------------------------------

@Guillaume : This looks pretty interesting, but it's a big features, probably for the 1.8.6 and not 1.8.4 (which will be relaased soon)

@Issac: the problem is that the manipulator must not load classes, this is because you don't know in which environment it's executed. So unfortunately, I can't load the annotations. We're working on that in iPOJO 2.0, but until this release, we will have to handle classes as strings. 
                
> Allow annotations to handle custom component definitions.
> ---------------------------------------------------------
>
>                 Key: FELIX-3699
>                 URL: https://issues.apache.org/jira/browse/FELIX-3699
>             Project: Felix
>          Issue Type: New Feature
>          Components: iPOJO
>            Reporter: Issac Garcia
>
> Custom components are well handled in iPOJO using the metadata.xml, for example:
> <CustomComponent classname="MyClass" name="myCustomComponent">
>     <requires field="service"/>
> </CustomComponent>
> The custom component definition will, for example, add handlers and so on. It works very well and is nice that iPOJO allows that kind of extensions. 
> But we can't declare a custom component by using annotations, for example doing:
> @CustomComponent
> public class MyClass {...}
> It will be a nice if iPOJO allows to do it using annotations, since the same functionality must be possible with the metadata.mxl and with annotations.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3699) Allow annotations to handle custom component definitions.

Posted by "Guillaume Sauthier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13471479#comment-13471479 ] 

Guillaume Sauthier commented on FELIX-3699:
-------------------------------------------

Isn't it possible to have some kind of mapping for handler annotations as well ?
I'm thinking about the Karaf @Command annotation that I would like to traet as a marker for including my own handler.

{noformat}
<configuration>
  <handlers>
    <handler>
      <annotation>javax.inject.Inject</annotation>
      <handler>my.company.atinject:atinject</handler>
    </handler>
  </handlers>
</configuration>
{noformat}

Could be even better if the maven based manipulator could use the maven components in order to provide all theses descriptions ?
We would have to provide an extension API for describing handlers/component-factories
{noformat}
<plugin>
  <!-- ... -->
  <dependencies>
    <dependency>
      <groupId>my.company.ipojo<groupId>
      <artifactId>additional-handlers<artifactId>
    </dependency>
  </dependencies>
</plugin>
{noformat}

Hmmm, maybe that's a bit outside the scope of this issue :) ?
                
> Allow annotations to handle custom component definitions.
> ---------------------------------------------------------
>
>                 Key: FELIX-3699
>                 URL: https://issues.apache.org/jira/browse/FELIX-3699
>             Project: Felix
>          Issue Type: New Feature
>          Components: iPOJO
>            Reporter: Issac Garcia
>
> Custom components are well handled in iPOJO using the metadata.xml, for example:
> <CustomComponent classname="MyClass" name="myCustomComponent">
>     <requires field="service"/>
> </CustomComponent>
> The custom component definition will, for example, add handlers and so on. It works very well and is nice that iPOJO allows that kind of extensions. 
> But we can't declare a custom component by using annotations, for example doing:
> @CustomComponent
> public class MyClass {...}
> It will be a nice if iPOJO allows to do it using annotations, since the same functionality must be possible with the metadata.mxl and with annotations.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (FELIX-3699) Allow annotations to handle custom component definitions.

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480673#comment-13480673 ] 

Clement Escoffier edited comment on FELIX-3699 at 10/20/12 8:01 AM:
--------------------------------------------------------------------

@Guillaume : This looks pretty interesting, but it's a big features, probably for the 1.8.6 and not 1.8.4 (which will be released soon)

@Issac: the problem is that the manipulator must not load classes, this is because you don't know in which environment it's executed. So unfortunately, I can't load the annotations. We're working on that in iPOJO 2.0, but until this release, we will have to handle classes as strings. 
                
      was (Author: clement.escoffier):
    @Guillaume : This looks pretty interesting, but it's a big features, probably for the 1.8.6 and not 1.8.4 (which will be relaased soon)

@Issac: the problem is that the manipulator must not load classes, this is because you don't know in which environment it's executed. So unfortunately, I can't load the annotations. We're working on that in iPOJO 2.0, but until this release, we will have to handle classes as strings. 
                  
> Allow annotations to handle custom component definitions.
> ---------------------------------------------------------
>
>                 Key: FELIX-3699
>                 URL: https://issues.apache.org/jira/browse/FELIX-3699
>             Project: Felix
>          Issue Type: New Feature
>          Components: iPOJO
>            Reporter: Issac Garcia
>
> Custom components are well handled in iPOJO using the metadata.xml, for example:
> <CustomComponent classname="MyClass" name="myCustomComponent">
>     <requires field="service"/>
> </CustomComponent>
> The custom component definition will, for example, add handlers and so on. It works very well and is nice that iPOJO allows that kind of extensions. 
> But we can't declare a custom component by using annotations, for example doing:
> @CustomComponent
> public class MyClass {...}
> It will be a nice if iPOJO allows to do it using annotations, since the same functionality must be possible with the metadata.mxl and with annotations.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira