Changeset 21013

Show
Ignore:
Timestamp:
02/09/08 20:04:02 (10 months ago)
Author:
patrick
Message:

Added the ability to make direct connections to a Subject Manager servant
without involving the hassle of the CORBA Naming Service. This is something
that I have been meaning to add to Tweek for two or three years but just did
not get around to doing. This work is not quite done yet as I still need to
see about adding bi-directional GIOP support to the Java GUI, but that should
not be too hard to manage.

Bumped the version to 1.3.4.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/tweek/ChangeLog

    r20763 r21013  
    11DATE       AUTHOR      CHANGE 
    22---------- ----------- -------------------------------------------------------- 
     32008-02-09 patrick     Added the ability to make direct connections to a 
     4                       Subject Manager servant (that is, without involving the 
     5                       CORBA Naming Service). 
     6                       NEW VERSION: 1.3.4 
    372007-09-04 patrick     Use new environment variable TWEEK_DATA_DIR as a way to 
    48                       look up files in TWEEK_BASE_DIR/share/tweek. 
  • juggler/trunk/modules/tweek/VERSION

    r20763 r21013  
     11.3.4-0 @02/10/2008 02:05:00 UTC@ 
    121.3.3-0 @09/05/2007 03:00:00 UTC@ 
    231.3.2-0 @07/08/2007 21:15:00 UTC@ 
  • juggler/trunk/modules/tweek/configure.ac

    r20974 r21013  
    14741474   test/BeanDeliveryTest/Makefile 
    14751475   test/CxxClient/Makefile 
     1476   test/DirectConnectTestBean/Makefile 
    14761477   test/FileOpenTestBean/Makefile 
    14771478   test/NetworkTestBean/Makefile 
  • juggler/trunk/modules/tweek/java/org/vrjuggler/tweek/GlobalPreferencesServiceImpl.java

    r20974 r21013  
    334334   } 
    335335 
    336    public void setDefaultCorbaHost(String host) 
    337    { 
    338       defaultCorbaHost = host; 
     336   /** 
     337    * This method was renamed from setDefaultCorbaHost() in version 1.3.4. 
     338    * 
     339    * @since 1.3.4 
     340    */ 
     341   public void setDefaultNamingServiceHost(String host) 
     342   { 
     343      defaultNamingServiceHost = host; 
    339344 
    340345      Element e = mPrefsDocRoot.getChild("corba"); 
     
    346351      } 
    347352 
    348       e.setAttribute("host", host); 
    349    } 
    350  
    351    public String getDefaultCorbaHost() 
    352    { 
    353       return defaultCorbaHost; 
    354    } 
    355  
    356    public void setDefaultCorbaPort(int port) 
    357    { 
    358       defaultCorbaPort = port; 
     353      e.setAttribute("nshost", host); 
     354   } 
     355 
     356   /** 
     357    * This method was renamed from getDefaultCorbaHost() in version 1.3.4. 
     358    * 
     359    * @since 1.3.4 
     360    */ 
     361   public String getDefaultNamingServiceHost() 
     362   { 
     363      return defaultNamingServiceHost; 
     364   } 
     365 
     366   /** 
     367    * This method was renamed from setDefaultCorbaPort() in version 1.3.4. 
     368    * 
     369    * @since 1.3.4 
     370    */ 
     371   public void setDefaultNamingServicePort(int port) 
     372   { 
     373      defaultNamingServicePort = port; 
    359374 
    360375      Element e = mPrefsDocRoot.getChild("corba"); 
     
    366381      } 
    367382 
    368       e.setAttribute("port", String.valueOf(port)); 
    369    } 
    370  
    371    public int getDefaultCorbaPort() 
    372    { 
    373       return defaultCorbaPort; 
     383      e.setAttribute("nsport", String.valueOf(port)); 
     384   } 
     385 
     386   /** 
     387    * This method was renamed from getDefaultCorbaPort() in version 1.3.4. 
     388    * 
     389    * @since 1.3.4 
     390    */ 
     391   public int getDefaultNamingServicePort() 
     392   { 
     393      return defaultNamingServicePort; 
    374394   } 
    375395 
     
    392412   { 
    393413      return defaultIiopVersion; 
     414   } 
     415 
     416   /** 
     417    * Sets the default ORB endpoint host address. 
     418    * 
     419    * @since 1.3.4 
     420    */ 
     421   public void setDefaultOrbAddress(String addr) 
     422   { 
     423      defaultOrbAddress = addr; 
     424 
     425      Element e = mPrefsDocRoot.getChild("corba"); 
     426 
     427      if ( e == null ) 
     428      { 
     429         e = new Element("corba"); 
     430         mPrefsDocRoot.addContent(e); 
     431      } 
     432 
     433      e.setAttribute("orbaddr", addr); 
     434   } 
     435 
     436   /** 
     437    * Returns the default ORB endpoint host address. 
     438    * 
     439    * @since 1.3.4 
     440    */ 
     441   public String getDefaultOrbAddress() 
     442   { 
     443      return defaultOrbAddress; 
     444   } 
     445 
     446   /** 
     447    * Sets the default ORB endpoint port number. 
     448    * 
     449    * @since 1.3.4 
     450    */ 
     451   public void setDefaultOrbPort(int port) 
     452   { 
     453      defaultOrbPort = port; 
     454 
     455      Element e = mPrefsDocRoot.getChild("corba"); 
     456 
     457      if ( e == null ) 
     458      { 
     459         e = new Element("corba"); 
     460         mPrefsDocRoot.addContent(e); 
     461      } 
     462 
     463      e.setAttribute("orbport", String.valueOf(port)); 
     464   } 
     465 
     466   /** 
     467    * Returns the deffault ORB endpoint port number. 
     468    * 
     469    * @since 1.3.4 
     470    */ 
     471   public int getDefaultOrbPort() 
     472   { 
     473      return defaultOrbPort; 
    394474   } 
    395475 
     
    474554            { 
    475555               // Read the preferred Naming Service host identifier. 
    476                Attribute corba_attr = corba_element.getAttribute("host"); 
     556               Attribute corba_attr = corba_element.getAttribute("nshost"); 
     557 
     558               // Check the "host" attribute for backwards compatibility. 
     559               if ( null == corba_attr ) 
     560               { 
     561                  corba_attr = corba_element.getAttribute("host"); 
     562               } 
    477563 
    478564               if ( null != corba_attr ) 
    479565               { 
    480                   defaultCorbaHost = corba_attr.getValue(); 
     566                  defaultNamingServiceHost = corba_attr.getValue(); 
    481567               } 
    482568 
    483569               // Read the preferred Naming Service port number. 
    484                corba_attr = corba_element.getAttribute("port"); 
     570               corba_attr = corba_element.getAttribute("nsport"); 
     571 
     572               // Check the "port" attribute for backwards compatibility. 
     573               if ( null == corba_attr ) 
     574               { 
     575                  corba_attr = corba_element.getAttribute("port"); 
     576               } 
    485577 
    486578               if ( null != corba_attr ) 
    487579               { 
    488                   defaultCorbaPort = corba_attr.getIntValue(); 
     580                  defaultNamingServicePort = corba_attr.getIntValue(); 
    489581               } 
    490582 
     
    553645 
    554646         Element corba_element = new Element("corba"); 
    555          corba_element.setAttribute("host", defaultCorbaHost); 
    556          corba_element.setAttribute("port", String.valueOf(defaultCorbaPort)); 
     647         corba_element.setAttribute("orbaddr", defaultOrbAddress); 
     648         corba_element.setAttribute("orbport", 
     649                                    String.valueOf(defaultOrbPort)); 
     650         corba_element.setAttribute("nshost", defaultNamingServiceHost); 
     651         corba_element.setAttribute("nsport", 
     652                                    String.valueOf(defaultNamingServicePort)); 
    557653         corba_element.setAttribute("iiop", defaultIiopVersion); 
    558654         mPrefsDocRoot.addContent(corba_element); 
     
    716812   private Vector beanViewers = new Vector(); 
    717813 
    718    private int     userLevel        = 1; 
    719    private String  lookAndFeel      = javax.swing.UIManager.getSystemLookAndFeelClassName(); 
    720    private String  beanViewer       = null; 
    721    private int     windowWidth      = 1024; 
    722    private int     windowHeight     = 768; 
    723    private String  chooserStartDir  = CWD_START; 
     814   private int     userLevel                  = 1; 
     815   private String  lookAndFeel                = 
     816      javax.swing.UIManager.getSystemLookAndFeelClassName(); 
     817   private String  beanViewer                 = null; 
     818   private int     windowWidth                = 1024; 
     819   private int     windowHeight               = 768; 
     820   private String  chooserStartDir            = CWD_START; 
    724821   private boolean lazyPanelBeanInstantiation = true; 
    725    private String  defaultCorbaHost   = ""; 
    726    private int     defaultCorbaPort   = 2809; 
    727    private String  defaultIiopVersion = "1.0"; 
     822   private String  defaultNamingServiceHost   = ""; 
     823   private int     defaultNamingServicePort   = 2809; 
     824   private String  defaultIiopVersion         = "1.0"; 
     825   private String  defaultOrbAddress          = ""; 
     826   private int     defaultOrbPort             = 12345; 
    728827} 
  • juggler/trunk/modules/tweek/java/org/vrjuggler/tweek/gui/BeanContainer.java

    r20974 r21013  
    299299 
    300300         // Attach our observer to the subject. 
    301          corbaService.registerObject(push_observer, 
    302                                      "TweekBeanPusher-" + corbaService.getNameServiceURI()); 
     301         corbaService.registerObject(push_observer, "TweekBeanPusher"); 
    303302         push_subject.attach(push_observer._this()); 
    304303 
  • juggler/trunk/modules/tweek/java/org/vrjuggler/tweek/gui/DirectConnectionDialog.java

    r20974 r21013  
    3636import javax.swing.event.ListSelectionListener; 
    3737import javax.swing.table.DefaultTableModel; 
    38 import org.omg.CosNaming.NamingContextPackage.*; 
    3938import org.vrjuggler.tweek.beans.BeanRegistry; 
    4039import org.vrjuggler.tweek.beans.TweekBean; 
     
    4847 
    4948/** 
    50  * A modal dialog box used to make a connection with a remote ORB.  The Tweek 
    51  * CORBA Service created as a result of the connection is made available to 
    52  * external code. 
     49 * A modal dialog box used to make a direct connection with a remote ORB. The 
     50 * Tweek CORBA Service created as a result of the connection is made available 
     51 * to external code. 
     52 * 
     53 * @since 1.3.4 
    5354 */ 
    54 public class ConnectionDialog extends JDialog 
     55public class DirectConnectionDialog extends JDialog 
    5556{ 
    56    public ConnectionDialog(Frame owner, String title) 
     57   public DirectConnectionDialog(Frame owner, String title) 
    5758   { 
    5859      super(owner, title); 
     
    6869      } 
    6970 
    70       mNSHostField.getDocument().addDocumentListener(new AddressFieldValidator()); 
    71       mNSPortField.getDocument().addDocumentListener(new AddressFieldValidator()); 
    72  
    73       this.mSubjectMgrList.addListSelectionListener(new SubjectMgrListSelectionListener(this)); 
    74  
    75       // Set defaults for the Naming Service host and the port number. 
     71      mHostField.getDocument().addDocumentListener(new AddressFieldValidator()); 
     72      mPortField.getDocument().addDocumentListener(new AddressFieldValidator()); 
     73 
     74      // Set defaults for the direct object connection. 
    7675      try 
    7776      { 
    7877         GlobalPreferencesService prefs = new GlobalPreferencesServiceProxy(); 
    7978 
    80          mNSHostField.setText(prefs.getDefaultCorbaHost()); 
    81          mNSPortField.setText(String.valueOf(prefs.getDefaultCorbaPort())); 
    82          mNSIiopVerField.setText(String.valueOf(prefs.getDefaultIiopVersion())); 
     79         mHostField.setText(prefs.getDefaultOrbAddress()); 
     80         mPortField.setText(String.valueOf(prefs.getDefaultOrbPort())); 
    8381      } 
    8482      // D'oh!  No defaults can be set. 
     
    9189      } 
    9290 
    93       // At this point, we may have valid Naming Service connection 
    94       // information, so we should validate the network address. 
     91      // At this point, we may have valid object connection information, so we 
     92      // should validate the network address. 
    9593      validateNetworkAddress(); 
    9694 
    9795      // Add an input validator for the port number field. 
    98       mNSPortField.setInputVerifier(new InputVerifier() 
     96      mPortField.setInputVerifier(new InputVerifier() 
    9997         { 
    10098            public boolean verify(JComponent input) 
     
    110108   } 
    111109 
    112    public int getStatus () 
     110   public int getStatus() 
    113111   { 
    114112      return status; 
    115    } 
    116  
    117    public String getNameServiceHost () 
    118    { 
    119       return nameServiceHost; 
    120    } 
    121  
    122    public int getNameServicePort () 
    123    { 
    124       return nameServicePort; 
    125    } 
    126  
    127    public String getNameServiceIiopVersion() 
    128    { 
    129       return nameServiceIiopVersion; 
    130    } 
    131  
    132    public String getNamingSubcontext () 
    133    { 
    134       return namingSubcontext; 
    135113   } 
    136114 
     
    157135   private void jbInit() throws Exception 
    158136   { 
    159       mNSConnectBorder = new TitledBorder(new EtchedBorder(EtchedBorder.RAISED,Color.white,new Color(142, 142, 142)),"Naming Service Connection"); 
    160       mSubjectMgrBorder = new TitledBorder(new EtchedBorder(EtchedBorder.RAISED,Color.white,new Color(142, 142, 142)),"Subject Manager Choice"); 
    161       mNSConnectPanel.setLayout(mNSConnectLayout); 
    162       mNSConnectPanel.setBorder(mNSConnectBorder); 
    163       mNSConnectPanel.setMinimumSize(new Dimension(450, 175)); 
    164  
    165       mNSHostLabel.setHorizontalAlignment(SwingConstants.TRAILING); 
    166       mNSHostLabel.setLabelFor(mNSHostField); 
    167       mNSHostLabel.setText("Naming Service Host"); 
    168       mNSHostField.setMinimumSize(new Dimension(80, 17)); 
    169       mNSHostField.setPreferredSize(new Dimension(180, 17)); 
    170       mNSHostField.addFocusListener(new java.awt.event.FocusAdapter() 
     137      mConnectBorder = new TitledBorder(new EtchedBorder(EtchedBorder.RAISED,Color.white,new Color(142, 142, 142)),"CORBA Object Connection"); 
     138      mConnectPanel.setLayout(mConnectLayout); 
     139      mConnectPanel.setBorder(mConnectBorder); 
     140      mConnectPanel.setMinimumSize(new Dimension(450, 175)); 
     141 
     142      mHostLabel.setHorizontalAlignment(SwingConstants.TRAILING); 
     143      mHostLabel.setLabelFor(mHostField); 
     144      mHostLabel.setText("Host Address"); 
     145      mHostField.setMinimumSize(new Dimension(80, 17)); 
     146      mHostField.setPreferredSize(new Dimension(180, 17)); 
     147      mHostField.addFocusListener(new java.awt.event.FocusAdapter() 
    171148      { 
    172149         public void focusLost(FocusEvent e) 
     
    175152         } 
    176153      }); 
    177       mNSHostField.addActionListener(new java.awt.event.ActionListener() 
     154      mHostField.addActionListener(new java.awt.event.ActionListener() 
    178155      { 
    179156         public void actionPerformed(ActionEvent e) 
     
    182159         } 
    183160      }); 
    184       mNSPortField.addFocusListener(new java.awt.event.FocusAdapter() 
     161      mPortField.addFocusListener(new java.awt.event.FocusAdapter() 
    185162      { 
    186163         public void focusLost(FocusEvent e) 
     
    189166         } 
    190167      }); 
    191       mNSPortField.addActionListener(new java.awt.event.ActionListener() 
     168      mPortField.addActionListener(new java.awt.event.ActionListener() 
    192169      { 
    193170         public void actionPerformed(ActionEvent e) 
     
    196173         } 
    197174      }); 
    198       mSubjectMgrPanel.setBorder(mSubjectMgrBorder); 
    199       mSubjectMgrPanel.setMinimumSize(new Dimension(450, 200)); 
    200       mSubjectMgrPanel.setPreferredSize(new Dimension(450, 200)); 
    201       mSubjectMgrPanel.setLayout(mSubjectMgrLayout); 
    202       mSubjectMgrSplitPane.setDividerSize(7); 
    203       mNSConnectButton.setEnabled(false); 
    204       mNSConnectButton.setSelected(true); 
    205       mNSConnectButton.setText("Connect"); 
    206       mNSConnectButton.addActionListener(new java.awt.event.ActionListener() 
     175      mConnectButton.setEnabled(false); 
     176      mConnectButton.setSelected(true); 
     177      mConnectButton.setText("Connect"); 
     178      mConnectButton.addActionListener(new java.awt.event.ActionListener() 
    207179      { 
    208180         public void actionPerformed(ActionEvent e) 
    209181         { 
    210             namingServiceConnectAction(e); 
    211          } 
    212       }); 
    213       mOkayButton.setEnabled(false); 
    214       mSubjectMgrList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 
     182            objectConnectAction(e); 
     183         } 
     184      }); 
    215185      mButtonPanel.setMinimumSize(new Dimension(450, 33)); 
    216186      mButtonPanel.setPreferredSize(new Dimension(450, 33)); 
    217       mSubjectMgrListPane.setMinimumSize(new Dimension(100, 90)); 
    218       mSubjectMgrListPane.setPreferredSize(new Dimension(180, 90)); 
    219       mSubjectMgrInfoPane.setMinimumSize(new Dimension(100, 90)); 
    220       mSubjectMgrInfoPane.setPreferredSize(new Dimension(180, 90)); 
    221       mNSPortLabel.setHorizontalAlignment(SwingConstants.TRAILING); 
    222       mNSPortLabel.setLabelFor(mNSPortField); 
    223       mNamingContextLabel.setHorizontalAlignment(SwingConstants.TRAILING); 
    224       mNamingContextLabel.setLabelFor(mNamingContextField); 
    225       mNSIiopVerLabel.setHorizontalAlignment(SwingConstants.TRAILING); 
    226       mNSIiopVerLabel.setLabelFor(mNSIiopVerField); 
    227       mNSIiopVerLabel.setText("IIOP Version"); 
    228       mNSIiopVerField.addFocusListener(new java.awt.event.FocusAdapter() 
    229       { 
    230          public void focusLost(FocusEvent e) 
    231          { 
    232             validateNetworkAddress(); 
    233          } 
    234       }); 
    235       mNSIiopVerField.addActionListener(new java.awt.event.ActionListener() 
    236       { 
    237          public void actionPerformed(ActionEvent e) 
    238          { 
    239             validateNetworkAddress(); 
    240          } 
    241       }); 
    242       mNSRefreshButton.setEnabled(false); 
    243       mNSRefreshButton.setText("Refresh"); 
    244       mNSRefreshButton.addActionListener(new java.awt.event.ActionListener() 
    245       { 
    246          public void actionPerformed(ActionEvent e) 
    247          { 
    248             namingServiceRefreshAction(); 
    249          } 
    250       }); 
    251       mNSConnectPanel.add(mNSHostLabel, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0 
     187      mPortLabel.setHorizontalAlignment(SwingConstants.TRAILING); 
     188      mPortLabel.setLabelFor(mPortField); 
     189      mConnectPanel.add(mHostLabel, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0 
    252190            ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 2), 47, 18)); 
    253       mNSConnectPanel.add(mNSHostField,        new GridBagConstraints(2, 0, 1, 1, 1.0, 0.0 
     191      mConnectPanel.add(mHostField,        new GridBagConstraints(2, 0, 1, 1, 1.0, 0.0 
    254192            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 14, 6)); 
    255193 
    256       mNSPortLabel.setText("Naming Service Port"); 
    257       mNSPortField.setMinimumSize(new Dimension(50, 17)); 
    258       mNSPortField.setPreferredSize(new Dimension(50, 17)); 
    259       mNSConnectPanel.add(mNSPortLabel,       new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0 
     194      mPortLabel.setText("Port Number"); 
     195      mPortField.setMinimumSize(new Dimension(50, 17)); 
     196      mPortField.setPreferredSize(new Dimension(50, 17)); 
     197      mConnectPanel.add(mPortLabel,       new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0 
    260198            ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 2), 0, 18)); 
    261       mNSConnectPanel.add(mNSPortField,             new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0 
     199      mConnectPanel.add(mPortField,             new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0 
    262200            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 10, 6)); 
    263201 
    264       mNSIiopVerField.setMinimumSize(new Dimension(50, 17)); 
    265       mNSIiopVerField.setPreferredSize(new Dimension(50, 17)); 
    266       mNSConnectPanel.add(mNSIiopVerLabel,      new GridBagConstraints(0, 2, 2, 1, 0.0, 0.0 
    267             ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 2), 0, 18)); 
    268       mNSConnectPanel.add(mNSIiopVerField,  new GridBagConstraints(2, 2, 1, 1, 1.0, 0.0 
    269             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 10, 6)); 
    270  
    271       mNamingContextLabel.setText("Naming Subcontext"); 
    272       mNamingContextField.setMinimumSize(new Dimension(80, 17)); 
    273       mNamingContextField.setPreferredSize(new Dimension(150, 17)); 
    274  
    275       mOkayButton.setText("OK"); 
    276       mOkayButton.setMnemonic('O'); 
    277       mOkayButton.setSelected(true); 
    278       mOkayButton.addActionListener(new ActionListener() 
    279       { 
    280          public void actionPerformed (ActionEvent e) 
    281          { 
    282             okButtonAction(e); 
    283          } 
    284       }); 
    285202 
    286203      mCancelButton.setText("Cancel"); 
     
    294211      }); 
    295212 
    296       this.getContentPane().add(mNSConnectPanel,  BorderLayout.NORTH); 
    297  
    298       mNSConnectPanel.add(mNamingContextLabel,     new GridBagConstraints(0, 3, 2, 1, 0.0, 0.0 
    299             ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 2), 0, 18)); 
    300       mNSConnectPanel.add(mNamingContextField,     new GridBagConstraints(2, 3, 1, 1, 1.0, 0.0 
    301             ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 44, 6)); 
    302       mNSConnectPanel.add(mNSButtonPanel, new GridBagConstraints(1, 4, 2, 1, 0.0, 0.0 
     213      this.getContentPane().add(mConnectPanel, BorderLayout.NORTH); 
     214 
     215      mConnectPanel.add(mButtonPanel, new GridBagConstraints(1, 4, 2, 1, 0.0, 0.0 
    303216            ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); 
    304       mNSButtonPanel.add(mNSConnectButton, null); 
    305       mNSButtonPanel.add(mNSRefreshButton, null); 
    306217 
    307218      this.getContentPane().add(mButtonPanel, BorderLayout.SOUTH); 
    308       mButtonPanel.add(mOkayButton, null); 
     219      mButtonPanel.add(mConnectButton, null); 
    309220      mButtonPanel.add(mCancelButton, null); 
    310       this.getContentPane().add(mSubjectMgrPanel, BorderLayout.CENTER); 
    311       mSubjectMgrPanel.add(mSubjectMgrSplitPane,  BorderLayout.CENTER); 
    312       mSubjectMgrSplitPane.add(mSubjectMgrListPane, JSplitPane.LEFT); 
    313       mSubjectMgrSplitPane.add(mSubjectMgrInfoPane, JSplitPane.RIGHT); 
    314221   } 
    315222 
    316223   /** 
    317224    * Handles the event generated by the user clicking the "Connect" button in 
    318     * the Naming Service connection panel. 
     225    * the connection panel. 
    319226    */ 
    320    private void namingServiceConnectAction(ActionEvent e) 
    321    { 
    322       // Commit the information provided by the user in the data entry fields. 
    323       commitConnectInfo(); 
    324  
    325       // Create a new CORBA service using the information provided by the user. 
    326       CorbaService new_orb = new CorbaService(this.getNameServiceHost(), 
    327                                               this.getNameServicePort(), 
    328                                               this.getNameServiceIiopVersion(), 
    329                                               this.getNamingSubcontext()); 
    330  
     227   private void objectConnectAction(ActionEvent e) 
     228   { 
     229      // If we have the Tweek Environment Service, and we should, initialize 
     230      // the new CORBA service with the command line arguments passed when the 
     231      // Tweek GUI was started. 
    331232      try 
    332233      { 
    333          // If we have the Tweek Environment Service, and we should, initialize 
    334          // the new CORBA service with the command line arguments passed when 
    335          // the Tweek GUI was started. 
    336          try 
    337          { 
    338             EnvironmentService env_service = new EnvironmentServiceProxy(); 
    339  
    340             // This may throw several types of exceptions, all of which are 
    341             // handled below. 
    342             new_orb.init(env_service.getCommandLineArgs()); 
    343  
    344             // We initialized the CorbaService object successfully and 
    345             // connected to the remote Naming Service. 
    346             corbaService = new_orb; 
    347  
    348             // XXX: Should we allow the user to make multiple connections from 
    349             // a single dialog box?  Probably not... 
    350             mNSConnectButton.setEnabled(false); 
    351             mNSRefreshButton.setEnabled(true); 
    352  
    353             // Create a new list model for the fresh list of Subject Managers. 
    354             DefaultListModel mgr_list_model = new DefaultListModel(); 
    355  
    356             // Get the list of Subject Managers.  There had better be at least 
    357             // one!  The list returned is guaranteed to contain valid references 
    358             // at the time of construction. 
    359             java.util.Iterator i = new_orb.getSubjectManagerList().iterator(); 
    360             tweek.SubjectManager cur_mgr; 
    361  
    362             while ( i.hasNext() ) 
    363             { 
    364                cur_mgr = (tweek.SubjectManager) i.next(); 
    365                mgr_list_model.addElement(new SubjectManagerWrapper(cur_mgr)); 
    366             } 
    367  
    368             mSubjectMgrList.setModel(mgr_list_model); 
    369          } 
    370          catch(org.omg.CosNaming.NamingContextPackage.NotFound nfex) 
    371          { 
    372             String reason = ""; 
    373  
    374             if ( nfex.why == NotFoundReason.not_context ) 
    375             { 
    376                reason = " (naming context is an object)"; 
    377             } 
    378             else if ( nfex.why == NotFoundReason.not_object ) 
    379             { 
    380                reason = " (object is a naming context)"; 
    381             } 
    382             else if ( nfex.why == NotFoundReason.missing_node ) 
    383             { 
    384                reason = " (node in name path is missing)"; 
    385             } 
    386             else 
    387             { 
    388                reason = " (" + nfex.getMessage() + ")"; 
    389             } 
    390  
    391             int answer = 
    392                JOptionPane.showConfirmDialog(this, 
    393                                              "No naming context found" + 
    394                                              reason + 
    395                                              ".\nDisconnect from this Naming Service?", 
    396                                              "Naming Context Lookup Failure", 
    397                                              JOptionPane.YES_NO_OPTION, 
    398                                              JOptionPane.QUESTION_MESSAGE); 
    399  
    400             // Disable this button regardless of the user's answer.  A new 
    401             // connection cannot be attempted until new naming service 
    402             // connection is entered or the current connection is closed. 
    403             mNSConnectButton.setEnabled(false); 
    404  
    405             // If the user clicked "No," then we need to enable the refresh 
    406             // button so that an attempt can be made to get a new list of 
    407             // Subject Managers later. 
    408             if ( answer == JOptionPane.NO_OPTION ) 
    409             { 
    410                corbaService = new_orb; 
    411                mNSRefreshButton.setEnabled(true); 
    412             } 
    413             // If the user clicked "Yes," then ensure that the refresh button 
    414             // is disabled until the next connection attempt. 
    415             else 
    416             { 
    417                mNSRefreshButton.setEnabled(false); 
    418             } 
    419          } 
    420          catch(org.omg.CORBA.ORBPackage.InvalidName poaNameEx) 
    421          { 
    422             JOptionPane.showConfirmDialog(this, poaNameEx.getMessage(), 
    423                                           "Root Portable Object Adapter Not Found", 
     234         EnvironmentService env_service = new EnvironmentServiceProxy(); 
     235 
     236         // Create a new CORBA service using the information provided by 
     237         // the user. This may throw several types of exceptions, all of 
     238         // which are handled below. 
     239         corbaService = new CorbaService(env_service.getCommandLineArgs()); 
     240 
     241         String host = mHostField.getText(); 
     242         int port    = Integer.parseInt(mPortField.getText()); 
     243 
     244         // Construct the corbaloc URI for the direct object connection. 
     245         String uri = "corbaloc::" + host + ":" + port + "/SubjectManager"; 
     246 
     247         tweek.SubjectManager subj_mgr = 
     248            tweek.SubjectManagerHelper.narrow( 
     249               corbaService.getORB().string_to_object(uri) 
     250            ); 
     251 
     252         if ( null != subj_mgr ) 
     253         { 
     254            corbaService.setSubjectManager(subj_mgr); 
     255            status = OK_OPTION; 
     256            dispose(); 
     257         } 
     258         else 
     259         { 
     260            JOptionPane.showConfirmDialog(this, "No object found at " + uri, 
     261                                          "CORBA Object Not Found", 
    424262                                          JOptionPane.OK_OPTION, 
    425263                                          JOptionPane.ERROR_MESSAGE); 
    426264         } 
    427          catch(org.omg.PortableServer.POAManagerPackage.AdapterInactive poaEx) 
    428          { 
    429             JOptionPane.showConfirmDialog(this, poaEx.getMessage(), 
    430                                           "Root Portable Object Adapter Inactive", 
    431                                           JOptionPane.OK_OPTION, 
    432                                           JOptionPane.ERROR_MESSAGE); 
    433          } 
    434          catch(org.omg.CORBA.UserException userEx) 
    435          { 
    436             JOptionPane.showConfirmDialog(this, userEx.getMessage(), 
    437                                           "CORBA User Exception", 
    438                                           JOptionPane.OK_OPTION, 
    439                                           JOptionPane.ERROR_MESSAGE); 
    440          } 
    441          catch(RuntimeException ex) 
    442          { 
    443             ex.printStackTrace(); 
    444          } 
     265      } 
     266      catch (org.omg.CORBA.ORBPackage.InvalidName poaNameEx) 
     267      { 
     268         JOptionPane.showConfirmDialog( 
     269            this, poaNameEx.getMessage(), 
     270            "Root Portable Object Adapter Not Found", 
     271            JOptionPane.OK_OPTION, JOptionPane.ERROR_MESSAGE 
     272         ); 
     273      } 
     274      catch (org.omg.PortableServer.POAManagerPackage.AdapterInactive poaEx) 
     275      { 
     276         JOptionPane.showConfirmDialog( 
     277            this, poaEx.getMessage(), 
     278            "Root Portable Object Adapter Inactive", JOptionPane.OK_OPTION, 
     279            JOptionPane.ERROR_MESSAGE 
     280         ); 
     281      } 
     282      catch (org.omg.CORBA.UserException userEx) 
     283      { 
     284         JOptionPane.showConfirmDialog(this, userEx.getMessage(), 
     285                                       "CORBA User Exception", 
     286                                       JOptionPane.OK_OPTION, 
     287                                       JOptionPane.ERROR_MESSAGE); 
    445288      } 
    446289      // Something went wrong with the CORBA service initialization. 
     
    450293         // caused the connection to fail, but failure should not disallow any 
    451294         // further attempts to connect. 
    452          mNSConnectButton.setEnabled(true); 
    453          mNSRefreshButton.setEnabled(false); 
     295         mConnectButton.setEnabled(true); 
    454296 
    455297         // Pop up a dialog stating that the connection failed. 
     
    462304         sys_ex.printStackTrace(); 
    463305      } 
    464    } 
    465  
    466    private void namingServiceRefreshAction() 
    467    { 
    468       // Create a new list model for the fresh list of Subject Managers. 
    469       DefaultListModel mgr_list_model = new DefaultListModel(); 
    470  
    471       // Get the list of Subject Managers.  There had better be at least 
    472       // one!  The list returned is guaranteed to contain valid references 
    473       // at the time of construction. 
    474       java.util.Iterator i = corbaService.getSubjectManagerList().iterator(); 
    475       tweek.SubjectManager cur_mgr; 
    476  
    477       while ( i.hasNext() ) 
    478       { 
    479          cur_mgr = (tweek.SubjectManager) i.next(); 
    480          mgr_list_model.addElement(new SubjectManagerWrapper(cur_mgr)); 
    481       } 
    482  
    483       mSubjectMgrList.setModel(mgr_list_model); 
    484       mSubjectMgrList.invalidate(); 
    485    } 
    486  
    487    /** 
    488     * Commits the user-specified information from the text fields to this 
    489     * object's properties.  After calling this method, those properties can be 
    490     * considered up to date and usable. 
    491     */ 
    492    private void commitConnectInfo() 
    493    { 
    494       nameServiceHost        = mNSHostField.getText(); 
    495       nameServicePort        = Integer.parseInt(mNSPortField.getText()); 
    496       nameServiceIiopVersion = mNSIiopVerField.getText(); 
    497       namingSubcontext       = mNamingContextField.getText(); 
    498    } 
    499  
    500    private void okButtonAction(ActionEvent e) 
    501    { 
    502       status = OK_OPTION; 
    503       commit(); 
    504       dispose(); 
     306      catch (RuntimeException ex) 
     307      { 
     308         ex.printStackTrace(); 
     309      } 
    505310   } 
    506311 
     
    522327   } 
    523328 
    524    private void commit() 
    525    { 
    526       if ( null != mSubjectManager ) 
    527       { 
    528          corbaService.setSubjectManager(mSubjectManager); 
    529       } 
    530    } 
    531  
    532329   /** 
    533330    * Validates that the network address (hostname and port number) entered 
    534     * by the user.  If the network address is valid, then the Naming Service 
    535     * connection button is enabled.  Otherwise, it is disabled. 
     331    * by the user. 
    536332    */ 
    537333   private void validateNetworkAddress() 
     
    541337      if ( null == corbaService ) 
    542338      { 
    543          if ( ! mNSHostField.getText().equals("") && 
    544               validatePortNumber(mNSPortField.getText()) && 
    545               ! mNSIiopVerField.getText().equals("") ) 
    546          { 
    547             mNSConnectButton.setEnabled(true); 
     339         if ( ! mHostField.getText().equals("") && 
     340              validatePortNumber(mPortField.getText()) ) 
     341         { 
     342            mConnectButton.setEnabled(true); 
    548343         } 
    549344         else 
    550345         { 
    551             mNSConnectButton.setEnabled(false); 
     346            mConnectButton.setEnabled(false); 
    552347         } 
    553348      } 
     
    581376   /** 
    582377    * An implementation of DocumentListener used to validate the network 
    583     * address entered for the CORBA Naming Service
     378    * address entered for the CORBA object URI
    584379    */ 
    585380   private class AddressFieldValidator implements DocumentListener 
     
    601396   } 
    602397 
    603    /** 
    604     * An implementation of ListSelectionListener for use with the list of 
    605     * known Tweek Subject Manager references.  When a Subject Manager is 
    606     * selected in the list, the table mSubjectMgrInfo is updated to display 
    607     * information queried from that Subject Manager. 
    608     */ 
    609    private class SubjectMgrListSelectionListener 
    610       implements ListSelectionListener 
    611    { 
    612       public SubjectMgrListSelectionListener(JDialog parent) 
    613       { 
    614          mParentDialog = parent; 
    615&nbs