Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EmfStore] Commit observe on server
[EmfStore] Commit observe on server [message #988785] Mon, 03 December 2012 03:10 Go to next message
Dmitriy Shishkin is currently offline Dmitriy Shishkin
Messages: 20
Registered: May 2012
Junior Member
Hi,
Maybe it's a simple question..
How observe commit on server side? I find solution only on client side by extension org.eclipse.emf.emfstore.client.commitObserver

Thanks.
Dmitriy.
Re: [EmfStore] Commit observe on server [message #989038 is a reply to message #988785] Tue, 04 December 2012 06:39 Go to previous messageGo to next message
Maximilian Koegel is currently offline Maximilian Koegel
Messages: 159
Registered: July 2009
Senior Member
Hi Dmitriy,

Unfortunately we do not provide a server based callback interface
anymore. We did in the past and you may find these plugins in the
emfstore.other repository (they are called backchannel plugins),
but the API these plugins depend on has been marked as deprecated.

As an alternative solution to your problem you can register adapters on
the EMF server model, e.g. by adding
EAdapters to the ProjectHistory instances. Please find attached some
example code that gets called for all existing projects when a commit
has been registered via the versions property of the ProjectHistory
class (this goes into the EMFStoreController's run(boolean) method)
after initServerSpace() has completed:

for (final ProjectHistory history : serverSpace.getProjects()) {
history.eAdapters().add(new AdapterImpl() {
@Override
public void notifyChanged(Notification msg) {
if
(msg.getFeature().equals(ModelPackage.eINSTANCE.getProjectHistory_Versions()))
{
Version newVersion = (Version) msg.getNewValue();
System.out.println("New version " +
newVersion.getPrimarySpec().getIdentifier()
+ " for project " + history.getProjectName() + " committed.");
}
}
});
}

If the proposed solution above does not fit your needs, we are happy to
provide a dedicated API with one of the next nightly builds. In this
case it would be helpful if you could explain your requirements in more
detail.

Cheers,
Maximilian

Am 03.12.2012 09:10, schrieb Dmitriy Shishkin:
> Hi,
> Maybe it's a simple question..
> How observe commit on server side? I find solution only on client side
> by extension org.eclipse.emf.emfstore.client.commitObserver
>
> Thanks.
> Dmitriy.


--
Maximilian Kögel

Get Professional Eclipse Support: http://eclipsesource.com/munich
Re: [EmfStore] Commit observe on server [message #989256 is a reply to message #989038] Wed, 05 December 2012 06:26 Go to previous messageGo to next message
Dmitriy Shishkin is currently offline Dmitriy Shishkin
Messages: 20
Registered: May 2012
Junior Member
Hi Maximilian,
Thanks for detailed answer.

I think it is suitable solution for my task. The point is that we need some codegeneration for our domain model. As model live in EmfStore then codegenration should occur on server side at the same time with commit

Thanks,
Dmitriy
Re: [EmfStore] Commit observe on server [message #989268 is a reply to message #989256] Wed, 05 December 2012 07:31 Go to previous message
Maximilian Koegel is currently offline Maximilian Koegel
Messages: 159
Registered: July 2009
Senior Member
Hi Dmitriy,

OK, let me know if it works out for you!

Best regards,
Maximilian

Am 05.12.2012 12:26, schrieb Dmitriy Shishkin:
> Hi Maximilian,
> Thanks for detailed answer.
>
> I think it is suitable solution for my task. The point is that we need
> some codegeneration for our domain model. As model live in EmfStore then
> codegenration should occur on server side at the same time with commit
>
> Thanks,
> Dmitriy


--
Maximilian Kögel

Get Professional Eclipse Support: http://eclipsesource.com/munich
Previous Topic:Texo - orm annotation model has invalid default values
Next Topic:[EMF Facet] TreeViewer with EObject from different resource sets
Goto Forum:
  


Current Time: Fri Apr 18 19:20:29 EDT 2014

Powered by FUDForum. Page generated in 0.05607 seconds