@Override
	public IConnection connect(IConnectionStateCallback connectionCallback, HostPort hostPort, IAgentCommand[] startupCommands, ITraceFilterExt filter) throws ConnectionException, ConnectionTimeout, BadCompletedRequestListener {
		IConnection c = locateConnection(hostPort);
		if (c==null) {
			c = DefaultFactory.getFactory().getDormantConnection();
			if (filter!=null) c.getTraceWriter().setTraceFilterExt(filter);
			c.addCallback(connectionCallback);
			add(hostPort,c);
			c.connect(hostPort, startupCommands);
		} else {
			//If we're already connected, then this is just a request for a second window
			//to listen on the events of the existing connection.
			c.addCallback(connectionCallback);
			//Make sure new callback (above line of code) gets a status update
			//connPartTwo.broadcastConnectionState();
			c.setCommandArray(startupCommands);
			c.executeStartupCommands();
			if (!c.isConnected()) {
				c.connect(hostPort, startupCommands);
			}
		}
		return c;
	}
	
	/**
	 * First order of business:  create socket  (ISocketCallback fires events when socket is successfully connected.)
	 * Second order of business:  create control and trace threads. (IConnectionStateCallback  notifies the 'window' when connection is complete.
	 *    (the connection is complete when the control and trace threads have successfully received msgs from the agent. 
	 * 
	 * @param connectionCallback -- This is the SWT window that wants to display trace information from this connection.
	 * @param host
	 * @param port
	 */
//	public void _connect(IConnectionStateCallback connectionCallback, HostPort hostPort, IAgentCommand[] startupCommands) throws ConnectionException {
//		
//		ConnectionDetail connPartTwo = locateConnection(hostPort);
//		
//		if (connPartTwo==null) { // not connected yet. 
//			connPartTwo = new ConnectionDetail();//second order of business
//			connPartTwo.setStartupCommands(startupCommands);
//			connPartTwo.addConnCallback(connectionCallback);
//			add(connPartTwo, hostPort);
//			ConnectionPartOne.connectToAgent(connPartTwo, hostPort);//First order of business
//		} else {
//			//TODO:  seems like we need to test to see if the connection if alive.
//			if (connPartTwo.isConnected()) {
//				//If we're already connected, then this is just a request for a second window
//				//to listen on the events of the existing connection.
//				connPartTwo.addConnCallback(connectionCallback);
//				//Make sure new callback (above line of code) gets a status update
//				//connPartTwo.broadcastConnectionState();
//				connPartTwo.setStartupCommands(startupCommands);
//				connPartTwo.executeStartupCommands();
//			} else {
//				throw new ConnectionException(hostPort, ClientStrings.CACHED_CONNECTION_IS_DEAD);
//			}
//			
//		}
//		
//	}