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 org.hornetq.api.core.DiscoveryGroupConfiguration; 017 import org.hornetq.api.core.TransportConfiguration; 018 import org.hornetq.api.core.client.ClientSessionFactory; 019 import org.hornetq.api.core.management.Operation; 020 import org.hornetq.api.core.management.Parameter; 021 022 /** 023 * A ConnectionFactoryControl is used to manage a JMS ConnectionFactory. 024 * <br> 025 * HornetQ JMS ConnectionFactory uses an underlying ClientSessionFactory to connect to HornetQ servers. 026 * Please refer to the ClientSessionFactory for a detailed description. 027 * 028 * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a> 029 * @author <a href="mailto:fox@redhat.com">Tim Fox</a> 030 * 031 * @see ClientSessionFactory 032 */ 033 public interface ConnectionFactoryControl 034 { 035 /** 036 * Returns the configuration name of this connection factory. 037 */ 038 String getName(); 039 040 /** 041 * Returns the JNDI bindings associated to this connection factory. 042 */ 043 String[] getJNDIBindings(); 044 045 /** 046 * does ths cf support HA 047 * @return true if it supports HA 048 */ 049 boolean isHA(); 050 051 /** 052 * return the type of factory 053 * @return 0 = jms cf, 1 = queue cf, 2 = topic cf, 3 = xa cf, 4 = xa queue cf, 5 = xa topic cf 054 */ 055 int getFactoryType(); 056 057 /** 058 * Returns the Client ID of this connection factory (or {@code null} if it is not set. 059 */ 060 String getClientID(); 061 062 /** 063 * Sets the Client ID for this connection factory. 064 */ 065 void setClientID(String clientID); 066 067 boolean isCompressLargeMessages(); 068 069 void setCompressLargeMessages(boolean compress); 070 071 /** 072 * @see ClientSessionFactory#getClientFailureCheckPeriod() 073 */ 074 long getClientFailureCheckPeriod(); 075 076 /** 077 * @see ClientSessionFactory#setClientFailureCheckPeriod 078 */ 079 void setClientFailureCheckPeriod(long clientFailureCheckPeriod); 080 081 /** 082 * @see ClientSessionFactory#getCallTimeout() 083 */ 084 long getCallTimeout(); 085 086 /** 087 * @see ClientSessionFactory#setCallTimeout(long) 088 */ 089 void setCallTimeout(long callTimeout); 090 091 /** 092 * Returns the batch size (in bytes) between acknowledgements when using DUPS_OK_ACKNOWLEDGE mode. 093 * 094 * @see ClientSessionFactory#getAckBatchSize() 095 * @see javax.jms.Session#DUPS_OK_ACKNOWLEDGE 096 */ 097 int getDupsOKBatchSize(); 098 099 /** 100 * @see ClientSessionFactory#setAckBatchSize(int) 101 */ 102 void setDupsOKBatchSize(int dupsOKBatchSize); 103 104 /** 105 * @see ClientSessionFactory#getConsumerMaxRate() 106 */ 107 int getConsumerMaxRate(); 108 109 /** 110 * @see ClientSessionFactory#setConsumerMaxRate(int) 111 */ 112 void setConsumerMaxRate(int consumerMaxRate); 113 114 /** 115 * @see ClientSessionFactory#getConsumerWindowSize() 116 */ 117 int getConsumerWindowSize(); 118 119 /** 120 * @see ClientSessionFactory#setConfirmationWindowSize(int) 121 */ 122 void setConsumerWindowSize(int consumerWindowSize); 123 124 /** 125 * @see ClientSessionFactory#getProducerMaxRate() 126 */ 127 int getProducerMaxRate(); 128 129 /** 130 * @see ClientSessionFactory#setProducerMaxRate(int) 131 */ 132 void setProducerMaxRate(int producerMaxRate); 133 134 /** 135 * @see ClientSessionFactory#getConfirmationWindowSize() 136 */ 137 int getConfirmationWindowSize(); 138 139 /** 140 * @see ClientSessionFactory#setConfirmationWindowSize(int) 141 */ 142 void setConfirmationWindowSize(int confirmationWindowSize); 143 144 /** 145 * @see ClientSessionFactory#isBlockOnAcknowledge() 146 */ 147 boolean isBlockOnAcknowledge(); 148 149 /** 150 * @see ClientSessionFactory#setBlockOnAcknowledge(boolean) 151 */ 152 void setBlockOnAcknowledge(boolean blockOnAcknowledge); 153 154 /** 155 * @see ClientSessionFactory#isBlockOnDurableSend() 156 */ 157 boolean isBlockOnDurableSend(); 158 159 /** 160 * @see ClientSessionFactory#setBlockOnDurableSend(boolean) 161 */ 162 void setBlockOnDurableSend(boolean blockOnDurableSend); 163 164 /** 165 * @see ClientSessionFactory#isBlockOnNonDurableSend() 166 */ 167 boolean isBlockOnNonDurableSend(); 168 169 /** 170 * @see ClientSessionFactory#setBlockOnNonDurableSend(boolean) 171 */ 172 void setBlockOnNonDurableSend(boolean blockOnNonDurableSend); 173 174 /** 175 * @see ClientSessionFactory#isPreAcknowledge() 176 */ 177 boolean isPreAcknowledge(); 178 179 /** 180 * @see ClientSessionFactory#setPreAcknowledge(boolean) 181 */ 182 void setPreAcknowledge(boolean preAcknowledge); 183 184 185 /** 186 * @see ClientSessionFactory#getConnectionTTL() 187 */ 188 long getConnectionTTL(); 189 190 /** 191 * @see ClientSessionFactory#setConnectionTTL(long) 192 */ 193 void setConnectionTTL(long connectionTTL); 194 195 /** 196 * Returns the batch size (in bytes) between acknowledgements when using a transacted session. 197 * 198 * @see ClientSessionFactory#getAckBatchSize() 199 */ 200 int getTransactionBatchSize(); 201 202 /** 203 * @see ClientSessionFactory#setAckBatchSize(int) 204 */ 205 void setTransactionBatchSize(int transactionBatchSize); 206 207 /** 208 * @see ClientSessionFactory#getMinLargeMessageSize() 209 */ 210 int getMinLargeMessageSize(); 211 212 /** 213 * @see ClientSessionFactory#setMinLargeMessageSize(int) 214 */ 215 void setMinLargeMessageSize(int minLargeMessageSize); 216 217 /** 218 * @see ClientSessionFactory#isAutoGroup() 219 */ 220 boolean isAutoGroup(); 221 222 /** 223 * @see ClientSessionFactory#setAutoGroup(boolean) 224 */ 225 void setAutoGroup(boolean autoGroup); 226 227 /** 228 * @see ClientSessionFactory#getRetryInterval() 229 */ 230 long getRetryInterval(); 231 232 /** 233 * @see ClientSessionFactory#setRetryInterval(long) 234 */ 235 void setRetryInterval(long retryInterval); 236 237 /** 238 * @see ClientSessionFactory#getRetryIntervalMultiplier() 239 */ 240 double getRetryIntervalMultiplier(); 241 242 /** 243 * @see ClientSessionFactory#setRetryIntervalMultiplier(double) 244 */ 245 void setRetryIntervalMultiplier(double retryIntervalMultiplier); 246 247 /** 248 * @see ClientSessionFactory#getReconnectAttempts() 249 */ 250 int getReconnectAttempts(); 251 252 /** 253 * @see ClientSessionFactory#setReconnectAttempts(int) 254 */ 255 void setReconnectAttempts(int reconnectAttempts); 256 257 /** 258 * @see ClientSessionFactory#isFailoverOnInitialConnection() 259 */ 260 boolean isFailoverOnInitialConnection(); 261 262 /** 263 * @see ClientSessionFactory#setFailoverOnInitialConnection(boolean) 264 */ 265 void setFailoverOnInitialConnection(boolean failoverOnInitialConnection); 266 267 268 /** 269 * @see org.hornetq.api.core.client.ClientSessionFactory#getProducerWindowSize() 270 */ 271 int getProducerWindowSize(); 272 273 /** 274 * @see ClientSessionFactory#setProducerWindowSize(int) 275 */ 276 void setProducerWindowSize(int producerWindowSize); 277 278 /** 279 * @see ClientSessionFactory#isCacheLargeMessagesClient() 280 */ 281 boolean isCacheLargeMessagesClient(); 282 283 /** 284 * @see ClientSessionFactory#setCacheLargeMessagesClient(boolean) 285 */ 286 void setCacheLargeMessagesClient(boolean cacheLargeMessagesClient); 287 288 /** 289 * @see ClientSessionFactory#getMaxRetryInterval() 290 */ 291 long getMaxRetryInterval(); 292 293 /** 294 * @see ClientSessionFactory#setMaxRetryInterval(long) 295 */ 296 void setMaxRetryInterval(long retryInterval); 297 298 /** 299 * @see ClientSessionFactory#getScheduledThreadPoolMaxSize() 300 */ 301 int getScheduledThreadPoolMaxSize(); 302 303 /** 304 * @see ClientSessionFactory#setScheduledThreadPoolMaxSize(int) 305 */ 306 void setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize); 307 308 /** 309 * @see ClientSessionFactory#getThreadPoolMaxSize() 310 */ 311 int getThreadPoolMaxSize(); 312 313 /** 314 * @see ClientSessionFactory#setThreadPoolMaxSize(int) 315 */ 316 void setThreadPoolMaxSize(int threadPoolMaxSize); 317 318 /** 319 * @see ClientSessionFactory#getGroupID() 320 */ 321 String getGroupID(); 322 323 /** 324 * @see ClientSessionFactory#setGroupID(String) 325 */ 326 void setGroupID(String groupID); 327 328 /** 329 * @see ClientSessionFactory#getInitialMessagePacketSize() 330 */ 331 int getInitialMessagePacketSize(); 332 333 /** 334 * @see ClientSessionFactory#isUseGlobalPools() 335 */ 336 boolean isUseGlobalPools(); 337 338 /** 339 * @see ClientSessionFactory#setUseGlobalPools(boolean) 340 */ 341 void setUseGlobalPools(boolean useGlobalPools); 342 343 /** 344 * @see ClientSessionFactory#getConnectionLoadBalancingPolicyClassName() 345 */ 346 String getConnectionLoadBalancingPolicyClassName(); 347 348 /** 349 * @see ClientSessionFactory#setConnectionLoadBalancingPolicyClassName(String) 350 */ 351 void setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName); 352 353 /** 354 * @see ClientSessionFactory#getStaticConnectors() 355 */ 356 TransportConfiguration[] getStaticConnectors(); 357 358 /** 359 * get the discovery group configuration 360 */ 361 DiscoveryGroupConfiguration getDiscoveryGroupConfiguration(); 362 363 /** 364 * Add the JNDI binding to this destination 365 */ 366 @Operation(desc = "Adds the factory to another JNDI binding") 367 void addJNDI(@Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI") String jndi) throws Exception; 368 369 /** 370 * Remove a JNDI binding 371 */ 372 @Operation(desc = "Remove an existing JNDI binding") 373 void removeJNDI(@Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI") String jndi) throws Exception; 374 }