This content has been marked as final.
Show 8 replies
-
1. Re: Registering schema with JBossXB
alesj Mar 26, 2008 4:38 PM (in response to alesj)"alesj" wrote:
But should there be a remove/unregister on uninstall of deployer?
Looking at DefaultSchemaResolver.
Shouldn't this/** Namespace to JBossXBBuilder binding class */ private WeakHashMap<String, Class> uriToClass = new WeakHashMap<String, Class>(); /** SchemaLocation to JBossXBBuilder binding class */ private WeakHashMap<String, Class> schemaLocationToClass = new WeakHashMap<String, Class>();
be WeakValueHashMap? -
2. Re: Registering schema with JBossXB
adrian.brock Mar 27, 2008 8:57 AM (in response to alesj)"alesj" wrote:
"adrian@jboss.org" wrote:
I guess we could add an extra option to the SchemaResolverParser<propertry name="registerWithJBossXB">true</property>
which would take the schema name from the annotation on the class/package
and register the generated schema binding with JBossXB?
This is now done, see SchemaResolverXBTestCase.
But should there be a remove/unregister on uninstall of deployer?
Yes. -
3. Re: Registering schema with JBossXB
adrian.brock Mar 27, 2008 8:58 AM (in response to alesj)"alesj" wrote:
"alesj" wrote:
But should there be a remove/unregister on uninstall of deployer?
Looking at DefaultSchemaResolver.
Shouldn't this/** Namespace to JBossXBBuilder binding class */ private WeakHashMap<String, Class> uriToClass = new WeakHashMap<String, Class>(); /** SchemaLocation to JBossXBBuilder binding class */ private WeakHashMap<String, Class> schemaLocationToClass = new WeakHashMap<String, Class>();
be WeakValueHashMap?
No. Because nothing will be holding a reference to the class other than the
resolver normally. Therefore it would get garbage collected and the config removed. -
-
5. Re: Registering schema with JBossXB
alesj Mar 27, 2008 9:05 AM (in response to alesj)"adrian@jboss.org" wrote:
No. Because nothing will be holding a reference to the class other than the
resolver normally. Therefore it would get garbage collected and the config removed.
Yeah, I've though of that.
But in the case when deployers register it, they also hold a ref to metadata class.
OK, but they can do its own clean up, like mentioned before.
btw: who then holds the ref to the namespace string key? -
6. Re: Registering schema with JBossXB
adrian.brock Mar 27, 2008 9:12 AM (in response to alesj)"alesj" wrote:
"adrian@jboss.org" wrote:
No. Because nothing will be holding a reference to the class other than the
resolver normally. Therefore it would get garbage collected and the config removed.
Yeah, I've though of that.
But in the case when deployers register it, they also hold a ref to metadata class.
OK, but they can do its own clean up, like mentioned before.
btw: who then holds the ref to the namespace string key?
You do in the parser (or you work it out again). -
7. Re: Registering schema with JBossXB
alesj Mar 27, 2008 9:22 AM (in response to alesj)"adrian@jboss.org" wrote:
You do in the parser.
Meaning I should put a ref on the namespace string I get of JBossXmlSchema?"adrian@jboss.org" wrote:
(or you work it out again).
"Suck it and see" who's holding the ref? -
8. Re: Registering schema with JBossXB
alesj Apr 10, 2008 8:06 AM (in response to alesj)"alesj" wrote:
btw: who then holds the ref to the namespace string key?
OK, this - to have WeakHashMap on the string key - is a bug then. ;-)
See SingletonSchemaResolverFactory constructor.