Aug 22nd, 2010, 03:32 AM
Autowiring - new user
I'm new to SAS. I would like to configure a AMFChannel in my .xml config file and reuse it in several components by having the the components Autowire the AMFChannel in.
I have successfully set up an XML configured application context with an AMFChannel and I can get a hold of the channel by myContext.getObject("myAMFChannel") as AMFChannel.
However, I can not seem to manage to Autowire the Channel in to any of my components using [Autowire]. Now the documentation all deals with staged components but there is the following note:
"These examples all deal with stage components, yet it is also possible to add the described metadata to 'normal' objects, the functionality remains the same."
I did add the compiler directive -keep-as3-metadata += Autowired as per the documentation for Autowiring and I did add the autowiringStageProcessor to my config file.
I suspect I am doing something foolish, but help would be appreciated.
Aug 23rd, 2010, 09:26 AM
One new user to another
I used SAS a little bit a year ago and I am trying to use it again for new project. For me [Autowired...] metadata tag only appears to only work for stage components for me. For non-stage components, I can specify the autowiring in the application-context.xml and it works this way:
<object id="testService" class="com.blah.service.TestService" autowire="byName" />
I am also having trouble with the [RouteEvents] metadata tag but [EventHandler] appears to work.
Aug 23rd, 2010, 03:16 PM
I guess I am not the sharpest tool in the shed.
I ended up doing my autowiring in my View classes and taking care to make sure the context was loaded before the views were added and all is fine.