Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Injecting a component in a non-spring environment

Hi Erik,

I'm a little confused as to what you are trying to accomplish.  Are you trying to get access to a Java bean from within your Aspect?  Can you not use a factory-style approach to access it?  Is the bean a singleton?

The aspect isn't anything magical; from what I know, you have to use normal java constructs to get access to the Java bean.

Thanks,

Eric



On Thu, May 8, 2014 at 8:26 AM, erik <EvandeVelde@xxxxxxxx> wrote:
Hello,

I tried to do what you suggest, and came up with the following code:

public aspect BusinessRuleAspectConfigurer
{
          before(BusinessRuleAspect obj): execution(BusinessRuleAspect.new(..)) &&
this(obj) {
                     obj.businessRuleManager = BusinessRuleAspect.aspectOf();
          }
}

There are a few things I still don 't understand (please be patient with me
;-) ):
1) the code doesn't compile because BusinessRuleAspect.aspectOf() produces
something with a type of BusinessRuleAspect, which is not compatible with
the businessRuleManager on the left
2) What mechanism is supposed to create the aspect, when I don't have spring
creating it from the application context?



--
View this message in context: http://aspectj.2085585.n4.nabble.com/Injecting-a-component-in-a-non-spring-environment-tp4651384p4651388.html
Sent from the AspectJ - users mailing list archive at Nabble.com.
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top