-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: I developed an improvment for HB JMX Service. What do I do?
PostPosted: Sun Sep 02, 2007 9:52 am 
Newbie

Joined: Sun Jul 10, 2005 10:20 am
Posts: 17
Location: London
Hi, I was faced with the problem of declaring an HB SessionFactory as a JMX service (using the HibernateService class) but I was impossibilitated from declaring mapped classes. Basically as it stands at the moment, the HibernateService MBean allows only to specify a mapResources property which is a comma separated list of .hbm.xml files. I changed the current service in order to allow another property (mappedClasses) which allows a comma separated list of @Entity classes which are loaded and mapped at runtime. It would be nice if this change would be included in future versions of Hibernate. This change involved the following:

1) To add two extra methods in the org.hibernate.jmx.HibernateServiceMBean interface (getter/setter for the new property)

2) To add another String attribute to org.hibernate.util.ExternalSessionFactoryConfig to contain the additional property

3) To create a new ConfigurationFactory class which creates standard configurations (Configuration) or configurations which support annotations (AnnotationConfiguration) depending if the new property contains any values (this property is mutually exclusive with the mapResources one)

The drawback is that AnnotationConfiguration is part of the hibernate-annotations artifact, so in order for this change to work, hibernate-annotations should be included in the hibernate/lib folder, introducing a dependency that maybe is unwanted. If you guys find a better way, feel free to change things around


As I said it would be nice to have this feature in the next HB release, so I'm happy to post/attach the code I've changed, just let me know how could I do that.

Don't know if I've got credit or if this post will be read, but if you have got the power to change things, to have the change please feel free to email me at: mtedone at jemos.co.uk or if I can attach the changes here, please just tell me how to do so.

Cheers.

M.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 03, 2007 10:01 am 
Newbie

Joined: Mon Dec 03, 2007 9:53 am
Posts: 12
Hi,

As for most open source projects, you should file a JIRA. Attaching a patch should improve the likelyhood of it being implemented.

However, in my opinion, a dependency to hibernate-annotations is not acceptable as it would make Java SE 5 a requirement for Hibernate Core (which it isn't today).

/Anders


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.