rabbitmqhelper這個類,用於宣告交換機,宣告佇列、傳送訊息等操作。
dedicatedchannels 用於存放當前執行緒中的通道,宣告交換機、佇列等操作發生在多個方法中,為了共享通道,所以放在區域性執行緒變數中。
public class
rabbitmqhelper
public void closechannel() catch (ioexception var3) catch (timeoutexception var4) }}
public void queuebinding(bindingmq bindingmq) );
return
null;
}, this.cacheconnectionfactory);
}public
void
queuebindings
(channel channel, bindingmq... bindingmqs)
try catch
(ioexception var6) }}
public
void
declareexchange
(exchangemq exchangemq) );
return
null;
}, this.cacheconnectionfactory);
}public
void
declareexchanges
(channel channel, exchangemq... exchangemqs)
if(exchangemq.isdelayed()) else
arguments.put
("x-deplayed-type", exchangemq.gettype());
channel.exchangedeclare
(exchangemq.getname(), exchangemq.gettype(), exchangemq.isdurable(), exchangemq.isautodelete(), exchangemq.isinternal(), arguments);
} else
}} catch
(ioexception var7)
}public
string
declarequeue
(queuemq queue) );
return declareok.size() > 0?((declareok)declareok.get(0)).getqueue():null;
}, this.cacheconnectionfactory);
}public
list
declarequeues
(channel channel, queuemq... queues)
try catch
(ioexception var7)
}return
declareoks;
}public
channel
getchannel
() catch
(exception var5)
try catch
(exception var4)
}private
tdoexecute
(channelcallbackchannelcallback, cacheconnectionfactory cacheconnectionfactory)
channel = this.getchannel
(); this.dedicatedchannels.set
(channel);
}object
result = null;
try catch
(exception var6)
}public
void
send
(string exchange, string destination, boolean durable, basicproperties properties, string msg) , this.cacheconnectionfactory);
}
自定義搜尋框
自定義搜尋框 1 自定義自定義的文字框必須在 void layoutsubviews中才能自定義 即子控制項必須在layoursubviews中設定,而searchbar可以直接設定 placeholder,外背景 2 storyboard隨意設定即可 3 純 字型顏色和大小無法設定,但是外邊框可以...
自定義彈框
1.警告框 設定乙個negativebutton builder.setnegativebutton 取消 new dialoginte ce.onclicklistener 設定乙個neutralbutton builder.setneutralbutton 忽略 new dialoginte c...
自定義屬性訪問
客戶可直接訪問屬性 使用點訪問運算子 另外,類作者也可為屬性指派特殊名稱,向客戶指明應通過方法來訪問屬性。現在要討論的是 定義特殊方法,自定義直接屬性訪問的行為。python提供了一系列特殊方法,類可定義這些方法,以控制點訪問運算子操縱 類物件的方式。重新定義運算子行為的技術稱為 運算子過載 對點運...