throw new MTPException("No such address was found on this container: " + address);
}
}
private void newMTP(MTPDescriptor mtp, ContainerID cid) throws IMTPException, ServiceException {
MainContainer impl = myContainer.getMain();
if(impl != null) {
// Update the routing tables of all the other slices
Service.Slice[] slices = getAllSlices();
for(int i = 0; i < slices.length; i++) {
try {
MessagingSlice slice = (MessagingSlice)slices[i];
String sliceName = slice.getNode().getName();
if(!sliceName.equals(cid.getName())) {
slice.addRoute(mtp, cid.getName());
}
}
catch(Throwable t) {
// Re-throw allowed exceptions
if(t instanceof IMTPException) {
throw (IMTPException)t;
}
if(t instanceof ServiceException) {
throw (ServiceException)t;
}
//System.err.println("### addRoute() threw " + t.getClass().getName() + " ###");
myLogger.log(Logger.WARNING,"### addRoute() threw " + t + " ###");
}
}
impl.newMTP(mtp, cid);
}
else {
// Do nothing for now, but could also route the command to the main slice, thus enabling e.g. AMS replication
}
}