Announcement Announcement Module
Collapse
No announcement yet.
stage autowiring without XML (Flex 4.5, SAS 1.2-SNAPSHOT) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • oliverlietz
    replied
    flexunit issue "fixed", latest changes (up to r1889) from 2.0 branch merged

    Leave a comment:


  • oliverlietz
    replied
    arrgghhh, information on flexunit.org is also outdated...
    4.1 RC2 12/24/10 http://docs.flexunit.org/index.php?title=Downloads
    4.1.0 release April 13, 2011 https://github.com/flexunit/flexunit/commits/master

    Will fix it.

    Leave a comment:


  • 666shooter
    replied
    hm

    Hm, I've tried your pom and get this error:

    [ERROR] Failed to execute goal on project spring-actionscript-core: Could not re
    solve dependencies for project org.springextensions.actionscript:spring-actionsc
    ript-core:swc:2.0.0.BUILD-SNAPSHOT: Could not find artifact com.adobe.flexunit:f
    lexunit:swc:4.1-RC2 in sonatype (http://repository.sonatype.org/content/groups/p
    ublic/) -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
    ch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please rea
    d the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/d...DependencyReso
    lutionException
    [ERROR]
    [ERROR] After correcting the problems, you can resume the build with the command

    [ERROR] mvn <goals> -rf :spring-actionscript-core
    So, as usual Flex Unit is the culprit. I have no idea why though. This error just sometimes pops up. As if the repository it resides in just is offline occasionally or something...

    What do you reckon?

    cheers,

    Roland

    Leave a comment:


  • oliverlietz
    replied
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] Spring ActionScript ............................... SUCCESS [0.547s]
    [INFO] Spring ActionScript Core .......................... SUCCESS [54.558s]
    [INFO] Spring ActionScript Flex .......................... SUCCESS [37.060s]
    [INFO] Spring ActionScript MVC ........................... SUCCESS [3.969s]
    [INFO] Spring ActionScript Security ...................... SUCCESS [3.042s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1:45.813s
    [INFO] Finished at: Mon Oct 17 14:48:55 CEST 2011
    [INFO] Final Memory: 12M/1040M
    [INFO] ------------------------------------------------------------------------

    first version which builds without errors and runs all tests committed...

    Leave a comment:


  • 666shooter
    replied
    wow!

    Hey dude,

    wowsers! You're cleaning up all the poms! That is absolutely amazing! Thank you SO much!
    Keep us posted on your progress, thanks!

    cheers,

    Roland

    Leave a comment:


  • oliverlietz
    replied
    work in progress: https://github.com/oliverlietz/sas

    Leave a comment:


  • 666shooter
    replied
    test problem

    Hm,

    weird that the test project refuses to compile for you. Someone else had the same problems apparently.
    I see you're using -DskipTests=true, which doesn't seem to work actually. If you use -Dmaven.test.skip=true it will REALLY skip the tests
    That way you'll at least be able to compile everything...

    Let me know if you figure out why the testrunner refuses to build, should you be able to find out anything.

    cheers,

    Roland

    Leave a comment:


  • oliverlietz
    replied
    hi Roland,

    after fixing SESPRINGACTIONSCRIPTAS-142 I have this output:

    https://gist.github.com/1283865

    I will start working on a minimal pom and add your doc build and tests later. Hope that helps in getting a proper and slim pom.

    cheers,
    O.

    Leave a comment:


  • 666shooter
    replied
    Hey Olivier,

    you mention the SAS maven build being broken, do you mean the version 2.0 pom? For me that one's working fine, what is failing for you exactly?
    Indeed just adding the spring-actionscript-core ought to be enough. If not, the pom might need some tweaking, I'd appreciate any assistance with this
    since many other people will run into the same issues I would guess.

    cheers,

    Roland

    Leave a comment:


  • oliverlietz
    replied
    Roland,

    thank you. I switched my sample app to annotated configuration class. It works
    However I'm still interested in completely dropping external configuration and solve it with one or two lines of code as described in your first answer.

    For now switching from Halo to Spark and from a custom framework to SAS, the use of a new state machine lib and of course the broken SAS Maven build prevent me from digging deeper into SAS (expect patches coming to JIRA).
    In a best-case scenario, adding spring-actionscript-core (or spring-actionscript-flex) to a pom should be enough. But as you can see I have to do a lot of configuration in my poms to get a working build and swf.

    cheers,
    O.

    Leave a comment:


  • 666shooter
    replied
    beta sample

    Hi again,

    I've put up some sample apps on the beta site for Spring AS 2.0. There is also a sample app that demonstrates the new metadata driven configuration:

    http://beta.springactionscript.org/s...data/Main.html

    It has 'View Source' enabled, so you can check out the how and why in the sources.

    I hope this is to your liking, let me know what you think!

    cheers,

    Roland

    Leave a comment:


  • 666shooter
    replied
    Hey again,

    alright, I think I came to a quite elegant solution, and quite straightforward too I think. To configure properties and method invocations on classes where you do not have access to the source code (so you can't add the metadata directly into the source).
    You could do something like this:

    Code:
    [Configuration]
    public class configClass {
    
      [Property(name="autowireOnce",value="false")]
      [Property(name="objectDefinitionResolver",ref="myObjectDefinitionResolver")]
      [Component(scope="singleton")]
      public var autowireStageProcessor: DefaultAutowiringStageProcessor;
    
      [Component(scope="singleton",lazyInit="true")]
      public var eventHandlerProcessor:EventHandlerMetadataProcessor;
    
      [Invoke(name="myMethod",args="stringValue")]
      [Component(scope="singleton",lazyInit="true",initMethod="initResolver")]
      public var myObjectDefinitionResolver:CustomObjectDefinitionResolver;
    
    }
    What do you think? I think I'll go ahead and implement it this way, unless someone has some clear objections against this?

    cheers,

    Roland
    Last edited by 666shooter; Sep 18th, 2011, 03:25 PM.

    Leave a comment:


  • 666shooter
    replied


    Hey there,

    I was wondering when you'd make a comment about this Hehe, no, right now v2.0 will also not work with this scenario.
    I'm still thinking of an elegant solution, that's why it isn't supported yet. Here is my problem, if you're using the metadata based configuration
    you add the [Component] metadata to you project classes to have them turned into object definitions.
    But, if you want an object definition for an existing framework class, this is impossible right now.

    So, I was thinking about perhaps implementing some kind of [Configuration] metadata. Imagine you can add object definition like this:

    Code:
    [Configuration]
    public class configClass {
    
      public var autowireProcessor: DefaultAutowireProcessor;
    
      public var eventHandlerProcessor: EventHandlerMetadataProcessor;
    
    }
    This configClass itself will NEVER be instantiated, it is simply used as placeholder to define the metadata. Upon initializing the container will look for classes
    with the [Component] anootation, but also for [Configuration] annotations. If found, it iterates over the the properties of the Class, uses the name
    of the property as the object definition's id and the type of the property as the definition's class.

    One extra problem, something that you guys might be able to help with is how to inject properties and declare method invocations for these classes...

    Please help us out and think with us!

    cheers!

    Roland

    Leave a comment:


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

    Thanks,
    O.

    Leave a comment:

Working...
X