}
private ProxyICoSimProtocol connect(Simulator simulator, URL url)
throws SimulationException
{
ProxyICoSimProtocol protocolProxy = null;
try
{
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(url);
// 0 sec timeout = no timeout and fixes Bert problem
config.setReplyTimeout(000);// 5 sec time out
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
if (SimulationEngine.eclipseEnvironment)
{
client.setTransportFactory(new CustomSAXParserTransportFactory(client));
}
clients.add(client);
// add factory for annotations for generated protocol
AnnotationClientFactory factory = new AnnotationClientFactory(client);
ICoSimProtocol protocol = (ICoSimProtocol) factory.newInstance(ICoSimProtocol.class);
protocolProxy = new ProxyICoSimProtocol(protocol);
} catch (Exception e)
{
abort(simulator, "Connect faild to: " + url, e);
}
return protocolProxy;