throw new ConnectException("Container not connected"); //$NON-NLS-1$
}
protected ID handleConnectResponse(ID orginalTarget, Object serverData) throws Exception {
final ContainerMessage aPacket = (ContainerMessage) serverData;
final ID fromID = aPacket.getFromContainerID();
Assert.isNotNull(fromID, "fromID cannot be null"); //$NON-NLS-1$
final ContainerMessage.ViewChangeMessage viewChangeMessage = (ContainerMessage.ViewChangeMessage) aPacket.getData();
// If it's not an add message then we've been refused. Get exception
// info from viewChangeMessage and
// throw if there
if (!viewChangeMessage.isAdd()) {
// We were refused by server...so we retrieve data and throw
final Object data = viewChangeMessage.getData();
if (data != null && data instanceof Exception)
throw (Exception) data;
throw new InvalidObjectException("Invalid server response"); //$NON-NLS-1$
}
// Otherwise everything is OK to this point and we get the group member
// IDs from server
final ID[] ids = viewChangeMessage.getChangeIDs();
Assert.isNotNull(ids, "view change ids cannot be null"); //$NON-NLS-1$
for (int i = 0; i < ids.length; i++) {
final ID id = ids[i];
if (id != null && !id.equals(getID()))
addNewRemoteMember(id, null);
}
return fromID;
}