Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMFInterceptor(Audit Logging)
EMFInterceptor [message #877998] Mon, 28 May 2012 09:25 Go to next message
Serhan OZAN is currently offline Serhan OZANFriend
Messages: 2
Registered: May 2012
Junior Member
Hello,

I have an application that uses the EMF teneo with osgi framework and I'd like to implement an audit logging mechanism. As I am new to the platform, all I managed to learn is that I have to extend the EMFInterceptor class and then register it as an extension. However, I don't know how to do it. Besides, I wonder how this differs from the JBoss hibernate interceptors? I mean how can I implement different logger classes for different model objects?

Any help is appreciated.

Thanks in advance.
Re: EMFInterceptor [message #878205 is a reply to message #877998] Mon, 28 May 2012 20:31 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi,
I guess you found this page:
http://wiki.eclipse.org/Teneo/Hibernate/Extensions#ExtensionManager

So you create a datastore and then before initializing it you do this:
final ExtensionManager extensionManager = dataStore.getExtensionManager();
extensionManager.registerExtension(EMFInterceptor.class.getName(), MyGreatInterceptor.class.getName());

I don't know the jboss hibernate interceptors.. The EMF Interceptor is an implementation of the hibernate interceptor.
You can find the source code of the EMF Interceptor here:
http://git.eclipse.org/c/teneo/org.eclipse.emf.teneo.git/tree/hibernate/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/EMFInterceptor.java

gr. Martin

n 05/28/2012 11:25 AM, Serhan OZAN wrote:
> Hello,
>
> I have an application that uses the EMF teneo with osgi framework and I'd like to implement an audit logging mechanism.
> As I am new to the platform, all I managed to learn is that I have to extend the EMFInterceptor class and then register
> it as an extension. However, I don't know how to do it. Besides, I wonder how this differs from the JBoss hibernate
> interceptors? I mean how can I implement different logger classes for different model objects?
>
> Any help is appreciated.
>
> Thanks in advance.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: EMFInterceptor [message #878558 is a reply to message #878205] Tue, 29 May 2012 14:19 Go to previous message
Serhan OZAN is currently offline Serhan OZANFriend
Messages: 2
Registered: May 2012
Junior Member
Thanks a lot. I just needed this piece of code Smile

extensionManager.registerExtension(EMFInterceptor.class.getName(),MyGreatInterceptor.class.getName());

What I thought was, I had to put EntityNameStrategy.class.getName() as first argument and then MyGreatInterceptor.class.getName(). But, it did not work. I guess I would never try a different first argument if you did not exemplify it.

Anyway, thanks again.
Previous Topic:[EcoreTools] Problem installing on 3.8
Next Topic:[Teneo] Using Teneo in JBoss Environment ePackage issue
Goto Forum:
  


Current Time: Thu Mar 28 13:52:16 GMT 2024

Powered by FUDForum. Page generated in 0.05086 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top