1 7 package org.jboss.ejb3.dd; 8 9 import javax.ejb.TransactionManagementType ; 10 11 import org.jboss.ejb3.tx.TxUtil; 12 import org.jboss.logging.Logger; 13 14 21 public class SessionEnterpriseBean extends EnterpriseBean 22 { 23 private static final Logger log = Logger 24 .getLogger(SessionEnterpriseBean.class); 25 26 public static final String STATELESS = "Stateless"; 27 28 public static final String STATEFUL = "Stateful"; 29 30 public static final String BEAN = "Bean"; 31 32 public static final String CONTAINER = "Container"; 33 34 private String sessionType = STATELESS; 36 37 private String transactionType = CONTAINER; 38 39 public boolean isStateless() 40 { 41 return sessionType.equals(STATELESS); 42 } 43 44 public boolean isStateful() 45 { 46 return sessionType.equals(STATEFUL); 47 } 48 49 public String getSessionType() 50 { 51 return sessionType; 52 } 53 54 public void setSessionType(String sessionType) 55 { 56 this.sessionType = sessionType; 57 } 58 59 public String getTransactionType() 60 { 61 return transactionType; 62 } 63 64 public void setTransactionType(String transactionType) 65 { 66 if (transactionType.equals(BEAN)) 67 tmType = TransactionManagementType.BEAN; 68 else if (transactionType.equals(CONTAINER)) 69 tmType = TransactionManagementType.CONTAINER; 70 this.transactionType = transactionType; 71 } 72 73 public String toString() 74 { 75 StringBuffer sb = new StringBuffer (100); 76 sb.append('['); 77 sb.append(super.toString()); 78 sb.append(","); 79 sb.append("sessionType=").append(sessionType); 80 sb.append(']'); 81 return sb.toString(); 82 } 83 } 84 | Popular Tags |