|
From: Peter K. <pe...@ya...> - 2009-09-17 19:20:10
|
Hi all,
I would like to know if somebody of you has already tried out to make
Spring RC working with Spring Dynamic Modules [1] ?
I tried yesterday to create a standard swing application with OSGi
successfully (with maven)[2].
And today I could simply replace the
SwingUtilities.invokeLater(new Runnable() {
public void run() {
frame = new MainFrame();
...
}});
with Spring RC's new ApplicationLauncher(..) call and start Spring RC as
an OSGi bundle.
One of my further goals will be to use Spring DM directly instead of
OSGi for Spring RC to be independend of OSGi and for possible better
integration of context files etc. although it could be more complicated ...
Now I have 3 questions
A) How can change the menu from the plugin? E.g. the following is not
working: Application.instance().getApplicationContext().getBean("algoMenu");
.... will throw a
NoSuchBeanDefinitionException: No bean named 'algoMenu' is defined,
because it is defined in the command-context.xml file and not in the
app-context file. Is there a way to get it? Only for a show case ...
B) And how a plugin could inject the information into the host that a
new menuitem has been added? Should this happen in the plugins
command-context.xml file?
And if yes, how should this context file be merged with the host's
command-context.xml file? Maybe this should be done programmatically ala
JavaConfig?
C) And what could be the correct sequence for all the involved frameworks?
1. initialize spring dm => read all context files + context files of plugins
2. then start spring rc which could now use the merged context files
Or should I start Spring RC first and then init OSGi which allows me to
used plugins?
What would you suggest? Or has somebody a better understanding or better
ideas for Spring DM?
Your comment would be very appreciated ;-)!
Regards,
Peter.
[1]
http://www.springsource.org/osgi
[2]
http://karussell.wordpress.com/2009/09/16/plugable-swing-a-hello-world-osgi-example/
|