db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig L Russell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-668) Extend PersistenceManageFactory to find a Class
Date Fri, 29 Oct 2010 17:17:23 GMT

    [ https://issues.apache.org/jira/browse/JDO-668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12926357#action_12926357

Craig L Russell commented on JDO-668:

You are right that it is not straightforward to resolve a class name to a class instance.
As you point out, OSGi can dynamically add and remove class loaders. The application itself
can dynamically add and remove class loaders. 

JDO has always been organized such that it is up to the application to arrange for classes
to be loaded and then the classes or instances of classes are passed to the implementation.

I think it is still appropriate for JDO to require that the application arrange for class
loading. So I recommend we reject this feature request.

> Extend PersistenceManageFactory to find a Class
> -----------------------------------------------
>                 Key: JDO-668
>                 URL: https://issues.apache.org/jira/browse/JDO-668
>             Project: JDO
>          Issue Type: New Feature
>          Components: api, specification, tck
>    Affects Versions: JDO 3
>            Reporter: Marco
> The meta-data-related methods in PersistenceManagerFactory work with Strings (fully qualified
class-names) instead of classes. This includes the new method requested in JDO-667.
> However, to actually do sth. (e.g. create a new query or get an extent), a java.lang.Class
is required. In some environments (e.g. OSGi), class-loading is not trivial and it is therefore
not so easy to get the right java.lang.Class (i.e. the same as used by the JDO implementation)
for a certain class-name.
> Since the JDO implementation needs to be able to load the right classes, anyway, the
class-loading must already be solved somehow (e.g. by an OSGi-aware class-loader). It should
therefore be easy to expose the method used by the JDO implementation for class-loading.
> For these reasons, I kindly request the following new method in PersistenceManagerFactory:
> Class<?> getManagedClass(String className)

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

View raw message