GraphNode sElemNode = getServiceElementNode(opStringNode,
service);
if(sElemNode!=null) {
sElemNode.setServiceElement(service);
sElemNode.setProvisionMonitor(monitor);
Node serviceNode = sElemNode.getTableNode();
/* Fetch the known ServiceBeanInstances */
ServiceBeanInstance[] instances =
new ServiceBeanInstance[0];
try {
instances = mgr.getServiceBeanInstances(service);
} catch (Exception e) {
Util.showError(e, frame,
"Fetching ServiceBean Instances");
}
/* If not collapsed, easier to delete the instance
* nodes and re-add them */
if(!(opStringNode.isCollapsed() || sElemNode.isCollapsed())) {
int instanceCount = removeServiceInstances(sElemNode);
for(int i=0; i<instanceCount; i++) {
Node instanceNode =
GraphUtil.addServiceInstance(g,
serviceNode,
opString.getName(),
Constants.AVAILABLE_ID);
GraphNode ign =
(GraphNode)instanceNode.get(Constants.USER_OBJECT);
ign.setProvisionMonitor(monitor);
}
}
for(ServiceBeanInstance instance : instances) {
GraphNode n = getServiceBeanInstance(sElemNode,
instance);
if(n!=null) {
n.setInstance(instance);
ServiceItemFetchQ.write(n, this);
if(n.getTableNode()!=null) {
n.getTableNode().set(Constants.STATE,
Constants.ACTIVE_NO_SERVICE_ITEM);
}
} else {
System.err.println("### updateOpString(): " +
"ServiceBeanInstance node null for " +
"["+service.getName()+"], instanceID=" +
"["+instance.getServiceBeanConfig().getInstanceID()+"]");
}
}
} else {
Node node =
GraphUtil.addService(g,
opStringNode.getTableNode(),
service);
GraphNode sgn =
(GraphNode)node.get(Constants.USER_OBJECT);
sgn.setProvisionMonitor(monitor);
}
}
}
vis.run("filter");