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

Hello Eric, 

The answers to your questions are as follows:
(1) Are you trying to get access to a Java bean from within your Aspect?
It's more a service than a java bean. We are having trouble debugging our
aspects in eclipse, and decided to delegate the real advise implementation
to a helper component (which is easy to debug) as soon as we can. In my
example i'm trying to 'inject' the helper component in one of our aspects.
It's easy to configure with spring, but not without it.
(2) Can you not use a factory-style approach to access it? 
I suppose we can do that, but assumed we followed a 'best practice' (?) in
spring with the  
        <bean id="businessRuleAspect"
class="com.fugro.gwf.domain.rules.aspects.BusinessRuleAspect" 
                factory-method="aspectOf">
                <property name="businessRuleManager"
ref="businessRuleManager" />
        </bean>
If we introduce some extra code in the aspect for the
factory-style-approach, spring won't be used on either side. I'm not against
that, just looking for opinions ... A question that still remains for me,
even with the factory-style approach is: how is the aspect itself
instantiated when I'm not using the spring configuration mentioned above?
(3) Is the bean a singleton?
Yes it is. Because that happened to be the standard for a spring managed
bean ...



--
View this message in context: http://aspectj.2085585.n4.nabble.com/Injecting-a-component-in-a-non-spring-environment-tp4651384p4651391.html
Sent from the AspectJ - users mailing list archive at Nabble.com.


Back to the top