Results 1 to 10 of 19

Thread: stage autowiring without XML (Flex 4.5, SAS 1.2-SNAPSHOT)

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Posts
    14

    Default stage autowiring without XML (Flex 4.5, SAS 1.2-SNAPSHOT)

    hello all,

    although it [1], [2] reads like using a FlexXMLApplicationContext and a ClassScannerObjectFactoryPostProcessor with Autowired/Inject annotations is enough to setup stage autowiring I can't get it to work without adding a XML to FlexXMLApplicationContext like below:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <objects xsi:schemaLocation="http://www.springactionscript.org/schema/objects http://www.springactionscript.org/schema/objects/spring-actionscript-objects-1.0.xsd"
             xmlns="http://www.springactionscript.org/schema/objects"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    
      <object id="stageAutowirer" class="org.springextensions.actionscript.stage.DefaultAutowiringStageProcessor"/>
    
    </objects>
    Is there a way to use stage autowiring without XML?

    Thanks,
    O.

    [1] "The FlexXMLApplicationContext take care all by itself of creating the necessary objects to facilitate stage wiring." (2.1.2.21)

    [2] "IStageProcessor implementation that is created by default by the FlexXMLApplicationContext to perform autowiring and dependency injection on stage components." in DefaultAutowiringStageProcessor

  2. #2
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    407

    Default ...

    Hey there,

    this information in the docs is slightly out of date, I'm afraid, my apologies for this.
    Since a while it is requried to add the stage processor explicitly, that way people can choose to completely ignore stage processing.

    You can add the DefaultAutowiringStageProcessor manually like this:

    Code:
    var processor:DefaultAutowiringStageProcessor = new DefaultAutowiringStageProcessor(applicationContext);
    FlexStageProcessorRegistry.getInstance().registerStageProcessor("autowirer", processor, processor.objectSelector);
    Hope that helps,

    cheers,

    Roland

  3. #3
    Join Date
    Aug 2010
    Posts
    14

    Default

    hi Roland,

    it doesn't work for me:
    Code:
    [TIMESTAMP] DEBUG - FlexStageProcessorRegistry - FlexStageProcessorRegistry didn't find appropriate stage processors for document 'application0', retrieving application processors instead
    cheers,
    O.

  4. #4
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    407

    Default hmmm

    hm, sorry to hear that,

    would it be possible for you to post a small sample application here that demonstrates the problem? I think I'll be able to easily figure out what is going wrong that way.

    Thanks a lot in advance!

    cheers,

    Roland

  5. #5
    Join Date
    Aug 2010
    Posts
    14

    Default

    hey Roland,

    here is the sample application: https://github.com/oliverlietz/sas-samples

    To break the application uncomment lines 58 and 59 in EdisApplication and remove stageAutowirer from context.xml.

    cheers,
    O.
    Last edited by oliverlietz; Aug 14th, 2011 at 10:49 AM.

  6. #6
    Join Date
    Aug 2010
    Posts
    14

    Default

    upgraded to 2.0-SNAPSHOT but still not able to drop the XML. Roland, can you take a look?

    Thanks,
    O.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •