1 package org.javabb.infra; 2 3 import org.apache.commons.logging.Log; 4 import org.apache.commons.logging.LogFactory; 5 import org.javabb.transaction.PrivMsgTransaction; 6 7 8 23 public class PMHelper { 24 25 private static final Log LOG = LogFactory.getLog(UserContext.class); 26 27 private PrivMsgTransaction pmTrans = null; 28 public void setPmTransaction(PrivMsgTransaction pmTrans) { 29 this.pmTrans = pmTrans; 30 } 31 32 public int getCountMessages() throws Exception { 33 try { 34 return pmTrans.countMsgByUser(UserContext.getContext().getUser()); 35 } catch (Exception e) { 36 LOG.debug("Error at getCountMessages " + e.getMessage()); 37 return 0; 38 } 39 } 40 } 41 | Popular Tags |