Search code examples
apache-flexspring-mvcgraniteds

How to dynamically register GraniteDS remote destinations with Spring?


I'm trying to make Spring automatically register my remote destinations by reading its annotations. So that I don't need to update some configuration file every time I create a new service.

I got it almost working after reading the graniteds-spring documentation:

http://www.graniteds.org/confluence/display/DOC/2.+Spring+Services

But I still need to add a:

<graniteds:remote-destination name="myService" source="myService" /> to every service bean for it to work.

@RemoteDestination is present but is been ignored. The same goes for <granite-config scan="true"> and the empty services-config.properties.

Am I missing a jar? I can never get them right, never know which ones to use. (Java's greatest problem)


Solution

  • The question is old, but I'll leave an answer if anyone need that...

    In addition to add @RemoteDestination annotation, you need:

    1. add graniteDS listener on web.xml:

      < listener>
      < listener-class>org.granite.config.GraniteConfigListener< /listener-class>
      < /listener>

    2. Create this empty properties file: /META-INF/services-config.properties
      This file needs to be on the project(jar) that you want to be scaned by graniteDS.

    More info:
    http://www.graniteds.org/public/docs/2.3.0/docs/reference/en-US/html/graniteds.spring.html#spring.roscan