@SuppressWarnings("unchecked")
@Override
public void read(javolution.xml.XMLFormat.InputElement xml, NettyAssociationImpl association) throws XMLStreamException {
association.name = xml.getAttribute(NAME, "");
association.type = AssociationType.getAssociationType(xml.getAttribute(ASSOCIATION_TYPE, ""));
association.hostAddress = xml.getAttribute(HOST_ADDRESS, "");
association.hostPort = xml.getAttribute(HOST_PORT, 0);
association.peerAddress = xml.getAttribute(PEER_ADDRESS, "");
association.peerPort = xml.getAttribute(PEER_PORT, 0);
association.serverName = xml.getAttribute(SERVER_NAME, "");
association.ipChannelType = IpChannelType
.getInstance(xml.getAttribute(IPCHANNEL_TYPE, IpChannelType.SCTP.getCode()));
if (association.ipChannelType == null)
association.ipChannelType = IpChannelType.SCTP;
int extraHostAddressesSize = xml.getAttribute(EXTRA_HOST_ADDRESS_SIZE, 0);
association.extraHostAddresses = new String[extraHostAddressesSize];
for (int i = 0; i < extraHostAddressesSize; i++) {
association.extraHostAddresses[i] = xml.get(EXTRA_HOST_ADDRESS, String.class);
}
}