lievendoclo / Valkyrie-RCP

A fork from http://www.gitorious.org/valkyrie-rcp
Apache License 2.0
23 stars 10 forks source link

Migrating from Spring RCP to Valkyrie RCP #17

Closed Squatty closed 9 years ago

Squatty commented 10 years ago

I'm trying to migrate from Spring to Valkyrie and I'm having some difficulties with some of the changes, especially with those considering Application and ApplicationServicesLocator. So, what is the correct way to get a reference to the current application instance and also, what is the correct way to get a reference to ApplicationConfig (which seems to be the replacement for ApplicationServicesLocator)? In my Spring RCP implementation, I have extended the Application class and use the instance() method on many static getters. ApplicationServicesLocator is also used quite a lot.

And if there's anything else I should now about migrating to Valkyrie, that would of course be most helpful. Especially if there's anything that's related to how the application is initialized. The current implementation uses ClassPathXmlApplicationContext to create the ApplicationContext from the XML configs and XML configs are also where the application bean has been defined.

cmadsen commented 10 years ago

Valkyrie-RPC uses spring java config instead of XML for configuring spring (spring security is still configured via XML), so you will need to port your XML files to java config (see AbstractApplicationConfig.java and AbstractCommandConfig.java). Look at the config files here https://github.com/cmadsen/Valkyrie-RCP/tree/master/valkyrie-rcp-samples/valkyrie-rcp-simple-sample for more information.

You must use @autowire to get hold of the application config etc. Many Valkyrie-RPC classes already does that for you.

Squatty commented 10 years ago

Thank you! Looks like migrating to Valkyrie is not as straight forward as I had hoped. I'll just have to start digging and familiarize myself with the new implementation.

Also, there was earlier a discussion about HelpContentsCommand and someone was talking about making a pull request. Did that ever happen? I'll need the help support too.

cmadsen commented 10 years ago

You should ask @bravegag for a pull request.

See issue #10 for more information.

lievendoclo commented 10 years ago

Just added the help support @bravegag ported into my no-aspectj branch, works like a charm