diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-11-16 15:52:28 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-11-16 15:52:28 +0100 |
commit | 44bd0c07505a6841f4315eedcab0a228a6819852 (patch) | |
tree | 7e5d08f5beb7941ea68f8659217efd2379e8acc4 /java/src/IceGridGUI/Application/ReplicaGroupEditor.java | |
parent | More changes to windows installers (diff) | |
download | ice-44bd0c07505a6841f4315eedcab0a228a6819852.tar.bz2 ice-44bd0c07505a6841f4315eedcab0a228a6819852.tar.xz ice-44bd0c07505a6841f4315eedcab0a228a6819852.zip |
Added support for proxy-options to IceGrid adapter, replica group and object descriptors
Diffstat (limited to 'java/src/IceGridGUI/Application/ReplicaGroupEditor.java')
-rw-r--r-- | java/src/IceGridGUI/Application/ReplicaGroupEditor.java | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/java/src/IceGridGUI/Application/ReplicaGroupEditor.java b/java/src/IceGridGUI/Application/ReplicaGroupEditor.java index b5a4ecee570..cb700de7f28 100644 --- a/java/src/IceGridGUI/Application/ReplicaGroupEditor.java +++ b/java/src/IceGridGUI/Application/ReplicaGroupEditor.java @@ -173,7 +173,7 @@ class ReplicaGroupEditor extends Editor ReplicaGroupEditor() { - _objects = new SimpleMapField(this, true, "Identity", "Type"); + _objects = new ArrayMapField(this, true, "Identity", "Type", "Proxy Options"); // // load balancing @@ -215,6 +215,9 @@ class ReplicaGroupEditor extends Editor JTextField loadSampleTextField = (JTextField)_loadSample.getEditor().getEditorComponent(); loadSampleTextField.getDocument().addDocumentListener(_updateListener); _loadSample.setToolTipText("Use the load average or CPU usage over the last 1, 5 or 15 minutes?"); + + _proxyOptions.getDocument().addDocumentListener(_updateListener); + _proxyOptions.setToolTipText("The proxy options used for proxies created by IceGrid for the replica group"); } void writeDescriptor() @@ -224,7 +227,7 @@ class ReplicaGroupEditor extends Editor descriptor.id = _id.getText().trim(); descriptor.description = _description.getText(); descriptor.objects = _objectList; - + descriptor.proxyOptions = _proxyOptions.getText().trim(); Object loadBalancing = _loadBalancing.getSelectedItem(); if(loadBalancing == ORDERED) { @@ -271,6 +274,10 @@ class ReplicaGroupEditor extends Editor builder.nextRow(2); builder.nextLine(); + builder.append("Proxy Options"); + builder.append(_proxyOptions, 3); + builder.nextLine(); + builder.append("Well-known Objects"); builder.nextLine(); builder.append(""); @@ -338,6 +345,9 @@ class ReplicaGroupEditor extends Editor _description.setEditable(isEditable); _description.setOpaque(isEditable); + _proxyOptions.setText(descriptor.proxyOptions); + _proxyOptions.setEditable(isEditable); + _objects.set(objectDescriptorSeqToMap(descriptor.objects), resolver, isEditable); _loadBalancing.setEnabled(true); @@ -396,28 +406,28 @@ class ReplicaGroupEditor extends Editor return (ReplicaGroup)_target; } - private java.util.Map<String, String> objectDescriptorSeqToMap(java.util.List<ObjectDescriptor> objects) + private java.util.Map<String, String[]> objectDescriptorSeqToMap(java.util.List<ObjectDescriptor> objects) { - java.util.Map<String, String> result = new java.util.TreeMap<String, String>(); + java.util.Map<String, String[]> result = new java.util.TreeMap<String, String[]>(); for(ObjectDescriptor p : objects) { - result.put(Ice.Util.identityToString(p.id), p.type); + result.put(Ice.Util.identityToString(p.id), new String[]{p.type, p.proxyOptions}); } return result; } - private java.util.LinkedList<ObjectDescriptor> mapToObjectDescriptorSeq(java.util.Map<String, String> map) + private java.util.LinkedList<ObjectDescriptor> mapToObjectDescriptorSeq(java.util.Map<String, String[]> map) { String badIdentities = ""; java.util.LinkedList<ObjectDescriptor> result = new java.util.LinkedList<ObjectDescriptor>(); - for(java.util.Map.Entry<String, String> p : map.entrySet()) + for(java.util.Map.Entry<String, String[]> p : map.entrySet()) { try { Ice.Identity id = Ice.Util.stringToIdentity(p.getKey()); - String type = p.getValue(); - result.add(new ObjectDescriptor(id, type)); + String[] val = p.getValue(); + result.add(new ObjectDescriptor(id, val[0], val[1])); } catch(Ice.IdentityParseException ex) { @@ -447,14 +457,18 @@ class ReplicaGroupEditor extends Editor private JTextField _id = new JTextField(20); private JTextArea _description = new JTextArea(3, 20); + private JTextField _proxyOptions = new JTextField(20); - private JComboBox<String> _loadBalancing = new JComboBox<String>(new String[] {ADAPTIVE, ORDERED, RANDOM, ROUND_ROBIN}); + private JComboBox<String> _loadBalancing = new JComboBox<String>(new String[] {ADAPTIVE, + ORDERED, + RANDOM, + ROUND_ROBIN}); private JTextField _nReplicas = new JTextField(20); private JLabel _loadSampleLabel; private JComboBox<String> _loadSample = new JComboBox<String>(new String[] {"1", "5", "15"}); - private SimpleMapField _objects; + private ArrayMapField _objects; private java.util.LinkedList<ObjectDescriptor> _objectList; } |