avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Holger Hoffstätte (Commented) (JIRA) <j...@apache.org>
Subject [jira] [Commented] (AVRO-987) Make Avro OSGi ready
Date Thu, 05 Jan 2012 20:32:39 GMT

    [ https://issues.apache.org/jira/browse/AVRO-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13180818#comment-13180818
] 

Holger Hoffstätte commented on AVRO-987:
----------------------------------------

I'm still on vacation for another week but wanted to add a few quick comments (I'll gladly
expand when I'm back). I'm really very happy to see this effort and am willing to help, but
the current way outlined in this patch is somewhat naive and has several problems that will
create more problems in the long run, from basic runtime correctness to maintenance.

* Scott already mentioned the missing ClassLoadingUtils but we should probably not use them
anyway (simply replace forName with loadClass instead).
* the dependencies esp. in the ipc "module" are weakly defined: "optional" imports are a cop-out
and make random ClassNotFound errors even harder to diagnose, as they have arbitrary semantics
("put stuff on the classpath and pray") and miss the whole point behind the OSGi interaction
model.
* I found at least one typo in the pom for avro ("resultion")
* adding additional behaviour using the TTCL makes things fragile without benefit and introduces
different (and most notable new) client-side behaviour.

OSGi contains several very small and very easy to use ways to enable proper classloading and
even dynamics; these can be adopted gradually and most of the time with very few changes (see
[1] and [2]). Just sprinkling optional imports all over the place is comparable to adding
"synchronized" to a randomly exploding codebase and hoping for the best.

So please don't rush the party and let's first outline what the problems are. There are also
security and versioning aspects to consider.

[1] http://njbartlett.name/2010/08/24/osgi-compliance-levels.html
[2] http://njbartlett.name/2010/08/30/osgi-readiness-loading-classes.html

                
> Make Avro OSGi ready
> --------------------
>
>                 Key: AVRO-987
>                 URL: https://issues.apache.org/jira/browse/AVRO-987
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>            Reporter: Ioannis Canellos
>         Attachments: AVRO-987-patch.txt
>
>
> It would be really nice to be able to use Avro inside OSGi. To achieve this two things
are required:
> i) Provide proper MANIFEST.MF.
> ii) Deal with potential class loading issues. Avro uses Class.forName a lot and that
is not very OSGi friendly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message