Set<String> types = new HashSet<String>();
types.add(JMuleCoreStats.ST_NET_SESSION_UPLOAD_BYTES);
types.add(JMuleCoreStats.ST_NET_SESSION_UPLOAD_COUNT);
types.add(JMuleCoreStats.ST_NET_PEERS_UPLOAD_COUNT);
JMuleCoreStats.registerProvider(types, new JMuleCoreStatsProvider() {
public void updateStats(Set<String> types, Map<String, Object> values) {
if(types.contains(JMuleCoreStats.ST_NET_SESSION_UPLOAD_BYTES)) {
long total_uploaded_bytes = 0;
for(UploadSession session : session_list.values()) {
total_uploaded_bytes+=session.getTransferredBytes();