System.out.println(">> Creating Ports Receivers Map: ");
}
for (Iterator keysIterator = actorsThreadsMap.keySet().iterator(); keysIterator
.hasNext();) {
ComponentEntity actor = (ComponentEntity) keysIterator.next();
HashMap portsReceiversMap = new HashMap();
HashMap portTypes = new HashMap();
Iterator allPorts = actor.portList().iterator();
while (allPorts.hasNext()) {
IOPort currentPort = (IOPort) allPorts.next();
Receiver[][] receivers = new Receiver[0][0];
if (currentPort.isOutput()) {
receivers = currentPort.getRemoteReceivers();
}
if (currentPort.isInput()) {
receivers = currentPort.getReceivers();
}
if (!currentPort.connectedPortList().isEmpty()) {
portTypes.put(currentPort.getName(),
((TypedIOPort) currentPort).getType());
}
if (receivers.length > 0) {
if (VERBOSE) {
System.out.print("Port: "
+ currentPort.getFullName()
+ "\n"
+ DistributedUtilities
.receiversArrayToString(receivers));
}
if (currentPort.isOutput()) {
portsReceiversMap.put(currentPort.getName(),
createServicesReceiversMap(receivers));
}
if (currentPort.isInput()) {
portsReceiversMap.put(currentPort.getName(),
DistributedUtilities
.convertReceiversToIntegers(receivers));
}
}
}
ServiceItem server = ((ClientThread) actorsThreadsMap.get(actor))
.getService();
DistributedActor distributedActor = (DistributedActor) server.service;
try {
if (VERBOSE) {
System.out.println("Setting connections to: "
+ actor.getFullName() + " in: "
+ server.serviceID.toString());
System.out.println("Setting port Types: "
+ actor.getFullName() + " in: "
+ server.serviceID.toString());
}
distributedActor.setConnections(portsReceiversMap);
distributedActor.setPortTypes(portTypes);