diff options
author | Bernard Normier <bernard@zeroc.com> | 2005-10-11 20:57:08 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2005-10-11 20:57:08 +0000 |
commit | 5539f6349dad109a6bdfd7d569bc00cf5415d661 (patch) | |
tree | aac387d9fe4cf411e1037a4b927487411eab71c7 /java/src | |
parent | Ability to edit/delete/copy etc. nodes (diff) | |
download | ice-5539f6349dad109a6bdfd7d569bc00cf5415d661.tar.bz2 ice-5539f6349dad109a6bdfd7d569bc00cf5415d661.tar.xz ice-5539f6349dad109a6bdfd7d569bc00cf5415d661.zip |
Ability to edit/copy applications
Diffstat (limited to 'java/src')
-rwxr-xr-x | java/src/IceGrid/Model.java | 1 | ||||
-rwxr-xr-x | java/src/IceGrid/TreeNode/Application.java | 126 | ||||
-rwxr-xr-x | java/src/IceGrid/TreeNode/ApplicationEditor.java | 92 | ||||
-rwxr-xr-x | java/src/IceGrid/TreeNode/Node.java | 67 | ||||
-rwxr-xr-x | java/src/IceGrid/TreeNode/NodeEditor.java | 15 | ||||
-rwxr-xr-x | java/src/IceGrid/TreeNode/Nodes.java | 56 | ||||
-rwxr-xr-x | java/src/IceGrid/TreeNode/ReplicatedAdapter.java | 6 | ||||
-rwxr-xr-x | java/src/IceGrid/TreeNode/ReplicatedAdapters.java | 13 | ||||
-rwxr-xr-x | java/src/IceGrid/TreeNode/Root.java | 51 | ||||
-rwxr-xr-x | java/src/IceGrid/TreeNode/Server.java | 5 | ||||
-rwxr-xr-x | java/src/IceGrid/TreeNode/ServerTemplates.java | 16 | ||||
-rwxr-xr-x | java/src/IceGrid/TreeNode/ServiceTemplates.java | 17 | ||||
-rwxr-xr-x | java/src/IceGrid/TreeNode/Services.java | 3 |
13 files changed, 433 insertions, 35 deletions
diff --git a/java/src/IceGrid/Model.java b/java/src/IceGrid/Model.java index 21ba692e440..61e88ddaff5 100755 --- a/java/src/IceGrid/Model.java +++ b/java/src/IceGrid/Model.java @@ -1118,6 +1118,7 @@ public class Model //
private void newApplication()
{
+ _root.newApplication();
}
//
diff --git a/java/src/IceGrid/TreeNode/Application.java b/java/src/IceGrid/TreeNode/Application.java index 8e61129c0d0..b6b74102d19 100755 --- a/java/src/IceGrid/TreeNode/Application.java +++ b/java/src/IceGrid/TreeNode/Application.java @@ -9,10 +9,12 @@ package IceGrid.TreeNode;
import javax.swing.JOptionPane;
+import javax.swing.JPopupMenu;
import IceGrid.AdapterDynamicInfo;
import IceGrid.ApplicationDescriptor;
import IceGrid.ApplicationUpdateDescriptor;
+import IceGrid.DistributionDescriptor;
import IceGrid.Model;
import IceGrid.ServerDynamicInfo;
import IceGrid.ServerState;
@@ -22,6 +24,60 @@ import IceGrid.TemplateDescriptor; public class Application extends EditableParent
{
+ static public ApplicationDescriptor
+ copyDescriptor(ApplicationDescriptor ad)
+ {
+ ApplicationDescriptor copy = (ApplicationDescriptor)ad.clone();
+
+ copy.replicatedAdapters =
+ ReplicatedAdapters.copyDescriptors(copy.replicatedAdapters);
+
+ copy.serverTemplates =
+ ServerTemplates.copyDescriptors(copy.serverTemplates);
+
+ copy.serviceTemplates =
+ ServiceTemplates.copyDescriptors(copy.serviceTemplates);
+
+ copy.nodes = Nodes.copyDescriptors(copy.nodes);
+
+ copy.distrib = (DistributionDescriptor)copy.distrib.clone();
+ return copy;
+ }
+
+ public boolean[] getAvailableActions()
+ {
+ boolean[] actions = new boolean[ACTION_COUNT];
+
+ actions[COPY] = true;
+ actions[DELETE] = true;
+
+ Object descriptor = _model.getClipboard();
+ if(descriptor != null)
+ {
+ actions[PASTE] = descriptor instanceof ApplicationDescriptor;
+ }
+ actions[APPLICATION_REFRESH_INSTALLATION] = true;
+ return actions;
+ }
+ public JPopupMenu getPopupMenu()
+ {
+ if(_popup == null)
+ {
+ _popup = new PopupMenu(_model);
+ _popup.add(_model.getActions()[APPLICATION_REFRESH_INSTALLATION]);
+ }
+ return _popup;
+ }
+ public void copy()
+ {
+ _model.setClipboard(copyDescriptor(_descriptor));
+ _model.getActions()[PASTE].setEnabled(true);
+ }
+ public void paste()
+ {
+ _parent.paste();
+ }
+
public ApplicationUpdateDescriptor createUpdateDescriptor()
{
ApplicationUpdateDescriptor update = new ApplicationUpdateDescriptor();
@@ -33,7 +89,8 @@ public class Application extends EditableParent //
if(!_descriptor.description.equals(_origDescription))
{
- update.description.value = _descriptor.description;
+ update.description =
+ new IceGrid.BoxedString(_descriptor.description);
}
//
@@ -131,6 +188,50 @@ public class Application extends EditableParent }
+ public boolean isEphemeral()
+ {
+ return _ephemeral;
+ }
+
+ public Object saveDescriptor()
+ {
+ ApplicationDescriptor clone = (ApplicationDescriptor)_descriptor.clone();
+ clone.distrib = (IceGrid.DistributionDescriptor)clone.distrib.clone();
+ return clone;
+ }
+
+ public void restoreDescriptor(Object savedDescriptor)
+ {
+ ApplicationDescriptor clone = (ApplicationDescriptor)savedDescriptor;
+
+ _descriptor.variables = clone.variables;
+ _descriptor.distrib.icepatch = clone.distrib.icepatch;
+ _descriptor.distrib.directories = clone.distrib.directories;
+ _descriptor.description = clone.description;
+ }
+
+ public boolean destroy()
+ {
+ if(_parent == null)
+ {
+ return false;
+ }
+ Root root = (Root)_parent;
+
+ if(_ephemeral)
+ {
+ root.removeChild(this, true);
+ return true;
+ }
+ else if(_model.canUpdate())
+ {
+ //
+ // TODO: must save immediately!
+ //
+ }
+ return false;
+ }
+
//
// Builds the application and all its subtrees
@@ -139,6 +240,7 @@ public class Application extends EditableParent throws UpdateFailedException
{
super(brandNew, descriptor.name, model);
+ _ephemeral = false;
_descriptor = descriptor;
_origVariables = (java.util.Map)_descriptor.variables.clone();
_origDescription = _descriptor.description;
@@ -160,10 +262,20 @@ public class Application extends EditableParent addChild(_nodes);
}
+ Application(ApplicationDescriptor descriptor, Model model)
+ {
+ super(false, descriptor.name, model);
+ _ephemeral = true;
+ _descriptor = descriptor;
+ }
+
+
+
Application(Application o)
{
super(o);
+ _ephemeral = false;
//
// We don't deep-copy _descriptor because it's difficult :)
// So we'll have to be carefull to properly recover the "old" descriptor.
@@ -242,6 +354,15 @@ public class Application extends EditableParent }
//
+ // Try to rebuild this application;
+ // no-op if it fails!
+ //
+ void rebuild() throws UpdateFailedException
+ {
+ _nodes.rebuild();
+ }
+
+ //
// Called when a server-template is deleted, to remove all
// corresponding instances
// children.
@@ -410,6 +531,8 @@ public class Application extends EditableParent }
private ApplicationDescriptor _descriptor;
+
+ private final boolean _ephemeral;
//
// Keeps original version (as deep copies) to be able to build
@@ -428,4 +551,5 @@ public class Application extends EditableParent private Nodes _nodes;
static private ApplicationEditor _editor;
+ static private JPopupMenu _popup;
}
diff --git a/java/src/IceGrid/TreeNode/ApplicationEditor.java b/java/src/IceGrid/TreeNode/ApplicationEditor.java index 4e2421bbebb..d331ba896ed 100755 --- a/java/src/IceGrid/TreeNode/ApplicationEditor.java +++ b/java/src/IceGrid/TreeNode/ApplicationEditor.java @@ -15,6 +15,7 @@ import javax.swing.Action; import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
+import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
@@ -32,6 +33,96 @@ class ApplicationEditor extends Editor {
protected void applyUpdate()
{
+ Application application = (Application)_target;
+ Model model = application.getModel();
+
+ if(model.canUpdate())
+ {
+ model.disableDisplay();
+
+ try
+ {
+ if(application.isEphemeral())
+ {
+ Root root = (Root)application.getParent();
+ writeDescriptor();
+ ApplicationDescriptor descriptor =
+ (ApplicationDescriptor)application.getDescriptor();
+ application.destroy(); // just removes the child
+ try
+ {
+ root.tryAdd(descriptor);
+ }
+ catch(UpdateFailedException e)
+ {
+ //
+ // Add back ephemeral child
+ //
+ try
+ {
+ root.addChild(application, true);
+ }
+ catch(UpdateFailedException die)
+ {
+ assert false;
+ }
+ model.setSelectionPath(application.getPath());
+
+ JOptionPane.showMessageDialog(
+ model.getMainFrame(),
+ e.toString(),
+ "Apply failed",
+ JOptionPane.ERROR_MESSAGE);
+ return;
+ }
+
+ //
+ // Success
+ //
+ _target = root.findChildWithDescriptor(descriptor);
+ model.setSelectionPath(_target.getPath());
+ model.showActions(_target);
+ }
+ else if(isSimpleUpdate())
+ {
+ writeDescriptor();
+ application.markModified();
+ }
+ else
+ {
+ //
+ // Save to be able to rollback
+ //
+ Object savedDescriptor = application.saveDescriptor();
+ writeDescriptor();
+ try
+ {
+ application.rebuild();
+ }
+ catch(UpdateFailedException e)
+ {
+ application.restoreDescriptor(savedDescriptor);
+ JOptionPane.showMessageDialog(
+ model.getMainFrame(),
+ e.toString(),
+ "Apply failed",
+ JOptionPane.ERROR_MESSAGE);
+ return;
+ }
+ //
+ // Success
+ //
+ application.markModified();
+ model.showActions(_target);
+ }
+ _applyButton.setEnabled(false);
+ _discardButton.setEnabled(false);
+ }
+ finally
+ {
+ model.enableDisplay();
+ }
+ }
}
ApplicationEditor(JFrame parentFrame)
@@ -133,6 +224,7 @@ class ApplicationEditor extends Editor void writeDescriptor()
{
ApplicationDescriptor descriptor = (ApplicationDescriptor)_target.getDescriptor();
+ descriptor.name = _name.getText();
descriptor.variables = _variablesMap;
descriptor.description = _description.getText();
diff --git a/java/src/IceGrid/TreeNode/Node.java b/java/src/IceGrid/TreeNode/Node.java index 103c523fa30..21000f49e08 100755 --- a/java/src/IceGrid/TreeNode/Node.java +++ b/java/src/IceGrid/TreeNode/Node.java @@ -283,7 +283,7 @@ class Node extends EditableParent implements InstanceParent _descriptor.variables = copy.variables;
}
- static private class Backup
+ static private class ServerBackup
{
java.util.TreeSet removedElements;
java.util.Map parameterValues;
@@ -292,7 +292,7 @@ class Node extends EditableParent implements InstanceParent public Object rebuildChild(CommonBase child, java.util.List editables)
throws UpdateFailedException
{
- Backup backup = new Backup();
+ ServerBackup backup = new ServerBackup();
Server newServer = null;
Server server = (Server)child;
@@ -365,7 +365,7 @@ class Node extends EditableParent implements InstanceParent public void restoreChild(CommonBase child, Object backupObject)
{
- Backup backup = (Backup)backupObject;
+ ServerBackup backup = (ServerBackup)backupObject;
if(backup.removedElements != null)
{
_removedElements = backup.removedElements;
@@ -394,51 +394,59 @@ class Node extends EditableParent implements InstanceParent }
}
- void rebuild()
+ static class Backup
+ {
+ Utils.Resolver resolver;
+ java.util.List backupList;
+ java.util.List servers;
+ }
+
+ //
+ // Try to rebuild this node;
+ // returns a backup object if rollback is later necessary
+ //
+ Backup rebuild(java.util.List editables)
throws UpdateFailedException
{
Application application = getApplication();
- Utils.Resolver oldResolver = _resolver;
+ Backup backup = new Backup();
+ backup.resolver = _resolver;
+
_resolver = new Utils.Resolver(new java.util.Map[]
{_descriptor.variables, application.getVariables()});
_resolver.put("application", application.getId());
_resolver.put("node", getId());
- java.util.List backupList = new java.util.Vector();
- java.util.List editables = new java.util.LinkedList();
- java.util.List children = (java.util.LinkedList)_children.clone();
+ backup.backupList = new java.util.Vector();
+ backup.servers = (java.util.LinkedList)_children.clone();
- java.util.Iterator p = children.iterator();
+ java.util.Iterator p = backup.servers.iterator();
while(p.hasNext())
{
Server server = (Server)p.next();
try
{
- backupList.add(rebuildChild(server, editables));
+ backup.backupList.add(rebuildChild(server, editables));
}
catch(UpdateFailedException e)
{
- for(int i = backupList.size() - 1; i >= 0; --i)
- {
- restoreChild((Server)children.get(i), backupList.get(i));
- }
- _resolver = oldResolver;
+ restore(backup);
throw e;
}
}
-
- //
- // Success, mark modifies servers modified
- //
- p = editables.iterator();
- while(p.hasNext())
+ return backup;
+ }
+
+ void restore(Backup backup)
+ {
+ for(int i = backup.backupList.size() - 1; i >= 0; --i)
{
- Editable editable = (Editable)p.next();
- editable.markModified();
+ restoreChild((Server)backup.servers.get(i), backup.backupList.get(i));
}
+ _resolver = backup.resolver;
}
-
+
private Server createServer(boolean brandNew, ServerInstanceDescriptor instanceDescriptor,
Application application) throws UpdateFailedException
{
@@ -560,18 +568,19 @@ class Node extends EditableParent implements InstanceParent return null;
}
- if(!_descriptor.loadFactor.equals(_origLoadFactor))
- {
- update.loadFactor = new IceGrid.BoxedString(_descriptor.loadFactor);
- }
-
if(isNew())
{
update.variables = _descriptor.variables;
update.removeVariables = new String[0];
+ update.loadFactor = new IceGrid.BoxedString(_descriptor.loadFactor);
}
else
{
+ if(!_descriptor.loadFactor.equals(_origLoadFactor))
+ {
+ update.loadFactor = new IceGrid.BoxedString(_descriptor.loadFactor);
+ }
+
//
// Diff variables (TODO: avoid duplication with same code in Application)
//
diff --git a/java/src/IceGrid/TreeNode/NodeEditor.java b/java/src/IceGrid/TreeNode/NodeEditor.java index dd23b670154..4ac68da44dd 100755 --- a/java/src/IceGrid/TreeNode/NodeEditor.java +++ b/java/src/IceGrid/TreeNode/NodeEditor.java @@ -93,7 +93,20 @@ class NodeEditor extends Editor {
if(node.inRegistry())
{
- node.rebuild();
+ //
+ // Rebuild node; don't need the backup
+ // since it's just one node
+ //
+ java.util.List editables =
+ new java.util.LinkedList();
+
+ node.rebuild(editables);
+ java.util.Iterator p = editables.iterator();
+ while(p.hasNext())
+ {
+ Editable editable = (Editable)p.next();
+ editable.markModified();
+ }
node.markModified();
}
else
diff --git a/java/src/IceGrid/TreeNode/Nodes.java b/java/src/IceGrid/TreeNode/Nodes.java index b8a13f325af..fb1f4b73a5e 100755 --- a/java/src/IceGrid/TreeNode/Nodes.java +++ b/java/src/IceGrid/TreeNode/Nodes.java @@ -24,6 +24,22 @@ import IceGrid.ServerState; public class Nodes extends EditableParent
{
+ static public java.util.HashMap
+ copyDescriptors(java.util.Map descriptors)
+ {
+ java.util.HashMap copy = new java.util.HashMap();
+ java.util.Iterator p = descriptors.entrySet().iterator();
+ while(p.hasNext())
+ {
+ java.util.Map.Entry entry = (java.util.Map.Entry)p.next();
+
+ copy.put(entry.getKey(),
+ Node.copyDescriptor(
+ (NodeDescriptor)entry.getValue()));
+ }
+ return copy;
+ }
+
public boolean[] getAvailableActions()
{
boolean[] actions = new boolean[ACTION_COUNT];
@@ -61,7 +77,7 @@ public class Nodes extends EditableParent new java.util.TreeMap(),
new java.util.LinkedList(),
new java.util.LinkedList(),
- "1.0"
+ ""
));
}
@@ -119,6 +135,44 @@ public class Nodes extends EditableParent }
}
+ //
+ // Try to rebuild all my children
+ // No-op if it fails
+ //
+ void rebuild() throws UpdateFailedException
+ {
+ java.util.List backupList = new java.util.Vector();
+ java.util.List editables = new java.util.LinkedList();
+
+ java.util.Iterator p = _children.iterator();
+ while(p.hasNext())
+ {
+ Node node = (Node)p.next();
+ try
+ {
+ backupList.add(node.rebuild(editables));
+ }
+ catch(UpdateFailedException e)
+ {
+ for(int i = backupList.size() - 1; i >= 0; --i)
+ {
+ ((Node)_children.get(i)).restore((Node.Backup)backupList.get(i));
+ }
+ throw e;
+ }
+ }
+
+ //
+ // Success
+ //
+ p = editables.iterator();
+ while(p.hasNext())
+ {
+ Editable editable = (Editable)p.next();
+ editable.markModified();
+ }
+ }
+
java.util.LinkedList getUpdates()
{
java.util.LinkedList updates = new java.util.LinkedList();
diff --git a/java/src/IceGrid/TreeNode/ReplicatedAdapter.java b/java/src/IceGrid/TreeNode/ReplicatedAdapter.java index 66a96dac040..946c779747d 100755 --- a/java/src/IceGrid/TreeNode/ReplicatedAdapter.java +++ b/java/src/IceGrid/TreeNode/ReplicatedAdapter.java @@ -14,6 +14,12 @@ import IceGrid.Utils; class ReplicatedAdapter extends EditableLeaf
{
+ static public ReplicatedAdapterDescriptor
+ copyDescriptor(ReplicatedAdapterDescriptor d)
+ {
+ return (ReplicatedAdapterDescriptor)d.clone();
+ }
+
ReplicatedAdapter(boolean brandNew,
ReplicatedAdapterDescriptor descriptor,
Model model)
diff --git a/java/src/IceGrid/TreeNode/ReplicatedAdapters.java b/java/src/IceGrid/TreeNode/ReplicatedAdapters.java index 3c13e059d99..ec69f4d9ef8 100755 --- a/java/src/IceGrid/TreeNode/ReplicatedAdapters.java +++ b/java/src/IceGrid/TreeNode/ReplicatedAdapters.java @@ -16,6 +16,19 @@ import IceGrid.Utils; class ReplicatedAdapters extends EditableParent
{
+ static public java.util.LinkedList
+ copyDescriptors(java.util.List descriptors)
+ {
+ java.util.LinkedList copy = new java.util.LinkedList();
+ java.util.Iterator p = descriptors.iterator();
+ while(p.hasNext())
+ {
+ copy.add(ReplicatedAdapter.copyDescriptor(
+ (ReplicatedAdapterDescriptor)p.next()));
+ }
+ return copy;
+ }
+
ReplicatedAdapters(java.util.List descriptors, Model model)
throws UpdateFailedException
{
diff --git a/java/src/IceGrid/TreeNode/Root.java b/java/src/IceGrid/TreeNode/Root.java index 88a28b50934..62c20fde4c8 100755 --- a/java/src/IceGrid/TreeNode/Root.java +++ b/java/src/IceGrid/TreeNode/Root.java @@ -36,6 +36,27 @@ public class Root extends Parent };
+ public void paste()
+ {
+ ApplicationDescriptor ad =
+ (ApplicationDescriptor)_model.getClipboard();
+ newApplication(Application.copyDescriptor(ad));
+ }
+ public void newApplication()
+ {
+ newApplication(
+ new ApplicationDescriptor("NewApplication",
+ new java.util.TreeMap(),
+ new java.util.LinkedList(),
+ new java.util.HashMap(),
+ new java.util.HashMap(),
+ new java.util.HashMap(),
+ new IceGrid.DistributionDescriptor(
+ "", new java.util.LinkedList()),
+ ""));
+ }
+
+
public Root(Model model)
{
super("Applications", model, true);
@@ -232,6 +253,20 @@ public class Root extends Parent return _dynamicInfoMap.keySet();
}
+ void tryAdd(ApplicationDescriptor ad) throws UpdateFailedException
+ {
+ try
+ {
+ Application app = new Application(true, ad, _model);
+ addChild(app, true);
+ }
+ catch(UpdateFailedException e)
+ {
+ e.addParent(this);
+ throw e;
+ }
+ }
+
void restore(Application copy)
{
removeChild(copy.getId(), true);
@@ -389,6 +424,22 @@ public class Root extends Parent }
}
+ private void newApplication(ApplicationDescriptor descriptor)
+ {
+ descriptor.name = makeNewChildId(descriptor.name);
+
+ Application application = new Application(descriptor, _model);
+ try
+ {
+ addChild(application, true);
+ }
+ catch(UpdateFailedException e)
+ {
+ assert false;
+ }
+ _model.setSelectionPath(application.getPath());
+ }
+
String identify(TreePath path)
{
String result = "";
diff --git a/java/src/IceGrid/TreeNode/Server.java b/java/src/IceGrid/TreeNode/Server.java index 7af62cb4fbd..cf0fa76ea55 100755 --- a/java/src/IceGrid/TreeNode/Server.java +++ b/java/src/IceGrid/TreeNode/Server.java @@ -195,7 +195,6 @@ class Server extends EditableParent _popup.add(_model.getActions()[DISABLE]);
_popup.addSeparator();
_popup.add(_model.getActions()[SERVER_REFRESH_INSTALLATION]);
- _popup.add(_model.getActions()[SERVER_REFRESH_INSTALLATION_NO_SHUTDOWN]);
}
return _popup;
}
@@ -435,7 +434,9 @@ class Server extends EditableParent }
else
{
- return _serverDescriptor.clone();
+ ServerDescriptor clone = (ServerDescriptor)_serverDescriptor.clone();
+ clone.distrib = (IceGrid.DistributionDescriptor)clone.distrib.clone();
+ return clone;
}
}
diff --git a/java/src/IceGrid/TreeNode/ServerTemplates.java b/java/src/IceGrid/TreeNode/ServerTemplates.java index aa8ef0c778e..e1a8347f06c 100755 --- a/java/src/IceGrid/TreeNode/ServerTemplates.java +++ b/java/src/IceGrid/TreeNode/ServerTemplates.java @@ -19,6 +19,22 @@ import IceGrid.TemplateDescriptor; class ServerTemplates extends Templates
{
+ static public java.util.HashMap
+ copyDescriptors(java.util.Map descriptors)
+ {
+ java.util.HashMap copy = new java.util.HashMap();
+ java.util.Iterator p = descriptors.entrySet().iterator();
+ while(p.hasNext())
+ {
+ java.util.Map.Entry entry = (java.util.Map.Entry)p.next();
+
+ copy.put(entry.getKey(),
+ ServerTemplate.copyDescriptor(
+ (TemplateDescriptor)entry.getValue()));
+ }
+ return copy;
+ }
+
//
// Actions
//
diff --git a/java/src/IceGrid/TreeNode/ServiceTemplates.java b/java/src/IceGrid/TreeNode/ServiceTemplates.java index b5b5e2d6778..5b01cd43716 100755 --- a/java/src/IceGrid/TreeNode/ServiceTemplates.java +++ b/java/src/IceGrid/TreeNode/ServiceTemplates.java @@ -22,6 +22,23 @@ import IceGrid.TemplateDescriptor; class ServiceTemplates extends Templates
{
+ static public java.util.HashMap
+ copyDescriptors(java.util.Map descriptors)
+ {
+ java.util.HashMap copy = new java.util.HashMap();
+ java.util.Iterator p = descriptors.entrySet().iterator();
+ while(p.hasNext())
+ {
+ java.util.Map.Entry entry = (java.util.Map.Entry)p.next();
+
+ copy.put(entry.getKey(),
+ ServiceTemplate.copyDescriptor(
+ (TemplateDescriptor)entry.getValue()));
+ }
+ return copy;
+ }
+
+
//
// Actions
//
diff --git a/java/src/IceGrid/TreeNode/Services.java b/java/src/IceGrid/TreeNode/Services.java index ae413ca94d6..2328da12180 100755 --- a/java/src/IceGrid/TreeNode/Services.java +++ b/java/src/IceGrid/TreeNode/Services.java @@ -31,7 +31,8 @@ class Services extends ListParent implements InstanceParent java.util.Iterator p = descriptors.iterator();
while(p.hasNext())
{
- copy.add(Service.copyDescriptor((ServiceInstanceDescriptor)p.next()));
+ copy.add(Service.copyDescriptor(
+ (ServiceInstanceDescriptor)p.next()));
}
return copy;
}
|