deleted aplicationFacade and imported it's functions to specific business logics.
[RRRRHHHH_Code] / ruralHouses / src / gui / StartWindow.java
index 3e538ca..ee3ab51 100644 (file)
@@ -9,10 +9,6 @@ import gui.BookRuralHouseGUI;
 import javax.swing.*;
 
 import configuration.ConfigXML;
-//import businessLogic.FacadeImplementation;
-import businessLogic.ApplicationFacadeInterface;
-import businessLogic.FacadeImplementation;
-
 import java.rmi.*;
 import java.awt.Color;
 import java.awt.Font;
@@ -37,7 +33,7 @@ public class StartWindow extends JFrame {
        private JButton boton3 = null;
        private static configuration.ConfigXML c;
 
-       public static ApplicationFacadeInterface facadeInterface;
+       //public static ApplicationFacadeInterface facadeInterface;
        private JLabel lblNewLabel;
        
        public static void main(String[] args) {
@@ -56,8 +52,9 @@ public class StartWindow extends JFrame {
                        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
 
                        c=configuration.ConfigXML.getInstance();
-                       if (c.isBusinessLogicLocal())
-                               facadeInterface=new FacadeImplementation();
+                       if (c.isBusinessLogicLocal()){
+                               //facadeInterface=new FacadeImplementation();
+                       }
                        else {
                                
                                final String businessLogicNode = c.getBusinessLogicNode();
@@ -66,11 +63,11 @@ public class StartWindow extends JFrame {
                                // RMI server port number
                                int portNumber = Integer.parseInt(c.getPortRMI());
                                // RMI server host IP IP 
-                               facadeInterface = (ApplicationFacadeInterface) Naming.lookup("rmi://"
-                                       + businessLogicNode + ":" + portNumber + serviceName);
+                               /*facadeInterface = (ApplicationFacadeInterface) Naming.lookup("rmi://"
+                                       + businessLogicNode + ":" + portNumber + serviceName);*/
                        } 
 
-               } catch (java.rmi.ConnectException e) {
+               }/* catch (java.rmi.ConnectException e) {
                        a.lblNewLabel.setText("No business logic: Run BusinessLogicServer first!!");
                        a.lblNewLabel.setForeground(Color.RED);
                        System.out.println("Error in StartWindow: "+e.toString());
@@ -78,7 +75,7 @@ public class StartWindow extends JFrame {
                        a.lblNewLabel.setText("No business logic: Maybe problems running BusinessLogicServer");
                        a.lblNewLabel.setForeground(Color.RED);
                        System.out.println("Error in StartWindow: "+e.toString());
-               } catch (com.db4o.ext.DatabaseFileLockedException e) {
+               } */catch (com.db4o.ext.DatabaseFileLockedException e) {
                        a.lblNewLabel.setText("Database locked: Do not run BusinessLogicServer or BusinessLogicServer!!");
                        a.lblNewLabel.setForeground(Color.RED);         
                        System.out.println("Error in StartWindow: "+e.toString());
@@ -102,22 +99,13 @@ public class StartWindow extends JFrame {
                addWindowListener(new WindowAdapter() {
                        @Override
                        public void windowClosing(WindowEvent e) {
-                               ApplicationFacadeInterface facade=StartWindow.facadeInterface;
-                               try {
-                                       if (c.isBusinessLogicLocal()) facade.close();
-                               } catch (Exception e1) {
-                                       // TODO Auto-generated catch block
-                                       System.out.println("Error: "+e1.toString()+" , probably problems with Business Logic or Database");
-                               }
                                System.exit(1);
                        }
                });
                initialize();
                //this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        }
-       public static ApplicationFacadeInterface getBusinessLogic(){
-               return facadeInterface;
-       }
+       
        
 
        /**