connected = connection.open(); if (connected) {
boolean result = connection.open(); if (result) {
    public boolean connect() {        connection = ConnectionFactory.getInstance().createClientConnection(host, port, 1);        connected = connection.open();        if (connected) {            connection.addConnectionListener(connectionListener);                   }        return connected;    }