1 22 package org.jboss.ha.framework.server; 23 24 import java.net.InetAddress ; 25 26 import org.jboss.cache.Cache; 27 import org.jboss.cache.config.Configuration; 28 import org.jboss.ha.framework.interfaces.DistributedState; 29 import org.jboss.system.server.ServerConfigUtil; 30 import org.jgroups.jmx.JChannelFactoryMBean; 31 32 39 public class ClusterPartitionConfig 40 { 41 43 45 private Cache cache; 46 private JChannelFactoryMBean multiplexer; 47 private DistributedState distributedState; 48 private String stackName; 49 private String partitionName = ServerConfigUtil.getDefaultPartitionName(); 50 private boolean deadlock_detection = false; 51 private boolean allow_sync_events = false; 52 private String nodeUniqueId = null; 53 private InetAddress nodeAddress = null; 54 private int namingServicePort = -1; 55 56 59 private long state_transfer_timeout=60000; 60 61 62 private long method_call_timeout=60000; 63 64 66 68 70 public String getPartitionName() 71 { 72 return partitionName; 73 } 74 75 public void setPartitionName(String newName) 76 { 77 partitionName = newName; 78 } 79 80 84 public String getNodeUniqueId() 85 { 86 return this.nodeUniqueId; 87 } 88 89 public void setNodeUniqueId(String node) 90 { 91 this.nodeUniqueId = node; 92 } 93 94 public InetAddress getNodeAddress() 95 { 96 return nodeAddress; 97 } 98 99 public void setNodeAddress(InetAddress address) 100 { 101 this.nodeAddress = address; 102 } 103 104 public long getStateTransferTimeout() 105 { 106 return state_transfer_timeout; 107 } 108 109 public void setStateTransferTimeout(long timeout) 110 { 111 this.state_transfer_timeout=timeout; 112 } 113 114 public long getMethodCallTimeout() { 115 return method_call_timeout; 116 } 117 118 public void setMethodCallTimeout(long timeout) { 119 this.method_call_timeout=timeout; 120 } 121 122 public boolean getDeadlockDetection() 123 { 124 return deadlock_detection; 125 } 126 127 public void setDeadlockDetection(boolean doit) 128 { 129 deadlock_detection = doit; 130 } 131 132 public boolean getAllowSynchronousMembershipNotifications() 133 { 134 return allow_sync_events; 135 } 136 137 public void setAllowSynchronousMembershipNotifications(boolean allowSync) 138 { 139 this.allow_sync_events = allowSync; 140 } 141 142 public JChannelFactoryMBean getMultiplexer() 143 { 144 return multiplexer; 145 } 146 147 public String getMultiplexerStack() 148 { 149 return stackName; 150 } 151 152 public Cache getClusteredCache() 153 { 154 return cache; 155 } 156 157 167 public void setClusteredCache(Cache cache) 168 { 169 this.cache = cache; 170 Configuration config = cache.getConfiguration(); 171 multiplexer = config.getRuntimeConfig().getMuxChannelFactory(); 172 173 if (multiplexer == null) 174 throw new IllegalArgumentException ("Cache not configured for a multiplexer"); 175 176 this.stackName = config.getMultiplexerStack(); 177 } 178 179 public int getNamingServicePort() 180 { 181 return namingServicePort; 182 } 183 184 public void setNamingServicePort(int namingServicePort) 185 { 186 this.namingServicePort = namingServicePort; 187 } 188 189 public DistributedState getDistributedState() 190 { 191 return distributedState; 192 } 193 194 public void setDistributedState(DistributedState distributedState) 195 { 196 this.distributedState = distributedState; 197 } 198 } 199 | Popular Tags |