Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gyrex-dev] org.eclipse.gyrex.persistence

Hi Tomas,

Am 20.03.2013 10:31, schrieb Tomas Tamošaitis:
How to wire concrete DAO implementation and concrete RepositoryProvider
for concrete RuntimeContext.

This wiring is done through content types. Sorry for being short (I'm on a train).

1. define you domain api and DAO interfaces

2. create an implementation of the DAO
   (eg. using EclipseLink or whatever)

3. create a model + content type provider
   MyModelProvider
     extends ModelProvider
     implements IRepositoryContentTypeProvider
   - you need to call pass the DAO interface in the constructor
   - the interface is later retrieved using ctx.get(...)

4. register MyModelProvider as OSGi service RuntimeContextObjectProvider

5. create repository
   (via IRepositoryDefinitionManager)

6. associate repo with content type for context X
   (via DefaultRepositoryLookupStrategy)

7. call ctx.get(...)

I have a prototype in my head to simplify this. But for now that's basically the required steps.

Please ask on this list for additional info.

-Gunnar

--
Gunnar Wagenknecht
gunnar@xxxxxxxxxxxxxxx
http://wagenknecht.org/


Back to the top