Search in sources :

Example 6 with CloudAccount

use of com.aliyun.mns.client.CloudAccount in project xnx3 by xnx3.

the class MNSUtil method getMNSClient.

/**
 * 获取当前对象内的 {@link MNSClient} , 对象内只有第一次获取时会创建,并对象内缓存。以后都会直接拿过来使用,不会第二次创建。
 * @return
 */
public MNSClient getMNSClient() {
    if (mnsClient == null) {
        account = new CloudAccount(this.accessKeyId, this.accessKeySecret, this.endpoint);
        // this client need only initialize once
        mnsClient = account.getMNSClient();
    }
    return mnsClient;
}
Also used : CloudAccount(com.aliyun.mns.client.CloudAccount)

Aggregations

CloudAccount (com.aliyun.mns.client.CloudAccount)6 CloudQueue (com.aliyun.mns.client.CloudQueue)2 MNSClient (com.aliyun.mns.client.MNSClient)2 MqttException (org.eclipse.paho.mqttv5.common.MqttException)2 ClientException (com.aliyun.mns.common.ClientException)1 ServiceException (com.aliyun.mns.common.ServiceException)1