[hibernate-dev] Jandex 2.0 Beta - Java 8 Type Annotations, Generics, & Offline Reflection

Sanne Grinovero sanne at hibernate.org
Tue Dec 2 08:13:58 EST 2014


It looks awesome! but to be able to use it we also need to take these
requirements in consideration:
 - users running in different containers than WildFly
 - users not running in any container at all
 - Hibernate Search integrators which are not based on ORM: running in
WildFly but not having the benefit of an EntityManager based bootstrap
where the container can "inject" a reference to the index; how do we
get the index from the application server there?
 - integrators running anywhere (WildFly but not only) which today
need to add new entity types "on the fly" at runtime (after the
bootstrap was completed).

I guess that's possible?

We could also change one point dramatically: with Infinispan Query the
reason for it to need adding new types "on the fly" is just because
there is no reasonable solution for a full annotation scanning. But
having this we might be able to simplify some code in Search by
actually expecting to have a comprehensive list of types at bootstrap
through Jandex, then we can remove some of the code to do "on the fly"
type registration.

I'm saying that we could remove some of the code because with dynamic
types coming, we'll still want to make it possible to define new types
dynamically.. so we wouldn't be able to remove all complexity but it
still seems a good progress.

Sanne


On 2 December 2014 at 10:29, Hardy Ferentschik <hardy at hibernate.org> wrote:
> Hi,
>
>> > In Search we have been talking for a long time to get rid of Commons
>> > Annotations. It is basically already possible
>> > now (using Jandex 1), but it got pushed back so far. Now with Jandex 2 we
>> > definitely should make the switch. Maybe Search 5.1?
>> >
>>
>> Out of interest, what would be the benefit for Search?
>
> Getting rid of Commons Annotations. That is a long standing task. The annotation
> processing code could be simplified a fair bit in this case.
>
> The other advantage would be that in the case where Search is running in the container,
> we could just take an existing Jandex index at bootstrap (instead of building one ourselves).
> This would give a bit of boot speed-up.
>
>> > Last but not least Validator, there we have been talking about Jandex for
>> > a while as well. The new version would not have
>> > the benefit of being able to remove the dependency to classmate.
>>
>> I guess you mean it *would have* the benefit, right?
>
> sure :-)
>
>> Of course that comes at the price of adding another dependency, so that's
>> not really an advantage per se for me :)
>
> Not per se, but we already talked about consuming a Jandex index as part of the
> Bean Validation integration into Wildfly using CDI. In fact you seemed to be quite
> keen back then to give it a go. Now we could do it without increasing the amount of
> dependencies.
>
>> I think we should have a look at this Beta and provide feedback to Jason if
>> > we find any problems. I am for sure to have a look
>> > at it in the context of Validator.
>> >
>>
>> I find being able to re-use the index generated by the application
>> container very useful. It would give a nice performance boost out of the
>> box when using HV on WildFly/EAP.
>
> Exactly.
>
>> The type annotation stuff may be useful, but it's not that this information
>> cannot be accessed via reflection at all. There are known issues with
>> corner cases, though. So Jandex may improve the situation for us.
>
> My hope is that code would be simpler by using a single library for doing all
> reflection stuff including Java 8 type annotations, generic type resolution, etc
>
>> I'm asking to make sure we're on the same page regarding what we expect
>> from using Jandex in terms of user-visible features/improvements.
>
> Right, this is not about adding new features for the user. The user might get some
> speed-up and maybe less memory consumption, but otherwise we are talking about
> internal changes.
>
> --Hardy
>
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev


More information about the hibernate-dev mailing list