Re: [ljc] : AOP in CDI - A few queries

From: user 6.
Sent on: Wednesday, February 13, 2013 1:18 PM
Thanks everyone for all your feedback. Will get back in case of any more
queries.

Thanks and regards,
Amit Malhotra,
Cell:[masked],
Board: [masked], Extn  : 1569
Fax:    [masked]

“My primary relationship is with myself – all others are mirrors of it.”
~ Shakti Gawain



From:	Luigi Bitonti <[address removed]>
To:	[address removed]
Date:	02/13/[masked]:32 PM
Subject:	Re: [ljc] : AOP in CDI - A few queries
Sent by:	[address removed]



Hi Amit,

Interceptor logging has definitely got some advantages, like removing
clutter and being easily enabled/disabled at deployment time. As I said, if
it's the "right" thing to do really depends on your use case(s) so my
advice is to test/measure the different solutions.

The CDI RI implementation (Weld) is well documented, so if you haven't
already checked it I suggest you look at this:

http://docs.jboss...­

Also with the upcoming Weld 2.0 (CDI 1.1) release you will get global
enablement and ordering of Interceptors and Decorators, which means that
you will be able to control all your interceptors in different archives
from a single beans.xml file (if you so wish).

For "real time" (which is not really real time) monitoring I like Zabbix as
it allows to collect statistics from different parts of the stack (OS,
Java/JMX, DBs, etc.) and it's quite easy to configure and use.

I hope this helps.

Cheers,
Luigi


From: Amit Malhotra <[address removed]>
To: [address removed]
Sent: Tuesday, February 12,[masked]:13 PM
Subject: Re: [ljc] : AOP in CDI - A few queries

Thanks Luigi.

You are right in stating that I am looking at I am trying to implement
method level logging using interceptors or to put it more clearly using CDI
to do this.

I have observed that logging adds a lot of clutter to the code and wanted
to take this out totally by using AOP and hence the mail.

Have you implemented two ways of logging then in your code?
- For normal methods - Logging is done by interceptors
- For Fast methods - usual Log4j

Any pointers on real time monitoring?

Thanks and regards,
Amit Malhotra,
Mobile:[masked],
Board: [masked], Extn  : 1569
Fax:   [masked]

“We’re neither pure; nor wise; nor good; we do the best we know.”
~Voltaire



From:    Luigi Bitonti <[address removed]>
To:    [address removed]
Date:    02/12/[masked]:27 PM
Subject:    Re: [ljc] [ljc]: AOP in CDI - A few queries
Sent by:    [address removed]



Hi Amit,

I am not sure I understand exactly what you are trying to do. It looks like
you are trying to log method invocation using an interceptor. Is that
correct. In that case I've done this and it works well. Not sure you can
live with the related overhead, depending on what you use it for.
Let's suppose you are using this interceptor on a method used to service a
HTTP get request with some business logic execution (and possibly datastore
access) , then probably the overhead introduced will be negligible. The
same interceptor used on some "fast" method which is invoked very often
might introduce an overhead that pretty much dominates your execution time.
The only real way to know is by measuring.

Cheers,
Luigi



From: Amit Malhotra <[address removed]>
To: [address removed]
Sent: Tuesday, February 12,[masked]:46 AM
Subject: [ljc] [ljc]: AOP in CDI - A few queries


Hi All,

I have just started with reading CDI, there are couple of queries which I
have, any pointers to this
would be extremely helpful

1. Has anyone used  AOP of CDI?

2. Can this be used for implementing logging ? - Know that there is a
google code snipper for doing this
http://code.googl...­


What I wanted to check with the group is - Has some one tried this in their
project earlier, what was the experience and learning's??
Will it be an overkill if I do it over traditional log4j??

3. What are the usual practices followed for logging (apart for the log
levels across various environments)? Have anyone used JMX
for Real time monitoring - What are the pros and cons of this approach

4. Are there any good video's which talk about this  (both monitoring and
AOP in CDI)??

Thanks and regards,
Amit Malhotra,
Mobile:[masked],
Board: [masked], Extn  : 1569
Fax:   [masked]

“We’re neither pure; nor wise; nor good; we do the best we know.”
~Voltaire

This e-Mail may contain proprietary and confidential information and is
sent for the intended recipient(s) only.  If by an addressing or
transmission error this mail has been misdirected to you, you are requested
to delete this mail immediately. You are also hereby notified that any use,
any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its
attachment other than by its intended recipient/s is strictly prohibited.

Visit us at http://www.polari...­




--
Please Note: If you hit "REPLY", your message will be sent to everyone on
this mailing list ([address removed])
http://www.meetup...­
This message was sent by Amit Malhotra ([address removed])
from LJC - London Java Community.
To learn more about Amit Malhotra, visit his/her member profile:
http://www.meetup...­
Set my mailing list to email me

As they are sent
http://www.meetup...­

In one daily email
http://www.meetup...­

Don't send me mailing list messages
http://www.meetup...­
Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]







--
Please Note: If you hit "REPLY", your message will be sent to everyone on
this mailing list ([address removed])
This message was sent by Luigi Bitonti ([address removed]) from LJC -
London Java Community.
To learn more about Luigi Bitonti, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email |
Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]

This e-Mail may contain proprietary and confidential information and is
sent for the intended recipient(s) only.  If by an addressing or
transmission error this mail has been misdirected to you, you are requested
to delete this mail immediately. You are also hereby notified that any use,
any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its
attachment other than by its intended recipient/s is strictly prohibited.

Visit us at http://www.polari...­




--
Please Note: If you hit "REPLY", your message will be sent to everyone on
this mailing list ([address removed])
http://www.meetup...­
This message was sent by Amit Malhotra ([address removed])
from LJC - London Java Community.
To learn more about Amit Malhotra, visit his/her member profile:
http://www.meetup...­
Set my mailing list to email me

As they are sent
http://www.meetup...­

In one daily email
http://www.meetup...­

Don't send me mailing list messages
http://www.meetup...­
Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]







--
Please Note: If you hit "REPLY", your message will be sent to everyone on
this mailing list ([address removed])
This message was sent by Luigi Bitonti ([address removed]) from LJC -
London Java Community.
To learn more about Luigi Bitonti, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email |
Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]

This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only.  If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit us at http://www.polari...­

Our Sponsors

  • Our Blog

    Read the latest news from the LJC

  • RecWorks Ltd

    Fixing Tech Recruitment using the Power of Community

  • jClarity

    Java/JVM Performance Analysis Tools & mentoring for Java related matters

  • LJC Aggrity

    Our LJC Aggrity site contains blog posts from our members

  • LJC Book Club

    Our Book club with book reviews from our members

  • Devoxx UK

    Java Community Conference, in collaboration with the LJC 12/13 Jun 14

  • SkillsMatter

    "Host, help organise, promote, film many of our meetings."

  • Packt Publishing

    A publishing company specializing on specific technologies and solutions

  • Java.Net

    We are an official Java User Group recognised by Oracle's JUG program

  • JRebel

    Free 3 month J-Rebel license.

  • O'Reilly

    40% discount on printed books and 50% on e-books.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy