| author | Jaroslav Tulach <jtulach@netbeans.org> |
| Mon Feb 08 14:51:45 2010 +0100 | |
| changeset 977 | 5cb76f2cb8a0 |
| parent 584 | e715e6651175 |
| permissions | -rw-r--r-- |
| jtulach@576 | 1 |
package org.apidesign.demo.anagramwithspringandlookup; |
| jtulach@576 | 2 |
|
| jtulach@576 | 3 |
import org.apidesign.spring.SpringAndLookup; |
| jtulach@576 | 4 |
import org.openide.util.Lookup; |
| jtulach@576 | 5 |
import org.springframework.context.ApplicationContext; |
| jtulach@579 | 6 |
import org.springframework.context.support.ClassPathXmlApplicationContext; |
| jtulach@576 | 7 |
|
| jtulach@576 | 8 |
public final class Main {
|
| jtulach@576 | 9 |
private Main() { }
|
| jtulach@576 | 10 |
|
| jtulach@584 | 11 |
// BEGIN: anagramdemo.springlookup.main |
| jtulach@576 | 12 |
public static void main(String[] args) throws Exception {
|
| jtulach@585 | 13 |
ApplicationContext servicesContext = SpringAndLookup.create( |
| jtulach@585 | 14 |
Lookup.getDefault(), "java.extensions" |
| jtulach@585 | 15 |
); |
| jtulach@585 | 16 |
ClassPathXmlApplicationContext mergedContext; |
| jtulach@585 | 17 |
mergedContext = new ClassPathXmlApplicationContext( |
| jtulach@579 | 18 |
new String[] { "Main.xml" },
|
| jtulach@579 | 19 |
Main.class, |
| jtulach@579 | 20 |
servicesContext |
| jtulach@579 | 21 |
); |
| jtulach@579 | 22 |
UI ui = (UI)mergedContext.getBean("ui", UI.class);
|
| jtulach@576 | 23 |
ui.display(); |
| jtulach@576 | 24 |
} |
| jtulach@584 | 25 |
// END: anagramdemo.springlookup.main |
| jtulach@576 | 26 |
} |