001 /* 002 * Copyright 2009 Red Hat, Inc. 003 * Red Hat licenses this file to you under the Apache License, version 004 * 2.0 (the "License"); you may not use this file except in compliance 005 * with the License. You may obtain a copy of the License at 006 * http://www.apache.org/licenses/LICENSE-2.0 007 * Unless required by applicable law or agreed to in writing, software 008 * distributed under the License is distributed on an "AS IS" BASIS, 009 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 010 * implied. See the License for the specific language governing 011 * permissions and limitations under the License. 012 */ 013 014 package org.hornetq.api.jms.management; 015 016 import java.util.List; 017 018 import org.hornetq.api.core.Pair; 019 import org.hornetq.api.core.TransportConfiguration; 020 import org.hornetq.api.core.client.ClientSessionFactory; 021 import org.hornetq.api.core.management.Operation; 022 import org.hornetq.api.core.management.Parameter; 023 024 /** 025 * A ConnectionFactoryControl is used to manage a JMS ConnectionFactory. 026 * <br> 027 * HornetQ JMS ConnectionFactory uses an underlying ClientSessionFactory to connect to HornetQ servers. 028 * Please refer to the ClientSessionFactory for a detailed description. 029 * 030 * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a> 031 * @author <a href="mailto:fox@redhat.com">Tim Fox</a> 032 * 033 * @see ClientSessionFactory 034 */ 035 public interface ConnectionFactoryControl 036 { 037 /** 038 * Returns the configuration name of this connection factory. 039 */ 040 String getName(); 041 042 /** 043 * Returns the JNDI bindings associated to this connection factory. 044 */ 045 String[] getJNDIBindings(); 046 047 /** 048 * Returns the Client ID of this connection factory (or {@code null} if it is not set. 049 */ 050 String getClientID(); 051 052 /** 053 * Sets the Client ID for this connection factory. 054 */ 055 void setClientID(String clientID); 056 057 /** 058 * @see ClientSessionFactory#getClientFailureCheckPeriod() 059 */ 060 long getClientFailureCheckPeriod(); 061 062 /** 063 * @see ClientSessionFactory#setClientFailureCheckPeriod 064 */ 065 void setClientFailureCheckPeriod(long clientFailureCheckPeriod); 066 067 /** 068 * @see ClientSessionFactory#getCallTimeout() 069 */ 070 long getCallTimeout(); 071 072 /** 073 * @see ClientSessionFactory#setCallTimeout(long) 074 */ 075 void setCallTimeout(long callTimeout); 076 077 /** 078 * Returns the batch size (in bytes) between acknowledgements when using DUPS_OK_ACKNOWLEDGE mode. 079 * 080 * @see ClientSessionFactory#getAckBatchSize() 081 * @see javax.jms.Session#DUPS_OK_ACKNOWLEDGE 082 */ 083 int getDupsOKBatchSize(); 084 085 /** 086 * @see ClientSessionFactory#setAckBatchSize(int) 087 */ 088 void setDupsOKBatchSize(int dupsOKBatchSize); 089 090 /** 091 * @see ClientSessionFactory#getConsumerMaxRate() 092 */ 093 int getConsumerMaxRate(); 094 095 /** 096 * @see ClientSessionFactory#setConsumerMaxRate(int) 097 */ 098 void setConsumerMaxRate(int consumerMaxRate); 099 100 /** 101 * @see ClientSessionFactory#getConsumerWindowSize() 102 */ 103 int getConsumerWindowSize(); 104 105 /** 106 * @see ClientSessionFactory#setConfirmationWindowSize(int) 107 */ 108 void setConsumerWindowSize(int consumerWindowSize); 109 110 /** 111 * @see ClientSessionFactory#getProducerMaxRate() 112 */ 113 int getProducerMaxRate(); 114 115 /** 116 * @see ClientSessionFactory#setProducerMaxRate(int) 117 */ 118 void setProducerMaxRate(int producerMaxRate); 119 120 /** 121 * @see ClientSessionFactory#getConfirmationWindowSize() 122 */ 123 int getConfirmationWindowSize(); 124 125 /** 126 * @see ClientSessionFactory#setConfirmationWindowSize(int) 127 */ 128 void setConfirmationWindowSize(int confirmationWindowSize); 129 130 /** 131 * @see ClientSessionFactory#isBlockOnAcknowledge() 132 */ 133 boolean isBlockOnAcknowledge(); 134 135 /** 136 * @see ClientSessionFactory#setBlockOnAcknowledge(boolean) 137 */ 138 void setBlockOnAcknowledge(boolean blockOnAcknowledge); 139 140 /** 141 * @see ClientSessionFactory#isBlockOnDurableSend() 142 */ 143 boolean isBlockOnDurableSend(); 144 145 /** 146 * @see ClientSessionFactory#setBlockOnDurableSend(boolean) 147 */ 148 void setBlockOnDurableSend(boolean blockOnDurableSend); 149 150 /** 151 * @see ClientSessionFactory#isBlockOnNonDurableSend() 152 */ 153 boolean isBlockOnNonDurableSend(); 154 155 /** 156 * @see ClientSessionFactory#setBlockOnNonDurableSend(boolean) 157 */ 158 void setBlockOnNonDurableSend(boolean blockOnNonDurableSend); 159 160 /** 161 * @see ClientSessionFactory#isPreAcknowledge() 162 */ 163 boolean isPreAcknowledge(); 164 165 /** 166 * @see ClientSessionFactory#setPreAcknowledge(boolean) 167 */ 168 void setPreAcknowledge(boolean preAcknowledge); 169 170 171 /** 172 * @see ClientSessionFactory#getConnectionTTL() 173 */ 174 long getConnectionTTL(); 175 176 /** 177 * @see ClientSessionFactory#setConnectionTTL(long) 178 */ 179 void setConnectionTTL(long connectionTTL); 180 181 /** 182 * Returns the batch size (in bytes) between acknowledgements when using a transacted session. 183 * 184 * @see ClientSessionFactory#getAckBatchSize() 185 */ 186 int getTransactionBatchSize(); 187 188 /** 189 * @see ClientSessionFactory#setAckBatchSize(int) 190 */ 191 void setTransactionBatchSize(int transactionBatchSize); 192 193 /** 194 * @see ClientSessionFactory#getMinLargeMessageSize() 195 */ 196 int getMinLargeMessageSize(); 197 198 /** 199 * @see ClientSessionFactory#setMinLargeMessageSize(int) 200 */ 201 void setMinLargeMessageSize(int minLargeMessageSize); 202 203 /** 204 * @see ClientSessionFactory#isAutoGroup() 205 */ 206 boolean isAutoGroup(); 207 208 /** 209 * @see ClientSessionFactory#setAutoGroup(boolean) 210 */ 211 void setAutoGroup(boolean autoGroup); 212 213 /** 214 * @see ClientSessionFactory#getRetryInterval() 215 */ 216 long getRetryInterval(); 217 218 /** 219 * @see ClientSessionFactory#setRetryInterval(long) 220 */ 221 void setRetryInterval(long retryInterval); 222 223 /** 224 * @see ClientSessionFactory#getRetryIntervalMultiplier() 225 */ 226 double getRetryIntervalMultiplier(); 227 228 /** 229 * @see ClientSessionFactory#setRetryIntervalMultiplier(double) 230 */ 231 void setRetryIntervalMultiplier(double retryIntervalMultiplier); 232 233 /** 234 * @see ClientSessionFactory#getReconnectAttempts() 235 */ 236 int getReconnectAttempts(); 237 238 /** 239 * @see ClientSessionFactory#setReconnectAttempts(int) 240 */ 241 void setReconnectAttempts(int reconnectAttempts); 242 243 /** 244 * @see ClientSessionFactory#isFailoverOnInitialConnection() 245 */ 246 boolean isFailoverOnInitialConnection(); 247 248 /** 249 * @see ClientSessionFactory#setFailoverOnInitialConnection(boolean) 250 */ 251 void setFailoverOnInitialConnection(boolean failoverOnInitialConnection); 252 253 /** 254 * @see ClientSessionFactory#isFailoverOnServerShutdown() 255 */ 256 boolean isFailoverOnServerShutdown(); 257 258 /** 259 * @see ClientSessionFactory#setFailoverOnServerShutdown(boolean) 260 */ 261 void setFailoverOnServerShutdown(boolean failoverOnServerShutdown); 262 263 /** 264 * @see org.hornetq.api.core.client.ClientSessionFactory#getDiscoveryRefreshTimeout() 265 */ 266 long getDiscoveryRefreshTimeout(); 267 268 /** 269 * @see ClientSessionFactory#setDiscoveryRefreshTimeout(long) 270 */ 271 void setDiscoveryRefreshTimeout(long discoveryRefreshTimeout); 272 273 /** 274 * @see org.hornetq.api.core.client.ClientSessionFactory#getDiscoveryInitialWaitTimeout() 275 */ 276 long getDiscoveryInitialWaitTimeout(); 277 278 /** 279 * @see ClientSessionFactory#setDiscoveryInitialWaitTimeout(long) 280 */ 281 void setDiscoveryInitialWaitTimeout(long discoveryInitialWaitTimeout); 282 283 /** 284 * @see org.hornetq.api.core.client.ClientSessionFactory#getProducerWindowSize() 285 */ 286 int getProducerWindowSize(); 287 288 /** 289 * @see ClientSessionFactory#setProducerWindowSize(int) 290 */ 291 void setProducerWindowSize(int producerWindowSize); 292 293 /** 294 * @see ClientSessionFactory#isCacheLargeMessagesClient() 295 */ 296 boolean isCacheLargeMessagesClient(); 297 298 /** 299 * @see ClientSessionFactory#setCacheLargeMessagesClient(boolean) 300 */ 301 void setCacheLargeMessagesClient(boolean cacheLargeMessagesClient); 302 303 /** 304 * @see ClientSessionFactory#getMaxRetryInterval() 305 */ 306 long getMaxRetryInterval(); 307 308 /** 309 * @see ClientSessionFactory#setMaxRetryInterval(long) 310 */ 311 void setMaxRetryInterval(long retryInterval); 312 313 /** 314 * @see ClientSessionFactory#getScheduledThreadPoolMaxSize() 315 */ 316 int getScheduledThreadPoolMaxSize(); 317 318 /** 319 * @see ClientSessionFactory#setScheduledThreadPoolMaxSize(int) 320 */ 321 void setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize); 322 323 /** 324 * @see ClientSessionFactory#getThreadPoolMaxSize() 325 */ 326 int getThreadPoolMaxSize(); 327 328 /** 329 * @see ClientSessionFactory#setThreadPoolMaxSize(int) 330 */ 331 void setThreadPoolMaxSize(int threadPoolMaxSize); 332 333 /** 334 * @see ClientSessionFactory#getGroupID() 335 */ 336 String getGroupID(); 337 338 /** 339 * @see ClientSessionFactory#setGroupID(String) 340 */ 341 void setGroupID(String groupID); 342 343 /** 344 * @see ClientSessionFactory#getInitialMessagePacketSize() 345 */ 346 int getInitialMessagePacketSize(); 347 348 /** 349 * @see ClientSessionFactory#setInitialMessagePacketSize(int) 350 */ 351 void setInitialMessagePacketSize(int size); 352 353 /** 354 * @see ClientSessionFactory#isUseGlobalPools() 355 */ 356 boolean isUseGlobalPools(); 357 358 /** 359 * @see ClientSessionFactory#setUseGlobalPools(boolean) 360 */ 361 void setUseGlobalPools(boolean useGlobalPools); 362 363 /** 364 * @see ClientSessionFactory#getConnectionLoadBalancingPolicyClassName() 365 */ 366 String getConnectionLoadBalancingPolicyClassName(); 367 368 /** 369 * @see ClientSessionFactory#setConnectionLoadBalancingPolicyClassName(String) 370 */ 371 void setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName); 372 373 /** 374 * @see ClientSessionFactory#getStaticConnectors() 375 */ 376 List<Pair<TransportConfiguration, TransportConfiguration>> getStaticConnectors(); 377 378 /** 379 * @see ClientSessionFactory#setStaticConnectors(java.util.List) 380 */ 381 void setStaticConnectors(List<Pair<TransportConfiguration, TransportConfiguration>> staticConnectors); 382 383 /** 384 * @see ClientSessionFactory#getLocalBindAddress() 385 */ 386 String getLocalBindAddress(); 387 388 /** 389 * @see ClientSessionFactory#setLocalBindAddress(String) 390 */ 391 void setLocalBindAddress(String localBindAddress); 392 393 /** 394 * @see ClientSessionFactory#getDiscoveryAddress() 395 */ 396 String getDiscoveryAddress(); 397 398 /** 399 * @see ClientSessionFactory#setDiscoveryAddress(String) 400 */ 401 void setDiscoveryAddress(String discoveryAddress); 402 403 404 405 /** 406 * @see ClientSessionFactory#getDiscoveryPort() 407 */ 408 int getDiscoveryPort(); 409 410 /** 411 * @see ClientSessionFactory#setDiscoveryPort(int) 412 */ 413 void setDiscoveryPort(int discoveryPort); 414 415 /** 416 * Add the JNDI binding to this destination 417 */ 418 @Operation(desc = "Adds the factory to another JNDI binding") 419 void addJNDI(@Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI") String jndi) throws Exception; 420 }