4 import java.util.Locale;
6 import javax.swing.UIManager;
7 import javax.xml.namespace.QName;
8 import javax.xml.ws.Service;
10 import businessLogic.BLFacade;
11 import businessLogic.BLFacadeImplementation;
12 import configuration.ConfigXML;
13 import dataAccess.DataAccess;
15 public class ApplicationLauncher {
17 public static void main(String[] args) {
19 ConfigXML c = ConfigXML.getInstance();
21 System.out.println(c.getLocale());
23 Locale.setDefault(new Locale(c.getLocale()));
25 System.out.println("Locale: " + Locale.getDefault());
27 LoginGUI a = new LoginGUI();
32 BLFacade appFacadeInterface;
33 // UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel");
34 // UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
35 UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
37 if (c.isBusinessLogicLocal()) {
39 // In this option the DataAccess is created by FacadeImplementationWS
40 // appFacadeInterface=new BLFacadeImplementation();
42 // In this option, you can parameterize the DataAccess (e.g. a Mock DataAccess
45 DataAccess da = new DataAccess(c.getDataBaseOpenMode().equals("initialize"));
46 appFacadeInterface = new BLFacadeImplementation(da);
52 String serviceName = "http://" + c.getBusinessLogicNode() + ":" + c.getBusinessLogicPort() + "/ws/"
53 + c.getBusinessLogicName() + "?wsdl";
55 // URL url = new URL("http://localhost:9999/ws/ruralHouses?wsdl");
56 URL url = new URL(serviceName);
58 // 1st argument refers to wsdl document above
59 // 2nd argument is service name, refer to wsdl document above
60 // QName qname = new QName("http://businessLogic/", "FacadeImplementationWSService");
61 QName qname = new QName("http://businessLogic/", "BLFacadeImplementationService");
63 Service service = Service.create(url, qname);
65 appFacadeInterface = service.getPort(BLFacade.class);
68 * if (c.getDataBaseOpenMode().equals("initialize"))
69 * appFacadeInterface.initializeBD();
71 LoginGUI.setBusinessLogic(appFacadeInterface);
73 } catch (Exception e) {
74 // a.jLabelSelectOption.setText("Error: " + e.toString());
75 // a.jLabelSelectOption.setForeground(Color.RED);
77 System.out.println("Error in ApplicationLauncher: " + e.toString());