1 7 package org.jboss.cache.config; 8 9 import org.jboss.cache.factories.NodeFactory; 10 import org.jgroups.jmx.JChannelFactoryMBean; 11 12 import javax.management.MBeanServer ; 13 import javax.transaction.TransactionManager ; 14 15 public class RuntimeConfig extends ConfigurationComponent 16 { 17 20 private static final long serialVersionUID = 5626847485703341794L; 21 22 private transient TransactionManager transactionManager; 23 private transient JChannelFactoryMBean muxChannelFactory; 24 private transient MBeanServer mbeanServer; 25 private transient NodeFactory nodeFactory; 26 27 30 public void reset() 31 { 32 transactionManager = null; 33 muxChannelFactory = null; 34 mbeanServer = null; 35 nodeFactory = null; 36 } 37 38 39 public JChannelFactoryMBean getMuxChannelFactory() 40 { 41 return muxChannelFactory; 42 } 43 44 public void setMuxChannelFactory(JChannelFactoryMBean multiplexerChannelFactory) 45 { 46 testImmutability("muxChannelFactory"); 47 this.muxChannelFactory = multiplexerChannelFactory; 48 } 49 50 public TransactionManager getTransactionManager() 51 { 52 return transactionManager; 53 } 54 55 public void setTransactionManager(TransactionManager transactionManager) 56 { 57 testImmutability("transactionManager"); 58 this.transactionManager = transactionManager; 59 } 60 61 public MBeanServer getMbeanServer() 62 { 63 return mbeanServer; 64 } 65 66 public void setMbeanServer(MBeanServer mbeanServer) 67 { 68 testImmutability("mbeanServer"); 69 this.mbeanServer = mbeanServer; 70 } 71 72 public NodeFactory getNodeFactory() 73 { 74 return nodeFactory; 75 } 76 77 public void setNodeFactory(NodeFactory nodeFactory) 78 { 79 this.nodeFactory = nodeFactory; 80 } 81 82 @Override 83 public boolean equals(Object obj) 84 { 85 if (this == obj) 86 return true; 87 88 if (obj instanceof RuntimeConfig) 89 { 90 RuntimeConfig other = (RuntimeConfig) obj; 91 return safeEquals(transactionManager, other.transactionManager) 92 && safeEquals(muxChannelFactory, other.muxChannelFactory) 93 && safeEquals(mbeanServer, other.mbeanServer); 94 } 95 96 return false; 97 } 98 99 @Override 100 public int hashCode() 101 { 102 int result = 17; 103 result = result * 29 + (transactionManager == null ? 0 : transactionManager.hashCode()); 104 result = result * 29 + (muxChannelFactory == null ? 0 : muxChannelFactory.hashCode()); 105 result = result * 29 + (mbeanServer == null ? 0 : mbeanServer.hashCode()); 106 return result; 107 } 108 } 109 | Popular Tags |