Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dali-dev] How to guarantee obtaining of JpaProject instance?

Dmitry:

Adapt your IProject to JpaProject.Reference if you want to be assured of getting a JpaProject. JpaProject.Reference.getValue() will hang your thread until the JpaProjectManager has determined whether your IProject has a corresponding JpaProject. At start-up that can take a while....

Alternatively, if you are writing UI code and you don't want to hang the UI thread,
you can adapt IProject to JpaProjectModel. This model
will be returned immediately and fire the appropriate events if and when your IProject's JpaProject
is built and/or disposed.

I guess the discussion about these interfaces is buried in our ProjectAdapterFactory classes' comments....
I keep thinking I'll get to developer docs.... Sorry about that. : )

Brian


On 7/27/2012 8:57 AM, Dmitry Geraskov wrote:
earlier to get JpaProject instance I asked JptJpaCore plugin for the instance. In current version I have to use
IProject.getAdapter(JpaProject.class),
but the problem is if I do this too earlier the InternalJpaProjectManager hadn't build the project and returns null.

What is the guaranteed way to get the instance for Jpa project?



Back to the top