RE: Problem with ORMService and interceptor

Bump.

Anyone know why the DI is not working for some components inside an interceptor?

Regards,

Andrew Scott

http://www.andyscott.id.au/

Bump.

Anyone know why the DI is not working for some components inside an interceptor?

So Luis let me get this right!!!

Nothing can be injected the way that I am doing it, if what you are saying is right. But some things can be injected, very successfully just not my stuff. Then how is that possible with what your saying?

Do you have an example where I can do this, I have looked at the docs and see nothing that will help me in what you’re saying.

Regards,

Andrew Scott

http://www.andyscott.id.au/

Look at the autowire interceptor, you will see what I am talking about.

Luis F. Majano
President
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Luis do you mean this?

processAutowire(getInterceptor(interceptorConfig.interceptors[x].name,true),interceptorConfig.interceptors[x].class);

If so that looks like exactly what I will do the trick, but I am still confused why some get injected and some don’t when I do it the way I was doing it.

For example

property name=“ORMService” inject=‘ColdBox:plugin:ORMService’;

property name=“logger” inject=‘logbox’;

The logger is injected but the ORMService is not.

Regards,

Andrew Scott

http://www.andyscott.id.au/

Ok I raised this once before and I think I still stand by that.

When registering the interceptor, maybe we should have a method that not only registers the interceptor but does the autowire as well. After looking at the code, I am not sure what I should be doing. I see that the processAutoWire() uses settings that are configured for the autowire.cfc and makes little sense to me at the moment.

So my question then was why can’t registering an interceptor with

controller.getInterceptorService().registerInterceptor(interceptorClass=interceptorClass, interceptorName=interceptorName);

Setup the autowire as well? Would make my job so much easier, and I would be reusing code that the framework already can do. I was hoping you would put something like this into the final ColdBox V3 release, so is there any chance that this could make it in a final release soon?

Regards,

Andrew Scott

http://www.andyscott.id.au/

Luis do you mean this?

processAutowire(getInterceptor(interceptorConfig.interceptors[x].name,true),interceptorConfig.interceptors[x].class);

If so that looks like exactly what I will do the trick, but I am still confused why some get injected and some don’t when I do it the way I was doing it.

For example

property name=“ORMService” inject=‘ColdBox:plugin:ORMService’;

property name=“logger” inject=‘logbox’;

The logger is injected but the ORMService is not.

Regards,

Andrew Scott

http://www.andyscott.id.au/