public void connect(String hostname, int port) {
ClientStub handler = new ClientStub(this);
RmiProxy rmiProxy = (RmiProxy) Proxy.newProxyInstance(RmiProxy.class.getClassLoader(), new Class[] { RmiProxy.class }, handler);
try {
conn = handler.connect(getUserName(), hostname, port);
conn.setReportingTool(reportingTool = new ReportingTool());
conn.setRmiProxy(rmiProxy);
} catch (URISyntaxException e) {
logger.error(e.getMessage(), e);
}
}