public void close(JavaSamplerContext context) {

		// Quality
		QoS qos = null;
		if (MQTTSubscriberGui.EXACTLY_ONCE.equals(context.getParameter("QOS"))) {
			qos = QoS.EXACTLY_ONCE;
		} else if (MQTTSubscriberGui.AT_LEAST_ONCE.equals(context
				.getParameter("QOS"))) {
			qos = QoS.AT_LEAST_ONCE;
		} else if (MQTTSubscriberGui.AT_MOST_ONCE.equals(context
				.getParameter("QOS"))) {
			qos = QoS.AT_MOST_ONCE;
		}
		// Topic
		String topics = context.getParameter("TOPIC");
		String[] topicArray = topics.split("\\s*,\\s*");
		Topic[] Tp = new Topic[topicArray.length];
		UTF8Buffer[] Topics = new UTF8Buffer[topicArray.length];
		for (int i = 0; i < topicArray.length; i++) {
			Tp[i] = new Topic(topicArray[i], qos);
			Topics[i] = new UTF8Buffer(Tp[i].toString());
		}
		if (this.connectionArray != null) {
			for (int p = 0; p < this.connectionArray.length; p++) {
				if (this.connectionArray[p] != null) {
					this.connectionArray[p].unsubscribe(Topics,
							new CallbackforUnsubscribe());
					this.connectionArray[p].disconnect(new CallbackforDisconnect());
				}

				this.connectionArray[p] = null;
			}
		}
		this.connectionArray = null;
	}