persistence@glassfish.java.net

Re: Pluggable arcive factory

From: Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM>
Date: Mon, 22 Jan 2007 12:11:07 +0530

Hi Shaane,

Have you actually experimented with the changes? Do you want to file a
feature request in GlassFish issue tracker?

Thanks,
Sahoo
Sha-né wrote:
> Hello Sanjeeb,
>
> You are right.
> 1. I was talking about
> entity-persistence/src/java/oracle/toplink/essentials/ejb/cmp3/persistence/ArchiveFactoryImpl.java.
>
> 2. Yes, we do not need to replace the archive factory for new URLs/URL
> types (we could use jar-file elements or URLStreamHandlerFactory for
> that).
>
> We are working on a portal application that ships with some common
> entities. The users can write custom extensions to the portal and
> deploy them independently. These custom extensions can have entities
> that have relationships with our base entities (as you can imagine
> with some restrictions). For such relationships to work, the extension
> entities have to be in the same persistence unit as the base entities.
> Seaching the archives, we found that merging of persistence units is
> not supported
> (https://glassfish.dev.java.net/servlets/BrowseList?list=persistence&by=thread&from=623961).
>
>
> The recommended solution was to merge it during build time. However,
> in our case, asking customers to modify the persistence.xml for our
> archive (to add their entities) seems like a pain. If we could replace
> the ArchiveFactory, the call to load the persistence.xml stream would
> be handled by us. We could then create an aggregate persistence.xml
> for the portal persistence unit and return that.
>
> Thanks,
> Shaane
>
> On 1/22/07, Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_sun.com> wrote:
>> Hi Shaane,
>>
>> I guess you are referring to
>> entity-persistence/src/java/oracle/toplink/essentials/ejb/cmp3/persistence/ArchiveFactoryImpl.java.
>>
>> You have made a good point. The current implementation can be changed
>> very easily to make use of Services API. I never anticipated a
>> requirement for user to extend the implementation for new URL or Archive
>> types. May I know what kind of URL or Archive structure do you wish to
>> handle that the current implementation does not handle?
>>
>> Thanks,
>> Sahoo
>>
>> Sha-né wrote:
>> > Hello all,
>> >
>> > Would it be possible to make the ArchiveFactoryImpl pluggable? We
>> > could use the Service Provider mechanism
>> >
>> (http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider)
>>
>> > to plugin a new type of ArchiveFactory. This would allow us to plugin
>> > new types of Archive impls customized to our project source structure.
>> >
>> > Thanks
>> > Shaane
>>