JBoss hornetq SVN: r12053 - branches/Branch_2_2_AS7/src/main/org/hornetq/ra.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-01-31 10:39:07 -0500 (Tue, 31 Jan 2012)
New Revision: 12053
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java
Log:
removed unneeded logging
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2012-01-31 13:04:06 UTC (rev 12052)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2012-01-31 15:39:07 UTC (rev 12053)
@@ -242,10 +242,10 @@
*/
public void stop()
{
- //if (HornetQResourceAdapter.trace)
- // {
+ if (HornetQResourceAdapter.trace)
+ {
HornetQResourceAdapter.log.info("stop()*******************************************************************");
- // }
+ }
for (Map.Entry<ActivationSpec, HornetQActivation> entry : activations.entrySet())
{
12 years, 10 months
JBoss hornetq SVN: r12052 - in branches/Branch_2_2_AS7: src/main/org/hornetq/core/protocol/core and 8 other directories.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-01-31 08:04:06 -0500 (Tue, 31 Jan 2012)
New Revision: 12052
Added:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/security/HornetQPrincipal.java
Modified:
branches/Branch_2_2_AS7/hornetq-rest/docbook/reference/en/master.xml
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty/NettyAcceptor.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty/NettyConnection.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/RemotingService.java
branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
branches/Branch_2_2_AS7/src/main/org/hornetq/spi/core/remoting/Acceptor.java
branches/Branch_2_2_AS7/src/main/org/hornetq/spi/core/remoting/Connection.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/largemessage/mock/MockConnector.java
Log:
https://issues.jboss.org/browse/HORNETQ-841 - added unsecure option for invm connections
Modified: branches/Branch_2_2_AS7/hornetq-rest/docbook/reference/en/master.xml
===================================================================
--- branches/Branch_2_2_AS7/hornetq-rest/docbook/reference/en/master.xml 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/hornetq-rest/docbook/reference/en/master.xml 2012-01-31 13:04:06 UTC (rev 12052)
@@ -861,7 +861,7 @@
pull works almost identically for queues and topics with some minor, but
important caveats. To start consuming you must create a consumer resource
on the server that is dedicated to your client. Now, this pretty much
- breaks the stateless principle of REST, but after much prototyping, this
+ breaks the stateless principal of REST, but after much prototyping, this
is the best way to work most effectively with HornetQ through a REST
interface.</para>
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -13,6 +13,7 @@
package org.hornetq.core.protocol.core;
+import org.hornetq.core.security.HornetQPrincipal;
import org.hornetq.spi.core.protocol.RemotingConnection;
@@ -100,4 +101,11 @@
* Called periodically to flush any data in the batch buffer
*/
void checkFlushBatchBuffer();
+
+ /**
+ * get the default security principal for invm
+ *
+ * @return the principal
+ */
+ HornetQPrincipal getDefaultHornetQPrincipal();
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -34,6 +34,7 @@
import org.hornetq.core.protocol.core.impl.wireformat.ReattachSessionMessage;
import org.hornetq.core.protocol.core.impl.wireformat.ReattachSessionResponseMessage;
import org.hornetq.core.replication.ReplicationEndpoint;
+import org.hornetq.core.security.HornetQPrincipal;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.ServerSession;
import org.hornetq.core.version.Version;
@@ -176,9 +177,16 @@
Channel channel = connection.getChannel(request.getSessionChannelID(), request.getWindowSize());
+ HornetQPrincipal hornetQPrincipal = null;
+
+ if(request.getUsername() == null)
+ {
+ hornetQPrincipal = connection.getDefaultHornetQPrincipal();
+ }
+
ServerSession session = server.createSession(request.getName(),
- request.getUsername(),
- request.getPassword(),
+ hornetQPrincipal == null?request.getUsername(): hornetQPrincipal.getUserName(),
+ hornetQPrincipal == null?request.getPassword(): hornetQPrincipal.getPassword(),
request.getMinLargeMessageSize(),
connection,
request.isAutoCommitSends(),
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -33,6 +33,7 @@
import org.hornetq.core.protocol.core.impl.wireformat.DisconnectMessage;
import org.hornetq.core.remoting.CloseListener;
import org.hornetq.core.remoting.FailureListener;
+import org.hornetq.core.security.HornetQPrincipal;
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
import org.hornetq.utils.SimpleIDGenerator;
@@ -463,6 +464,11 @@
transportConnection.checkFlushBatchBuffer();
}
+ public HornetQPrincipal getDefaultHornetQPrincipal()
+ {
+ return transportConnection.getDefaultHornetQPrincipal();
+ }
+
// Buffer Handler implementation
// ----------------------------------------------------
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -21,6 +21,7 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.management.NotificationType;
import org.hornetq.core.logging.Logger;
+import org.hornetq.core.security.HornetQPrincipal;
import org.hornetq.core.server.cluster.ClusterConnection;
import org.hornetq.core.server.management.Notification;
import org.hornetq.core.server.management.NotificationService;
@@ -64,6 +65,8 @@
private final Map<String, Object> configuration;
+ private HornetQPrincipal defaultHornetQPrincipal;
+
public InVMAcceptor(final ClusterConnection clusterConnection,
final Map<String, Object> configuration,
final BufferHandler handler,
@@ -209,7 +212,7 @@
throw new IllegalStateException("Acceptor is not started");
}
- new InVMConnection(this, id, connectionID, remoteHandler, new Listener(connector), clientExecutor);
+ new InVMConnection(this, id, connectionID, remoteHandler, new Listener(connector), clientExecutor, defaultHornetQPrincipal);
}
public void disconnect(final String connectionID)
@@ -227,6 +230,16 @@
}
}
+ public boolean isUnsecurable()
+ {
+ return true;
+ }
+
+ public void setDefaultHornetQPrincipal(HornetQPrincipal defaultHornetQPrincipal)
+ {
+ this.defaultHornetQPrincipal = defaultHornetQPrincipal;
+ }
+
private class Listener implements ConnectionLifeCycleListener
{
//private static Listener instance = new Listener();
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -20,6 +20,7 @@
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.HornetQBuffers;
import org.hornetq.core.logging.Logger;
+import org.hornetq.core.security.HornetQPrincipal;
import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.BufferHandler;
@@ -58,6 +59,8 @@
private volatile boolean closing;
+ private HornetQPrincipal defaultHornetQPrincipal;
+
public InVMConnection(final Acceptor acceptor,
final int serverID,
final BufferHandler handler,
@@ -74,6 +77,17 @@
final ConnectionLifeCycleListener listener,
final Executor executor)
{
+ this(acceptor, serverID, id, handler, listener, executor, null);
+ }
+
+ public InVMConnection(final Acceptor acceptor,
+ final int serverID,
+ final String id,
+ final BufferHandler handler,
+ final ConnectionLifeCycleListener listener,
+ final Executor executor,
+ HornetQPrincipal defaultHornetQPrincipal)
+ {
this.serverID = serverID;
this.handler = handler;
@@ -84,6 +98,8 @@
this.executor = executor;
+ this.defaultHornetQPrincipal = defaultHornetQPrincipal;
+
listener.connectionCreated(acceptor, this, ProtocolType.CORE);
}
@@ -213,7 +229,12 @@
public void removeReadyListener(ReadyListener listener)
{
}
-
+
+ public HornetQPrincipal getDefaultHornetQPrincipal()
+ {
+ return defaultHornetQPrincipal;
+ }
+
public void disableFlush()
{
flushEnabled = false;
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty/NettyAcceptor.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty/NettyAcceptor.java 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty/NettyAcceptor.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -37,6 +37,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.protocol.stomp.WebSocketServerHandler;
import org.hornetq.core.remoting.impl.ssl.SSLSupport;
+import org.hornetq.core.security.HornetQPrincipal;
import org.hornetq.core.server.cluster.ClusterConnection;
import org.hornetq.core.server.management.Notification;
import org.hornetq.core.server.management.NotificationService;
@@ -646,10 +647,20 @@
{
this.notificationService = notificationService;
}
-
+
+ public void setDefaultHornetQPrincipal(HornetQPrincipal defaultHornetQPrincipal)
+ {
+ throw new IllegalStateException("unsecure connections not allowed");
+ }
+
+ public boolean isUnsecurable()
+ {
+ return false;
+ }
+
/* (non-Javadoc)
- * @see org.hornetq.spi.core.remoting.Acceptor#getClusterConnection()
- */
+ * @see org.hornetq.spi.core.remoting.Acceptor#getClusterConnection()
+ */
public ClusterConnection getClusterConnection()
{
return clusterConnection;
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty/NettyConnection.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty/NettyConnection.java 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty/NettyConnection.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -20,6 +20,7 @@
import org.hornetq.api.core.HornetQBuffers;
import org.hornetq.core.buffers.impl.ChannelBufferWrapper;
import org.hornetq.core.logging.Logger;
+import org.hornetq.core.security.HornetQPrincipal;
import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.Connection;
@@ -272,6 +273,12 @@
readyListeners.remove(listener);
}
+ //never allow this
+ public HornetQPrincipal getDefaultHornetQPrincipal()
+ {
+ return null;
+ }
+
public void fireReady(final boolean ready)
{
for (ReadyListener listener : readyListeners)
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/RemotingService.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/RemotingService.java 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/RemotingService.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -16,6 +16,7 @@
import java.util.Set;
import org.hornetq.api.core.Interceptor;
+import org.hornetq.core.security.HornetQPrincipal;
import org.hornetq.spi.core.protocol.RemotingConnection;
/**
@@ -49,5 +50,7 @@
void freeze();
+ void allowInvmSecurityOverride(HornetQPrincipal principal);
+
RemotingConnection getServerSideReplicatingConnection();
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -36,8 +36,10 @@
import org.hornetq.core.protocol.core.impl.CoreProtocolManagerFactory;
import org.hornetq.core.protocol.stomp.StompProtocolManagerFactory;
import org.hornetq.core.remoting.FailureListener;
+import org.hornetq.core.remoting.impl.invm.InVMAcceptor;
import org.hornetq.core.remoting.impl.netty.TransportConstants;
import org.hornetq.core.remoting.server.RemotingService;
+import org.hornetq.core.security.HornetQPrincipal;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.cluster.ClusterConnection;
import org.hornetq.core.server.cluster.ClusterManager;
@@ -246,6 +248,17 @@
started = true;
}
+ public synchronized void allowInvmSecurityOverride(HornetQPrincipal principal)
+ {
+ for (Acceptor acceptor : acceptors)
+ {
+ if(acceptor.isUnsecurable())
+ {
+ acceptor.setDefaultHornetQPrincipal(principal);
+ }
+ }
+ }
+
public synchronized void freeze()
{
// Used in testing - prevents service taking any more connections
Added: branches/Branch_2_2_AS7/src/main/org/hornetq/core/security/HornetQPrincipal.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/security/HornetQPrincipal.java (rev 0)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/security/HornetQPrincipal.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2010, Red Hat, Inc., and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.hornetq.core.security;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * 1/30/12
+ */
+public class HornetQPrincipal
+{
+ private final String userName;
+
+ private final String password;
+
+ public HornetQPrincipal(String userName, String password)
+ {
+ this.userName = userName;
+ this.password = password;
+ }
+
+ public String getUserName()
+ {
+ return userName;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/spi/core/remoting/Acceptor.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/spi/core/remoting/Acceptor.java 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/spi/core/remoting/Acceptor.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -15,6 +15,7 @@
import java.util.Map;
+import org.hornetq.core.security.HornetQPrincipal;
import org.hornetq.core.server.HornetQComponent;
import org.hornetq.core.server.cluster.ClusterConnection;
import org.hornetq.core.server.management.NotificationService;
@@ -46,4 +47,8 @@
* @param notificationService the notification service
*/
void setNotificationService(NotificationService notificationService);
+
+ void setDefaultHornetQPrincipal(HornetQPrincipal defaultHornetQPrincipal);
+
+ boolean isUnsecurable();
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/spi/core/remoting/Connection.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/spi/core/remoting/Connection.java 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/spi/core/remoting/Connection.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -14,6 +14,7 @@
package org.hornetq.spi.core.remoting;
import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.security.HornetQPrincipal;
/**
* The connection used by a channel to write data to.
@@ -74,4 +75,6 @@
void addReadyListener(ReadyListener listener);
void removeReadyListener(ReadyListener listener);
+
+ HornetQPrincipal getDefaultHornetQPrincipal();
}
\ No newline at end of file
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/largemessage/mock/MockConnector.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/largemessage/mock/MockConnector.java 2012-01-30 22:24:46 UTC (rev 12051)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/largemessage/mock/MockConnector.java 2012-01-31 13:04:06 UTC (rev 12052)
@@ -20,6 +20,7 @@
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.core.remoting.impl.invm.InVMConnection;
import org.hornetq.core.remoting.impl.invm.InVMConnector;
+import org.hornetq.core.security.HornetQPrincipal;
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
import org.hornetq.spi.core.remoting.ConnectionLifeCycleListener;
@@ -103,5 +104,10 @@
super.write(buffer, flush, batch);
}
+
+ public HornetQPrincipal getDefaultHornetQPrincipal()
+ {
+ return null;
+ }
}
}
12 years, 10 months
JBoss hornetq SVN: r12050 - branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-01-26 12:37:08 -0500 (Thu, 26 Jan 2012)
New Revision: 12050
Modified:
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra/HornetQResourceAdapterConfigTest.java
Log:
https://issues.jboss.org/browse/HORNETQ-836 - test fix
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra/HornetQResourceAdapterConfigTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra/HornetQResourceAdapterConfigTest.java 2012-01-26 12:59:39 UTC (rev 12049)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra/HornetQResourceAdapterConfigTest.java 2012-01-26 17:37:08 UTC (rev 12050)
@@ -101,6 +101,12 @@
" </config-property>\n" +
" <config-property>\n" +
" <description>The discovery group address</description>\n" +
+ " <config-property-name>DiscoveryLocalBindAddress</config-property-name>\n" +
+ " <config-property-type>java.lang.String</config-property-type>\n" +
+ " <config-property-value></config-property-value>\n" +
+ " </config-property>\n" +
+ " <config-property>\n" +
+ " <description>The discovery group local bind address</description>\n" +
" <config-property-name>DiscoveryAddress</config-property-name>\n" +
" <config-property-type>java.lang.String</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
12 years, 11 months
JBoss hornetq SVN: r12049 - in branches/Branch_2_2_AS7: tests/src/org/hornetq/tests/unit/ra and 1 other directory.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-01-26 07:59:39 -0500 (Thu, 26 Jan 2012)
New Revision: 12049
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/ra/ConnectionFactoryProperties.java
branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra/ResourceAdapterTest.java
Log:
https://issues.jboss.org/browse/HORNETQ-836 - added discovery local bind address
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/ra/ConnectionFactoryProperties.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/ra/ConnectionFactoryProperties.java 2012-01-26 10:35:18 UTC (rev 12048)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/ra/ConnectionFactoryProperties.java 2012-01-26 12:59:39 UTC (rev 12049)
@@ -52,6 +52,8 @@
private Integer discoveryPort;
+ private String discoveryLocalBindAddress;
+
private Long discoveryRefreshTimeout;
private Long discoveryInitialWaitTimeout;
@@ -183,6 +185,25 @@
return discoveryPort;
}
+ public void setDiscoveryLocalBindAddress(String discoveryLocalBindAddress)
+ {
+ if (ConnectionFactoryProperties.trace)
+ {
+ ConnectionFactoryProperties.log.trace("setDiscoveryLocalBindAddress(" + discoveryLocalBindAddress + ")");
+ }
+ hasBeenUpdated = true;
+ this.discoveryLocalBindAddress = discoveryLocalBindAddress;
+ }
+
+ public String getDiscoveryLocalBindAddress()
+ {
+ if (ConnectionFactoryProperties.trace)
+ {
+ ConnectionFactoryProperties.log.trace("getDiscoveryLocalBindAddress()");
+ }
+ return discoveryLocalBindAddress;
+ }
+
public void setDiscoveryPort(final Integer discoveryPort)
{
if (ConnectionFactoryProperties.trace)
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2012-01-26 10:35:18 UTC (rev 12048)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2012-01-26 12:59:39 UTC (rev 12049)
@@ -44,7 +44,6 @@
import org.hornetq.api.jms.JMSFactoryType;
import org.hornetq.core.logging.Logger;
import org.hornetq.jms.client.HornetQConnectionFactory;
-import org.hornetq.jms.server.recovery.XARecoveryConfig;
import org.hornetq.ra.inflow.HornetQActivation;
import org.hornetq.ra.inflow.HornetQActivationSpec;
import org.hornetq.ra.recovery.RecoveryManager;
@@ -364,6 +363,36 @@
}
/**
+ * set the discovery local bind address
+ *
+ * @param discoveryLocalBindAddress the address value
+ */
+ public void setDiscoveryLocalBindAddress(final String discoveryLocalBindAddress)
+ {
+ if (HornetQResourceAdapter.trace)
+ {
+ HornetQResourceAdapter.log.trace("setDiscoveryLocalBindAddress(" + discoveryLocalBindAddress + ")");
+ }
+
+ raProperties.setDiscoveryLocalBindAddress(discoveryLocalBindAddress);
+ }
+
+ /**
+ * get the discovery local bind address
+ *
+ * @return the address value
+ */
+ public String getDiscoveryLocalBindAddress()
+ {
+ if (HornetQResourceAdapter.trace)
+ {
+ HornetQResourceAdapter.log.trace("getDiscoveryLocalBindAddress()");
+ }
+
+ return raProperties.getDiscoveryLocalBindAddress();
+ }
+
+ /**
* Set the discovery group port
*
* @param dgp The value
@@ -1456,7 +1485,7 @@
{
Integer discoveryPort = overrideProperties.getDiscoveryPort() != null ? overrideProperties.getDiscoveryPort()
: getDiscoveryPort();
-
+
if(discoveryPort == null)
{
discoveryPort = HornetQClient.DEFAULT_DISCOVERY_PORT;
@@ -1488,6 +1517,11 @@
groupConfiguration.setRefreshTimeout(refreshTimeout);
+ String localBindAddress = overrideProperties.getDiscoveryLocalBindAddress() != null ? overrideProperties.getDiscoveryLocalBindAddress()
+ : raProperties.getDiscoveryLocalBindAddress();
+
+ groupConfiguration.setLocalBindAdress(localBindAddress);
+
if (ha)
{
cf = HornetQJMSClient.createConnectionFactoryWithHA(groupConfiguration, JMSFactoryType.XA_CF);
@@ -1596,6 +1630,11 @@
groupConfiguration.setRefreshTimeout(refreshTimeout);
+ String localBindAddress = overrideProperties.getDiscoveryLocalBindAddress() != null ? overrideProperties.getDiscoveryLocalBindAddress()
+ : raProperties.getDiscoveryLocalBindAddress();
+
+ groupConfiguration.setLocalBindAdress(localBindAddress);
+
cf = HornetQJMSClient.createConnectionFactoryWithoutHA(groupConfiguration, JMSFactoryType.XA_CF);
}
else
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra/ResourceAdapterTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra/ResourceAdapterTest.java 2012-01-26 10:35:18 UTC (rev 12048)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra/ResourceAdapterTest.java 2012-01-26 12:59:39 UTC (rev 12049)
@@ -263,9 +263,13 @@
ConnectionFactoryProperties connectionFactoryProperties = new ConnectionFactoryProperties();
connectionFactoryProperties.setDiscoveryAddress("myhost");
connectionFactoryProperties.setDiscoveryPort(5678);
+ connectionFactoryProperties.setDiscoveryLocalBindAddress("newAddress");
HornetQConnectionFactory factory = ra.createHornetQConnectionFactory(connectionFactoryProperties);
HornetQConnectionFactory defaultFactory = ra.getDefaultHornetQConnectionFactory();
Assert.assertNotSame(factory, defaultFactory);
+ Assert.assertEquals(factory.getDiscoveryGroupConfiguration().getLocalBindAddress(), "newAddress");
+ Assert.assertEquals(factory.getDiscoveryGroupConfiguration().getGroupAddress(), "myhost");
+ Assert.assertEquals(factory.getDiscoveryGroupConfiguration().getGroupPort(), 5678);
}
public void testCreateConnectionFactoryMultipleConnectors()
12 years, 11 months
JBoss hornetq SVN: r12048 - branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/management/impl.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-01-26 05:35:18 -0500 (Thu, 26 Jan 2012)
New Revision: 12048
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java
Log:
Hornetq-821 - fix syncronization problem
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java 2012-01-26 07:54:12 UTC (rev 12047)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java 2012-01-26 10:35:18 UTC (rev 12048)
@@ -472,12 +472,12 @@
return reply;
}
- public Object getResource(final String resourceName)
+ public synchronized Object getResource(final String resourceName)
{
return registry.get(resourceName);
}
- public Object[] getResources(final Class<?> resourceType)
+ public synchronized Object[] getResources(final Class<?> resourceType)
{
List<Object> resources = new ArrayList<Object>();
Collection<Object> clone = new ArrayList<Object>(registry.values());
12 years, 11 months
JBoss hornetq SVN: r12047 - in branches/Branch_2_2_AS7: src/config/common and 1 other directory.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-01-26 02:54:12 -0500 (Thu, 26 Jan 2012)
New Revision: 12047
Modified:
branches/Branch_2_2_AS7/build-maven.xml
branches/Branch_2_2_AS7/src/config/common/hornetq-version.properties
Log:
updated version
Modified: branches/Branch_2_2_AS7/build-maven.xml
===================================================================
--- branches/Branch_2_2_AS7/build-maven.xml 2012-01-23 12:02:38 UTC (rev 12046)
+++ branches/Branch_2_2_AS7/build-maven.xml 2012-01-26 07:54:12 UTC (rev 12047)
@@ -13,7 +13,7 @@
-->
<project default="upload" name="HornetQ">
- <property name="hornetq.version" value="2.2.10.Final"/>
+ <property name="hornetq.version" value="2.2.11.Final"/>
<property name="build.dir" value="build"/>
<property name="jars.dir" value="${build.dir}/jars"/>
Modified: branches/Branch_2_2_AS7/src/config/common/hornetq-version.properties
===================================================================
--- branches/Branch_2_2_AS7/src/config/common/hornetq-version.properties 2012-01-23 12:02:38 UTC (rev 12046)
+++ branches/Branch_2_2_AS7/src/config/common/hornetq-version.properties 2012-01-26 07:54:12 UTC (rev 12047)
@@ -1,7 +1,7 @@
-hornetq.version.versionName=HQ_2_2_10_FINAL_AS7
+hornetq.version.versionName=HQ_2_2_11_FINAL_AS7
hornetq.version.majorVersion=2
hornetq.version.minorVersion=2
-hornetq.version.microVersion=10
+hornetq.version.microVersion=11
hornetq.version.incrementingVersion=122
hornetq.version.versionSuffix=Final
hornetq.version.versionTag=Final
12 years, 11 months
JBoss hornetq SVN: r12046 - in trunk: hornetq-core/src/main/java/org/hornetq/core/deployers and 10 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-23 07:02:38 -0500 (Mon, 23 Jan 2012)
New Revision: 12046
Modified:
trunk/hornetq-commons/src/main/java/org/hornetq/utils/TypedProperties.java
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/DeploymentManager.java
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/AddressSettingsDeployer.java
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/SecurityDeployer.java
trunk/hornetq-core/src/main/java/org/hornetq/core/paging/PagingStore.java
trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/PageCache.java
trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/LivePageCacheImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PagePositionImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/ClusterManager.java
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/TransactionOperationAbstract.java
trunk/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java
trunk/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQQueue.java
trunk/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQTemporaryQueue.java
trunk/hornetq-jms/src/main/java/org/hornetq/jms/persistence/config/PersistedConnectionFactory.java
Log:
Non-public API javadoc fixes.
Modified: trunk/hornetq-commons/src/main/java/org/hornetq/utils/TypedProperties.java
===================================================================
--- trunk/hornetq-commons/src/main/java/org/hornetq/utils/TypedProperties.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-commons/src/main/java/org/hornetq/utils/TypedProperties.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -28,8 +28,8 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.PropertyConversionException;
@@ -37,17 +37,14 @@
import org.hornetq.core.logging.Logger;
/**
- *
* Property Value Conversion.
* <p>
- * This implementation follows section 3.5.4 of the <i>Java Message Service<i>
- * specification (Version 1.1 April 12, 2002).
+ * This implementation follows section 3.5.4 of the <i>Java Message Service<i> specification
+ * (Version 1.1 April 12, 2002).
* <p>
* TODO - should have typed property getters and do conversions herein
- *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert Suconic</a>
- * @see <i>Java Message Service<i> specification (Version 1.1 April 12, 2002), section 3.5.4.
*/
public class TypedProperties
{
@@ -138,7 +135,7 @@
checkCreateProperties();
doPutValue(key, value == null ? new NullValue() : new StringValue(value));
}
-
+
public void putNullValue(final SimpleString key)
{
checkCreateProperties();
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/DeploymentManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/DeploymentManager.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/DeploymentManager.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -24,17 +24,15 @@
{
/**
* registers a deployable object which will handle the deployment of URL's
- *
* @param deployer The deployable object
- * @throws Exception .
+ * @throws Exception
*/
void registerDeployer(Deployer deployer) throws Exception;
/**
* unregisters a deployable object which will handle the deployment of URL's
- *
* @param deployer The deployable object
- * @throws Exception .
+ * @throws Exception
*/
void unregisterDeployer(Deployer deployer) throws Exception;
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/AddressSettingsDeployer.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/AddressSettingsDeployer.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/AddressSettingsDeployer.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -58,7 +58,7 @@
/**
* deploy an element
* @param node the element to deploy
- * @throws Exception .
+ * @throws Exception
*/
@Override
public void deploy(final Node node) throws Exception
@@ -78,7 +78,7 @@
/**
* Undeploys an element.
* @param node the element to undeploy
- * @throws Exception .
+ * @throws Exception
*/
@Override
public void undeploy(final Node node) throws Exception
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/SecurityDeployer.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/SecurityDeployer.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/SecurityDeployer.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -79,9 +79,8 @@
/**
* deploy an element
- *
* @param node the element to deploy
- * @throws Exception .
+ * @throws Exception
*/
@Override
public void deploy(final Node node) throws Exception
@@ -92,9 +91,8 @@
/**
* undeploys an element
- *
* @param node the element to undeploy
- * @throws Exception .
+ * @throws Exception
*/
@Override
public void undeploy(final Node node) throws Exception
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/paging/PagingStore.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/paging/PagingStore.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/paging/PagingStore.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -122,7 +122,8 @@
boolean lock(long timeout);
/**
- * Call this method using the same thread used by the last call of {@link PagingStore#lock()}.
+ * Call this method using the same thread used by the last call of {@link PagingStore#lock(long)}
+ * .
*/
void unlock();
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/PageCache.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/PageCache.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/PageCache.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -27,23 +27,22 @@
public interface PageCache extends SoftValueHashMap.ValueCache
{
Page getPage();
-
+
long getPageId();
int getNumberOfMessages();
-
+
void setMessages(PagedMessage[] messages);
-
+
PagedMessage[] getMessages();
-
+
/**
- * If this cache is still being updated
- * @return
+ * @return whether this cache is still being updated
*/
boolean isLive();
/**
- *
+ *
* @param messageNumber The order of the message on the page
* @return
*/
@@ -59,7 +58,7 @@
* You have to call this method within the same thread you called lock
*/
void unlock();
-
+
void close();
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/LivePageCacheImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/LivePageCacheImpl.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/LivePageCacheImpl.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -71,17 +71,13 @@
return page.getPageId();
}
- /* (non-Javadoc)
- * @see org.hornetq.core.paging.cursor.PageCache#getNumberOfMessages()
- */
+ @Override
public synchronized int getNumberOfMessages()
{
return messages.size();
}
- /* (non-Javadoc)
- * @see org.hornetq.core.paging.cursor.PageCache#setMessages(org.hornetq.core.server.ServerMessage[])
- */
+ @Override
public synchronized void setMessages(PagedMessage[] messages)
{
// This method shouldn't be called on liveCache, but we will provide the implementation for it anyway
@@ -91,9 +87,7 @@
}
}
- /* (non-Javadoc)
- * @see org.hornetq.core.paging.cursor.PageCache#getMessage(int)
- */
+ @Override
public synchronized PagedMessage getMessage(int messageNumber)
{
if (messageNumber < messages.size())
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PagePositionImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PagePositionImpl.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PagePositionImpl.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -40,10 +40,6 @@
this.messageNr = messageNr;
}
- /**
- * @param pageNr
- * @param messageNr
- */
public PagePositionImpl()
{
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -693,17 +693,6 @@
}
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- /**
- * Depage one page-file, read it and send it to the pagingManager / postoffice
- * @return
- * @throws Exception
- */
private final Queue<OurRunnable> onMemoryFreedRunnables = new ConcurrentLinkedQueue<OurRunnable>();
private class MemoryFreedRunnablesExecutor implements Runnable
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/ClusterManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/ClusterManager.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/ClusterManager.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -36,7 +36,7 @@
/**
* Return the default ClusterConnection to be used case it's not defined by the acceptor
- * @return
+ * @return default connection
*/
ClusterConnection getDefaultConnection();
@@ -60,7 +60,7 @@
void destroyBridge(String name) throws Exception;
/**
- * @return
+ * @return description
*/
String describe();
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/TransactionOperationAbstract.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/TransactionOperationAbstract.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/TransactionOperationAbstract.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -65,17 +65,15 @@
public void afterRollback(Transaction tx)
{
}
-
- /* (non-Javadoc)
- * @see org.hornetq.core.transaction.TransactionOperation#getRelatedMessageReferences()
- */
+
+ @Override
public List<MessageReference> getRelatedMessageReferences()
{
return Collections.emptyList();
}
-
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
Modified: trunk/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- trunk/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -98,10 +98,9 @@
* Helper base class for our unit tests.
* <p>
* See {@code org.hornetq.tests.util.ServiceTestBase} for a test case with server set-up.
- * @see Service
+ * @see ServiceTestBase
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:csuconic@redhat.com">Clebert</a>
- *
*/
public abstract class UnitTestCase extends TestCase
{
Modified: trunk/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQQueue.java
===================================================================
--- trunk/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQQueue.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQQueue.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -41,7 +41,7 @@
public static SimpleString createAddressFromName(final String name)
{
- return new SimpleString(HornetQQueue.JMS_QUEUE_ADDRESS_PREFIX + name);
+ return new SimpleString(HornetQDestination.JMS_QUEUE_ADDRESS_PREFIX + name);
}
// Attributes ----------------------------------------------------
@@ -50,7 +50,7 @@
public HornetQQueue(final String name)
{
- super(HornetQQueue.JMS_QUEUE_ADDRESS_PREFIX + name, name, false, true, null);
+ super(HornetQDestination.JMS_QUEUE_ADDRESS_PREFIX + name, name, false, true, null);
}
@@ -59,7 +59,6 @@
* @param address
* @param name
* @param temporary
- * @param queue
* @param session
*/
public HornetQQueue(String address, String name, boolean temporary, HornetQSession session)
Modified: trunk/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQTemporaryQueue.java
===================================================================
--- trunk/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQTemporaryQueue.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQTemporaryQueue.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -46,8 +46,6 @@
/**
* @param address
* @param name
- * @param temporary
- * @param queue
* @param session
*/
public HornetQTemporaryQueue(String address, String name, HornetQSession session)
Modified: trunk/hornetq-jms/src/main/java/org/hornetq/jms/persistence/config/PersistedConnectionFactory.java
===================================================================
--- trunk/hornetq-jms/src/main/java/org/hornetq/jms/persistence/config/PersistedConnectionFactory.java 2012-01-23 12:01:43 UTC (rev 12045)
+++ trunk/hornetq-jms/src/main/java/org/hornetq/jms/persistence/config/PersistedConnectionFactory.java 2012-01-23 12:02:38 UTC (rev 12046)
@@ -42,7 +42,6 @@
}
/**
- * @param id
* @param config
*/
public PersistedConnectionFactory(final ConnectionFactoryConfiguration config)
12 years, 11 months
JBoss hornetq SVN: r12045 - in trunk: hornetq-core/src/main/java/org/hornetq/api/core and 3 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-23 07:01:43 -0500 (Mon, 23 Jan 2012)
New Revision: 12045
Modified:
trunk/hornetq-commons/src/main/java/org/hornetq/api/core/PropertyConversionException.java
trunk/hornetq-core/src/main/java/org/hornetq/api/core/Interceptor.java
trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ClientMessage.java
trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ClientProducer.java
trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/HornetQClient.java
trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ServerLocator.java
trunk/hornetq-jms/src/main/java/org/hornetq/api/jms/management/ConnectionFactoryControl.java
trunk/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQConnectionFactory.java
Log:
HORNETQ-829 Public API javadoc fixes: broken references (and other javadoc corrections)
Modified: trunk/hornetq-commons/src/main/java/org/hornetq/api/core/PropertyConversionException.java
===================================================================
--- trunk/hornetq-commons/src/main/java/org/hornetq/api/core/PropertyConversionException.java 2012-01-23 12:01:08 UTC (rev 12044)
+++ trunk/hornetq-commons/src/main/java/org/hornetq/api/core/PropertyConversionException.java 2012-01-23 12:01:43 UTC (rev 12045)
@@ -14,13 +14,10 @@
package org.hornetq.api.core;
/**
- * A PropertyConversionException is thrown by Message methods
- * when a property can not be converted to the expected type.
- *
+ * A PropertyConversionException is thrown by {@link org.hornetq.api.core.Message} methods when a
+ * property can not be converted to the expected type.
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- * @see Message
- *
+ * @see org.hornetq.api.core.Message
*/
public class PropertyConversionException extends RuntimeException
{
Modified: trunk/hornetq-core/src/main/java/org/hornetq/api/core/Interceptor.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/api/core/Interceptor.java 2012-01-23 12:01:08 UTC (rev 12044)
+++ trunk/hornetq-core/src/main/java/org/hornetq/api/core/Interceptor.java 2012-01-23 12:01:43 UTC (rev 12045)
@@ -13,16 +13,15 @@
package org.hornetq.api.core;
-import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.protocol.core.Packet;
import org.hornetq.spi.core.protocol.RemotingConnection;
/**
* This is class is a simple way to intercepting calls on HornetQ client and servers.
* <p/>
- * To add an interceptor to HornetQ server, you have to modify hornetq-configuration.xml.
- * To add it to a client, use {@link ClientSessionFactory#addInterceptor(Interceptor)}
- *
+ * To add an interceptor to HornetQ server, you have to modify hornetq-configuration.xml. To add it
+ * to a client, use {@link ServerLocator#addInterceptor(Interceptor)}
* @author clebert.suconic(a)jboss.com
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*/
Modified: trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ClientMessage.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ClientMessage.java 2012-01-23 12:01:08 UTC (rev 12044)
+++ trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ClientMessage.java 2012-01-23 12:01:43 UTC (rev 12045)
@@ -92,8 +92,6 @@
* Sets the body's IntputStream.
* <br>
* This method is used when sending large messages
- *
- * @throws HornetQException
*/
void setBodyInputStream(InputStream bodyInputStream);
Modified: trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ClientProducer.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ClientProducer.java 2012-01-23 12:01:08 UTC (rev 12044)
+++ trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ClientProducer.java 2012-01-23 12:01:43 UTC (rev 12045)
@@ -18,19 +18,21 @@
import org.hornetq.api.core.SimpleString;
/**
- * A ClientProducer is used to send messages to a specific address. Messages are then routed on the server to any queues
- * that are bound to the address. A ClientProducer can either be created with a specific address in mind or with none.
- * With the latter the address must be provided using the appropriate send() method. <br><br>
- *
- * The sending semantics can change depending on what blocking semantics are set via {@link ClientSessionFactory#setBlockOnDurableSend(boolean)}
- * and {@link org.hornetq.api.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)} . If set to true
- * then for each message type, durable and non durable respectively, any exceptions such as the address not existing or
- * security exceptions will be thrown at the time of send. Alternatively if set to false then exceptions will only be
- * logged on the server. <br><br>
- *
- * The send rate can also be controlled via {@link ClientSessionFactory#setProducerMaxRate(int)}
- * and the {@link org.hornetq.api.core.client.ClientSessionFactory#setProducerWindowSize(int)}. <br><br>
- *
+ * A ClientProducer is used to send messages to a specific address. Messages are then routed on the
+ * server to any queues that are bound to the address. A ClientProducer can either be created with a
+ * specific address in mind or with none. With the latter the address must be provided using the
+ * appropriate send() method. <br>
+ * <p>
+ * The sending semantics can change depending on what blocking semantics are set via
+ * {@link ServerLocator#setBlockOnDurableSend(boolean)} and
+ * {@link org.hornetq.api.core.client.ServerLocator#setBlockOnNonDurableSend(boolean)} . If set to
+ * true then for each message type, durable and non durable respectively, any exceptions such as the
+ * address not existing or security exceptions will be thrown at the time of send. Alternatively if
+ * set to false then exceptions will only be logged on the server. <br>
+ * <p>
+ * The send rate can also be controlled via {@link ServerLocator#setProducerMaxRate(int)} and the
+ * {@link org.hornetq.api.core.client.ServerLocator#setProducerWindowSize(int)}. <br>
+ * <br>
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
*/
@@ -41,33 +43,32 @@
*
* <br><br>The address can be <code>null</code> if the ClientProducer
*
- * was creating without specifying an address, that is by using {@link ClientSession#createProducer()}.
- *
+ * was creating without specifying an address, that is by using {@link ClientSession#createProducer()}.
+ *
* @return the address where messages will be sent
*/
SimpleString getAddress();
/**
- * Sends a message to an address.
- *
- * specified in {@link ClientSession#createProducer(String)} or similar methods.
- *
- * <br><br>This will block until confirmation that the message has reached the server has been received if
- * {@link ClientSessionFactory#setBlockOnDurableSend(boolean)} or {@link org.hornetq.api.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)}
- * are set to <code>true</code> for the specified message type.
- *
+ * Sends a message to an address. specified in {@link ClientSession#createProducer(String)} or
+ * similar methods. <br>
+ * <br>
+ * This will block until confirmation that the message has reached the server has been received
+ * if {@link ServerLocator#setBlockOnDurableSend(boolean)} or
+ * {@link ServerLocator#setBlockOnNonDurableSend(boolean)} are set to <code>true</code> for the
+ * specified message type.
* @param message the message to send
* @throws HornetQException if an exception occurs while sending the message
*/
void send(Message message) throws HornetQException;
/**
- * Sends a message to the specified address instead of the ClientProducer's address.
- *
- * <br><br>This will block until confirmation that the message has reached the server has been received if
- * {@link ClientSessionFactory#setBlockOnDurableSend(boolean)} or {@link org.hornetq.api.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)}
- * are set to true for the specified message type.
- *
+ * Sends a message to the specified address instead of the ClientProducer's address. <br>
+ * <br>
+ * This will block until confirmation that the message has reached the server has been received
+ * if {@link ServerLocator#setBlockOnDurableSend(boolean)} or
+ * {@link ServerLocator#setBlockOnNonDurableSend(boolean)} are set to true for the specified
+ * message type.
* @param address the address where the message will be sent
* @param message the message to send
* @throws HornetQException if an exception occurs while sending the message
@@ -75,12 +76,12 @@
void send(SimpleString address, Message message) throws HornetQException;
/**
- * Sends a message to the specified address instead of the ClientProducer's address.
- *
- * <br><br>This will block until confirmation that the message has reached the server has been received if
- * {@link ClientSessionFactory#setBlockOnDurableSend(boolean)} or {@link org.hornetq.api.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)}
- * are set to true for the specified message type.
- *
+ * Sends a message to the specified address instead of the ClientProducer's address. <br>
+ * <br>
+ * This will block until confirmation that the message has reached the server has been received
+ * if {@link ServerLocator#setBlockOnDurableSend(boolean)} or
+ * {@link ServerLocator#setBlockOnNonDurableSend(boolean)} are set to true for the specified
+ * message type.
* @param address the address where the message will be sent
* @param message the message to send
* @throws HornetQException if an exception occurs while sending the message
@@ -89,35 +90,35 @@
/**
* Closes the ClientProducer. If already closed nothing is done.
- *
+ *
* @throws HornetQException if an exception occurs while closing the producer
*/
void close() throws HornetQException;
/**
* Returns whether the producer is closed or not.
- *
+ *
* @return <code>true</code> if the producer is closed, <code>false</code> else
*/
boolean isClosed();
/**
* Returns whether the producer will block when sending <em>durable</em> messages.
- *
+ *
* @return <code>true</code> if the producer blocks when sending durable, <code>false</code> else
*/
boolean isBlockOnDurableSend();
/**
* Returns whether the producer will block when sending <em>non-durable</em> messages.
- *
+ *
* @return <code>true</code> if the producer blocks when sending non-durable, <code>false</code> else
*/
boolean isBlockOnNonDurableSend();
/**
* Returns the maximum rate at which a ClientProducer can send messages per second.
- *
+ *
* @return the producers maximum rate
*/
int getMaxRate();
Modified: trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/HornetQClient.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/HornetQClient.java 2012-01-23 12:01:08 UTC (rev 12044)
+++ trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/HornetQClient.java 2012-01-23 12:01:43 UTC (rev 12045)
@@ -19,11 +19,11 @@
/**
* Utility class for creating HornetQ {@link ClientSessionFactory} objects.
- *
+ *
* Once a {@link ClientSessionFactory} has been created, it can be further configured
* using its setter methods before creating the sessions. Once a session is created,
* the factory can no longer be modified (its setter methods will throw a {@link IllegalStateException}.
- *
+ *
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
*/
public class HornetQClient
@@ -37,9 +37,9 @@
public static final long DEFAULT_CONNECTION_TTL = 1 * 60 * 1000;
// Any message beyond this size is considered a large message (to be sent in chunks)
-
+
public static final int DEFAULT_MIN_LARGE_MESSAGE_SIZE = 100 * 1024;
-
+
public static final boolean DEFAULT_COMPRESS_LARGE_MESSAGES = false;
public static final int DEFAULT_CONSUMER_WINDOW_SIZE = 1024 * 1024;
@@ -81,7 +81,7 @@
public static final int DEFAULT_RECONNECT_ATTEMPTS = 0;
public static final int INITIAL_CONNECT_ATTEMPTS = 1;
-
+
public static final boolean DEFAULT_FAILOVER_ON_INITIAL_CONNECTION = false;
public static final boolean DEFAULT_IS_HA = false;
@@ -97,13 +97,13 @@
public static final int DEFAULT_INITIAL_MESSAGE_PACKET_SIZE = 1500;
public static final boolean DEFAULT_XA = false;
-
+
public static final boolean DEFAULT_HA = false;
-
+
/**
* Create a ServerLocator which creates session factories using a static list of transportConfigurations, the ServerLocator is not updated automatically
* as the cluster topology changes, and no HA backup information is propagated to the client
- *
+ *
* @param transportConfigurations
* @return the ServerLocator
*/
@@ -111,12 +111,12 @@
{
return new ServerLocatorImpl(false, transportConfigurations);
}
-
+
/**
* Create a ServerLocator which creates session factories from a set of live servers, no HA backup information is propagated to the client
- *
+ *
* The UDP address and port are used to listen for live servers in the cluster
- *
+ *
* @param discoveryAddress The UDP group address to listen for updates
* @param discoveryPort the UDP port to listen for updates
* @return the ServerLocator
@@ -125,27 +125,39 @@
{
return new ServerLocatorImpl(false, groupConfiguration);
}
-
+
/**
- * Create a ServerLocator which will receive cluster topology updates from the cluster as servers leave or join and new backups are appointed or removed.
- * The initial list of servers supplied in this method is simply to make an initial connection to the cluster, once that connection is made, up to date
- * cluster topology information is downloaded and automatically updated whenever the cluster topology changes. If the topology includes backup servers
- * that information is also propagated to the client so that it can know which server to failover onto in case of live server failure.
- * @param initialServers The initial set of servers used to make a connection to the cluster. Each one is tried in turn until a successful connection is made. Once
- * a connection is made, the cluster topology is downloaded and the rest of the list is ignored.
+ * Create a ServerLocator which will receive cluster topology updates from the cluster as servers
+ * leave or join and new backups are appointed or removed.
+ * <p>
+ * The initial list of servers supplied in this method is simply to make an initial connection to
+ * the cluster, once that connection is made, up to date cluster topology information is
+ * downloaded and automatically updated whenever the cluster topology changes.
+ * <p>
+ * If the topology includes backup servers that information is also propagated to the client so
+ * that it can know which server to failover onto in case of live server failure.
+ * @param initialServers The initial set of servers used to make a connection to the cluster.
+ * Each one is tried in turn until a successful connection is made. Once a connection
+ * is made, the cluster topology is downloaded and the rest of the list is ignored.
* @return the ServerLocator
*/
public static ServerLocator createServerLocatorWithHA(TransportConfiguration... initialServers)
{
return new ServerLocatorImpl(true, initialServers);
}
-
+
/**
- * Create a ServerLocator which will receive cluster topology updates from the cluster as servers leave or join and new backups are appointed or removed.
- * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP broadcasts which contain connection information for members of the cluster.
- * The broadcasted connection information is simply used to make an initial connection to the cluster, once that connection is made, up to date
- * cluster topology information is downloaded and automatically updated whenever the cluster topology changes. If the topology includes backup servers
- * that information is also propagated to the client so that it can know which server to failover onto in case of live server failure.
+ * Create a ServerLocator which will receive cluster topology updates from the cluster as servers
+ * leave or join and new backups are appointed or removed.
+ * <p>
+ * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP
+ * broadcasts which contain connection information for members of the cluster. The broadcasted
+ * connection information is simply used to make an initial connection to the cluster, once that
+ * connection is made, up to date cluster topology information is downloaded and automatically
+ * updated whenever the cluster topology changes.
+ * <p>
+ * If the topology includes backup servers that information is also propagated to the client so
+ * that it can know which server to failover onto in case of live server failure.
* @param discoveryAddress The UDP group address to listen for updates
* @param discoveryPort the UDP port to listen for updates
* @return the ServerLocator
@@ -154,8 +166,8 @@
{
return new ServerLocatorImpl(true, groupConfiguration);
}
-
+
private HornetQClient()
{
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ServerLocator.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ServerLocator.java 2012-01-23 12:01:08 UTC (rev 12044)
+++ trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ServerLocator.java 2012-01-23 12:01:43 UTC (rev 12045)
@@ -29,7 +29,7 @@
/**
* Returns true if close was already called
- * @return
+ * @return {@code true} if closed, {@code false} otherwise.
*/
boolean isClosed();
Modified: trunk/hornetq-jms/src/main/java/org/hornetq/api/jms/management/ConnectionFactoryControl.java
===================================================================
--- trunk/hornetq-jms/src/main/java/org/hornetq/api/jms/management/ConnectionFactoryControl.java 2012-01-23 12:01:08 UTC (rev 12044)
+++ trunk/hornetq-jms/src/main/java/org/hornetq/api/jms/management/ConnectionFactoryControl.java 2012-01-23 12:01:43 UTC (rev 12045)
@@ -16,18 +16,17 @@
import org.hornetq.api.core.DiscoveryGroupConfiguration;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.api.core.management.Operation;
import org.hornetq.api.core.management.Parameter;
/**
- * A ConnectionFactoryControl is used to manage a JMS ConnectionFactory.
- * <br>
- * HornetQ JMS ConnectionFactory uses an underlying ClientSessionFactory to connect to HornetQ servers.
- * Please refer to the ClientSessionFactory for a detailed description.
- *
+ * A ConnectionFactoryControl is used to manage a JMS ConnectionFactory. <br>
+ * HornetQ JMS ConnectionFactory uses an underlying ClientSessionFactory to connect to HornetQ
+ * servers. Please refer to the ClientSessionFactory for a detailed description.
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
* @author <a href="mailto:fox@redhat.com">Tim Fox</a>
- *
+ * @see ServerLocator
* @see ClientSessionFactory
*/
public interface ConnectionFactoryControl
@@ -63,290 +62,289 @@
* Sets the Client ID for this connection factory.
*/
void setClientID(String clientID);
-
+
boolean isCompressLargeMessages();
-
+
void setCompressLargeMessages(boolean compress);
/**
- * @see ClientSessionFactory#getClientFailureCheckPeriod()
+ * @see ServerLocator#getClientFailureCheckPeriod()
*/
long getClientFailureCheckPeriod();
/**
- * @see ClientSessionFactory#setClientFailureCheckPeriod
+ * @see ServerLocator#setClientFailureCheckPeriod
*/
void setClientFailureCheckPeriod(long clientFailureCheckPeriod);
/**
- * @see ClientSessionFactory#getCallTimeout()
+ * @see ServerLocator#getCallTimeout()
*/
long getCallTimeout();
/**
- * @see ClientSessionFactory#setCallTimeout(long)
+ * @see ServerLocator#setCallTimeout(long)
*/
void setCallTimeout(long callTimeout);
/**
- * Returns the batch size (in bytes) between acknowledgements when using DUPS_OK_ACKNOWLEDGE mode.
- *
- * @see ClientSessionFactory#getAckBatchSize()
+ * Returns the batch size (in bytes) between acknowledgements when using DUPS_OK_ACKNOWLEDGE
+ * mode.
+ * @see ServerLocator#getAckBatchSize()
* @see javax.jms.Session#DUPS_OK_ACKNOWLEDGE
*/
int getDupsOKBatchSize();
/**
- * @see ClientSessionFactory#setAckBatchSize(int)
+ * @see ServerLocator#setAckBatchSize(int)
*/
void setDupsOKBatchSize(int dupsOKBatchSize);
/**
- * @see ClientSessionFactory#getConsumerMaxRate()
+ * @see ServerLocator#getConsumerMaxRate()
*/
int getConsumerMaxRate();
/**
- * @see ClientSessionFactory#setConsumerMaxRate(int)
+ * @see ServerLocator#setConsumerMaxRate(int)
*/
void setConsumerMaxRate(int consumerMaxRate);
/**
- * @see ClientSessionFactory#getConsumerWindowSize()
+ * @see ServerLocator#getConsumerWindowSize()
*/
int getConsumerWindowSize();
/**
- * @see ClientSessionFactory#setConfirmationWindowSize(int)
+ * @see ServerLocator#setConfirmationWindowSize(int)
*/
void setConsumerWindowSize(int consumerWindowSize);
/**
- * @see ClientSessionFactory#getProducerMaxRate()
+ * @see ServerLocator#getProducerMaxRate()
*/
int getProducerMaxRate();
/**
- * @see ClientSessionFactory#setProducerMaxRate(int)
+ * @see ServerLocator#setProducerMaxRate(int)
*/
void setProducerMaxRate(int producerMaxRate);
/**
- * @see ClientSessionFactory#getConfirmationWindowSize()
+ * @see ServerLocator#getConfirmationWindowSize()
*/
int getConfirmationWindowSize();
/**
- * @see ClientSessionFactory#setConfirmationWindowSize(int)
+ * @see ServerLocator#setConfirmationWindowSize(int)
*/
void setConfirmationWindowSize(int confirmationWindowSize);
/**
- * @see ClientSessionFactory#isBlockOnAcknowledge()
+ * @see ServerLocator#isBlockOnAcknowledge()
*/
boolean isBlockOnAcknowledge();
/**
- * @see ClientSessionFactory#setBlockOnAcknowledge(boolean)
+ * @see ServerLocator#setBlockOnAcknowledge(boolean)
*/
void setBlockOnAcknowledge(boolean blockOnAcknowledge);
/**
- * @see ClientSessionFactory#isBlockOnDurableSend()
+ * @see ServerLocator#isBlockOnDurableSend()
*/
boolean isBlockOnDurableSend();
/**
- * @see ClientSessionFactory#setBlockOnDurableSend(boolean)
+ * @see ServerLocator#setBlockOnDurableSend(boolean)
*/
void setBlockOnDurableSend(boolean blockOnDurableSend);
/**
- * @see ClientSessionFactory#isBlockOnNonDurableSend()
+ * @see ServerLocator#isBlockOnNonDurableSend()
*/
boolean isBlockOnNonDurableSend();
/**
- * @see ClientSessionFactory#setBlockOnNonDurableSend(boolean)
+ * @see ServerLocator#setBlockOnNonDurableSend(boolean)
*/
void setBlockOnNonDurableSend(boolean blockOnNonDurableSend);
/**
- * @see ClientSessionFactory#isPreAcknowledge()
+ * @see ServerLocator#isPreAcknowledge()
*/
boolean isPreAcknowledge();
/**
- * @see ClientSessionFactory#setPreAcknowledge(boolean)
+ * @see ServerLocator#setPreAcknowledge(boolean)
*/
void setPreAcknowledge(boolean preAcknowledge);
/**
- * @see ClientSessionFactory#getConnectionTTL()
+ * @see ServerLocator#getConnectionTTL()
*/
long getConnectionTTL();
/**
- * @see ClientSessionFactory#setConnectionTTL(long)
+ * @see ServerLocator#setConnectionTTL(long)
*/
void setConnectionTTL(long connectionTTL);
/**
* Returns the batch size (in bytes) between acknowledgements when using a transacted session.
- *
- * @see ClientSessionFactory#getAckBatchSize()
+ * @see ServerLocator#getAckBatchSize()
*/
int getTransactionBatchSize();
/**
- * @see ClientSessionFactory#setAckBatchSize(int)
+ * @see ServerLocator#setAckBatchSize(int)
*/
void setTransactionBatchSize(int transactionBatchSize);
/**
- * @see ClientSessionFactory#getMinLargeMessageSize()
+ * @see ServerLocator#getMinLargeMessageSize()
*/
int getMinLargeMessageSize();
/**
- * @see ClientSessionFactory#setMinLargeMessageSize(int)
+ * @see ServerLocator#setMinLargeMessageSize(int)
*/
void setMinLargeMessageSize(int minLargeMessageSize);
/**
- * @see ClientSessionFactory#isAutoGroup()
+ * @see ServerLocator#isAutoGroup()
*/
boolean isAutoGroup();
/**
- * @see ClientSessionFactory#setAutoGroup(boolean)
+ * @see ServerLocator#setAutoGroup(boolean)
*/
void setAutoGroup(boolean autoGroup);
/**
- * @see ClientSessionFactory#getRetryInterval()
+ * @see ServerLocator#getRetryInterval()
*/
long getRetryInterval();
/**
- * @see ClientSessionFactory#setRetryInterval(long)
+ * @see ServerLocator#setRetryInterval(long)
*/
void setRetryInterval(long retryInterval);
/**
- * @see ClientSessionFactory#getRetryIntervalMultiplier()
+ * @see ServerLocator#getRetryIntervalMultiplier()
*/
double getRetryIntervalMultiplier();
/**
- * @see ClientSessionFactory#setRetryIntervalMultiplier(double)
+ * @see ServerLocator#setRetryIntervalMultiplier(double)
*/
void setRetryIntervalMultiplier(double retryIntervalMultiplier);
/**
- * @see ClientSessionFactory#getReconnectAttempts()
+ * @see ServerLocator#getReconnectAttempts()
*/
int getReconnectAttempts();
/**
- * @see ClientSessionFactory#setReconnectAttempts(int)
+ * @see ServerLocator#setReconnectAttempts(int)
*/
void setReconnectAttempts(int reconnectAttempts);
-
+
/**
- * @see ClientSessionFactory#isFailoverOnInitialConnection()
+ * @see ServerLocator#isFailoverOnInitialConnection()
*/
boolean isFailoverOnInitialConnection();
/**
- * @see ClientSessionFactory#setFailoverOnInitialConnection(boolean)
+ * @see ServerLocator#setFailoverOnInitialConnection(boolean)
*/
void setFailoverOnInitialConnection(boolean failoverOnInitialConnection);
/**
- * @see org.hornetq.api.core.client.ClientSessionFactory#getProducerWindowSize()
+ * @see org.hornetq.api.core.client.ServerLocator#getProducerWindowSize()
*/
int getProducerWindowSize();
/**
- * @see ClientSessionFactory#setProducerWindowSize(int)
+ * @see ServerLocator#setProducerWindowSize(int)
*/
void setProducerWindowSize(int producerWindowSize);
/**
- * @see ClientSessionFactory#isCacheLargeMessagesClient()
+ * @see ServerLocator#isCacheLargeMessagesClient()
*/
boolean isCacheLargeMessagesClient();
/**
- * @see ClientSessionFactory#setCacheLargeMessagesClient(boolean)
+ * @see ServerLocator#setCacheLargeMessagesClient(boolean)
*/
void setCacheLargeMessagesClient(boolean cacheLargeMessagesClient);
/**
- * @see ClientSessionFactory#getMaxRetryInterval()
+ * @see ServerLocator#getMaxRetryInterval()
*/
long getMaxRetryInterval();
/**
- * @see ClientSessionFactory#setMaxRetryInterval(long)
+ * @see ServerLocator#setMaxRetryInterval(long)
*/
void setMaxRetryInterval(long retryInterval);
/**
- * @see ClientSessionFactory#getScheduledThreadPoolMaxSize()
+ * @see ServerLocator#getScheduledThreadPoolMaxSize()
*/
int getScheduledThreadPoolMaxSize();
/**
- * @see ClientSessionFactory#setScheduledThreadPoolMaxSize(int)
+ * @see ServerLocator#setScheduledThreadPoolMaxSize(int)
*/
void setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize);
/**
- * @see ClientSessionFactory#getThreadPoolMaxSize()
+ * @see ServerLocator#getThreadPoolMaxSize()
*/
int getThreadPoolMaxSize();
/**
- * @see ClientSessionFactory#setThreadPoolMaxSize(int)
+ * @see ServerLocator#setThreadPoolMaxSize(int)
*/
void setThreadPoolMaxSize(int threadPoolMaxSize);
/**
- * @see ClientSessionFactory#getGroupID()
+ * @see ServerLocator#getGroupID()
*/
String getGroupID();
/**
- * @see ClientSessionFactory#setGroupID(String)
+ * @see ServerLocator#setGroupID(String)
*/
void setGroupID(String groupID);
/**
- * @see ClientSessionFactory#getInitialMessagePacketSize()
+ * @see ServerLocator#getInitialMessagePacketSize()
*/
int getInitialMessagePacketSize();
/**
- * @see ClientSessionFactory#isUseGlobalPools()
+ * @see ServerLocator#isUseGlobalPools()
*/
boolean isUseGlobalPools();
/**
- * @see ClientSessionFactory#setUseGlobalPools(boolean)
+ * @see ServerLocator#setUseGlobalPools(boolean)
*/
void setUseGlobalPools(boolean useGlobalPools);
/**
- * @see ClientSessionFactory#getConnectionLoadBalancingPolicyClassName()
+ * @see ServerLocator#getConnectionLoadBalancingPolicyClassName()
*/
String getConnectionLoadBalancingPolicyClassName();
/**
- * @see ClientSessionFactory#setConnectionLoadBalancingPolicyClassName(String)
+ * @see ServerLocator#setConnectionLoadBalancingPolicyClassName(String)
*/
void setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName);
Modified: trunk/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQConnectionFactory.java
===================================================================
--- trunk/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQConnectionFactory.java 2012-01-23 12:01:08 UTC (rev 12044)
+++ trunk/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQConnectionFactory.java 2012-01-23 12:01:43 UTC (rev 12045)
@@ -552,10 +552,9 @@
{
return JMSFactoryType.CF.intValue();
}
+
/**
- *
* @deprecated use {@link ServerLocator#createSessionFactory()}
- * @return
*/
@Deprecated
public ClientSessionFactory getCoreFactory() throws JMSException
12 years, 11 months
JBoss hornetq SVN: r12044 - in trunk: tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover and 1 other directory.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-23 07:01:08 -0500 (Mon, 23 Jan 2012)
New Revision: 12044
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ClientSession.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedPagedFailoverTest.java
Log:
HORNETQ-805 Document expected behavior when paging and consuming msg's with browseOnly=true
Modified: trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ClientSession.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ClientSession.java 2012-01-23 12:00:46 UTC (rev 12043)
+++ trunk/hornetq-core/src/main/java/org/hornetq/api/core/client/ClientSession.java 2012-01-23 12:01:08 UTC (rev 12044)
@@ -298,11 +298,14 @@
/**
* Creates a ClientConsumer to consume or browse messages from the queue with the given name.
- * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages from the queue
- * but they will not be consumed (the messages will remain in the queue).
- * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume the messages from the queue and
- * the messages will effectively be removed from the queue.
- *
+ * <p>
+ * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages
+ * from the queue but they will not be consumed (the messages will remain in the queue). Note
+ * that paged messages will not be in the queue, and will therefore not be visible if
+ * {@code browseOnly} is {@code true}.
+ * <p>
+ * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume
+ * the messages from the queue and the messages will effectively be removed from the queue.
* @param queueName name of the queue to consume messages from
* @param browseOnly whether the ClientConsumer will only browse the queue or consume messages.
* @return a ClientConsumer
@@ -312,11 +315,14 @@
/**
* Creates a ClientConsumer to consume or browse messages from the queue with the given name.
- * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages from the queue
- * but they will not be consumed (the messages will remain in the queue).
- * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume the messages from the queue and
- * the messages will effectively be removed from the queue.
- *
+ * <p>
+ * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages
+ * from the queue but they will not be consumed (the messages will remain in the queue). Note
+ * that paged messages will not be in the queue, and will therefore not be visible if
+ * {@code browseOnly} is {@code true}.
+ * <p>
+ * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume
+ * the messages from the queue and the messages will effectively be removed from the queue.
* @param queueName name of the queue to consume messages from
* @param browseOnly whether the ClientConsumer will only browse the queue or consume messages.
* @return a ClientConsumer
@@ -325,12 +331,16 @@
ClientConsumer createConsumer(String queueName, boolean browseOnly) throws HornetQException;
/**
- * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
- * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages from the queue
- * but they will not be consumed (the messages will remain in the queue).
- * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume the messages from the queue and
- * the messages will effectively be removed from the queue.
- *
+ * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with
+ * the given name.
+ * <p>
+ * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages
+ * from the queue but they will not be consumed (the messages will remain in the queue). Note
+ * that paged messages will not be in the queue, and will therefore not be visible if
+ * {@code browseOnly} is {@code true}.
+ * <p>
+ * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume
+ * the messages from the queue and the messages will effectively be removed from the queue.
* @param queueName name of the queue to consume messages from
* @param filter only messages which match this filter will be consumed
* @param browseOnly whether the ClientConsumer will only browse the queue or consume messages.
@@ -340,12 +350,16 @@
ClientConsumer createConsumer(String queueName, String filter, boolean browseOnly) throws HornetQException;
/**
- * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
- * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages from the queue
- * but they will not be consumed (the messages will remain in the queue).
- * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume the messages from the queue and
- * the messages will effectively be removed from the queue.
- *
+ * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with
+ * the given name.
+ * <p>
+ * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages
+ * from the queue but they will not be consumed (the messages will remain in the queue). Note
+ * that paged messages will not be in the queue, and will therefore not be visible if
+ * {@code browseOnly} is {@code true}.
+ * <p>
+ * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume
+ * the messages from the queue and the messages will effectively be removed from the queue.
* @param queueName name of the queue to consume messages from
* @param filter only messages which match this filter will be consumed
* @param browseOnly whether the ClientConsumer will only browse the queue or consume messages.
@@ -355,12 +369,16 @@
ClientConsumer createConsumer(SimpleString queueName, SimpleString filter, boolean browseOnly) throws HornetQException;
/**
- * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
- * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages from the queue
- * but they will not be consumed (the messages will remain in the queue).
- * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume the messages from the queue and
- * the messages will effectively be removed from the queue.
- *
+ * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with
+ * the given name.
+ * <p>
+ * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages
+ * from the queue but they will not be consumed (the messages will remain in the queue). Note
+ * that paged messages will not be in the queue, and will therefore not be visible if
+ * {@code browseOnly} is {@code true}.
+ * <p>
+ * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume
+ * the messages from the queue and the messages will effectively be removed from the queue.
* @param queueName name of the queue to consume messages from
* @param filter only messages which match this filter will be consumed
* @param windowSize the consumer window size
@@ -376,12 +394,16 @@
boolean browseOnly) throws HornetQException;
/**
- * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
- * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages from the queue
- * but they will not be consumed (the messages will remain in the queue).
- * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume the messages from the queue and
- * the messages will effectively be removed from the queue.
- *
+ * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with
+ * the given name.
+ * <p>
+ * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages
+ * from the queue but they will not be consumed (the messages will remain in the queue). Note
+ * that paged messages will not be in the queue, and will therefore not be visible if
+ * {@code browseOnly} is {@code true}.
+ * <p>
+ * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume
+ * the messages from the queue and the messages will effectively be removed from the queue.
* @param queueName name of the queue to consume messages from
* @param filter only messages which match this filter will be consumed
* @param windowSize the consumer window size
@@ -571,8 +593,8 @@
* Attach any metadata to the session. Throws an exception if there's already a metadata available.
* You can use this metadata to ensure that there is no other session with the same meta-data you are passing as an argument.
* This is useful to simulate unique client-ids, where you may want to avoid multiple instances of your client application connected.
- *
- * @throws HornetQException
+ *
+ * @throws HornetQException
*/
void addUniqueMetaData(String key, String data) throws HornetQException;
@@ -582,5 +604,6 @@
* @deprecated Use {@link ClientSession#addMetaData(String, String)}
* @throws HornetQException
*/
+ @Deprecated
void addMetaDataV1(String key, String data) throws HornetQException;
}
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedPagedFailoverTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedPagedFailoverTest.java 2012-01-23 12:00:46 UTC (rev 12043)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedPagedFailoverTest.java 2012-01-23 12:01:08 UTC (rev 12044)
@@ -11,9 +11,15 @@
{
@Override
protected HornetQServer createInVMFailoverServer(final boolean realFiles, final Configuration configuration,
- final NodeManager nodeManager, int id)
+ final NodeManager nodeManager, int id)
{
return createInVMFailoverServer(realFiles, configuration, PAGE_SIZE, PAGE_MAX,
new HashMap<String, AddressSettings>(), nodeManager, id);
}
+
+ @Override
+ public void testFailWithBrowser() throws Exception
+ {
+ // paged messages are not available for browsing
+ }
}
12 years, 11 months
JBoss hornetq SVN: r12043 - trunk/hornetq-jms/src/main/java/org/hornetq/jms/bridge/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-01-23 07:00:46 -0500 (Mon, 23 Jan 2012)
New Revision: 12043
Modified:
trunk/hornetq-jms/src/main/java/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java
Log:
Fix synchronization inconsistency, and remove warnings.
Modified: trunk/hornetq-jms/src/main/java/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java
===================================================================
--- trunk/hornetq-jms/src/main/java/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java 2012-01-23 12:00:29 UTC (rev 12042)
+++ trunk/hornetq-jms/src/main/java/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java 2012-01-23 12:00:46 UTC (rev 12043)
@@ -21,6 +21,7 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
@@ -58,7 +59,7 @@
import org.hornetq.jms.client.HornetQSession;
/**
- *
+ *
* A JMSBridge
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
@@ -565,7 +566,7 @@
targetDestinationFactory = dest;
}
- public String getSourceUsername()
+ public synchronized String getSourceUsername()
{
return sourceUsername;
}
@@ -801,7 +802,7 @@
/**
* Check the object is not null
- *
+ *
* @throws IllegalArgumentException if the object is null
*/
private static void checkNotNull(final Object obj, final String name)
@@ -814,7 +815,7 @@
/**
* Check the bridge is not started
- *
+ *
* @throws IllegalStateException if the bridge is started
*/
private void checkBridgeNotStarted()
@@ -827,7 +828,7 @@
/**
* Check that value is either equals to -1 or greater than 0
- *
+ *
* @throws IllegalArgumentException if the value is not valid
*/
private static void checkValidValue(final long value, final String name)
@@ -1024,32 +1025,32 @@
* If the source and target destinations are on the same server (same resource manager) then,
* in order to get ONCE_AND_ONLY_ONCE, we simply need to consuming and send in a single
* local JMS transaction.
- *
+ *
* We actually use a single local transacted session for the other QoS modes too since this
* is more performant than using DUPS_OK_ACKNOWLEDGE or AUTO_ACKNOWLEDGE session ack modes, so effectively
* the QoS is upgraded.
- *
+ *
* Source and target on different server
* -------------------------------------
* If the source and target destinations are on a different servers (different resource managers) then:
- *
+ *
* If desired QoS is ONCE_AND_ONLY_ONCE, then we start a JTA transaction and enlist the consuming and sending
* XAResources in that.
- *
+ *
* If desired QoS is DUPLICATES_OK then, we use CLIENT_ACKNOWLEDGE for the consuming session and
* AUTO_ACKNOWLEDGE (this is ignored) for the sending session if the maxBatchSize == 1, otherwise we
* use a local transacted session for the sending session where maxBatchSize > 1, since this is more performant
* When bridging a batch, we make sure to manually acknowledge the consuming session, if it is CLIENT_ACKNOWLEDGE
* *after* the batch has been sent
- *
+ *
* If desired QoS is AT_MOST_ONCE then, if maxBatchSize == 1, we use AUTO_ACKNOWLEDGE for the consuming session,
* and AUTO_ACKNOWLEDGE for the sending session.
* If maxBatchSize > 1, we use CLIENT_ACKNOWLEDGE for the consuming session and a local transacted session for the
* sending session.
- *
+ *
* When bridging a batch, we make sure to manually acknowledge the consuming session, if it is CLIENT_ACKNOWLEDGE
* *before* the batch has been sent
- *
+ *
*/
private boolean setupJMSObjects()
{
@@ -1406,7 +1407,7 @@
JMSBridgeImpl.log.trace("Client acking source session");
}
- ((Message)messages.getLast()).acknowledge();
+ messages.getLast().acknowledge();
if (JMSBridgeImpl.trace)
{
@@ -1532,13 +1533,13 @@
private void sendMessages() throws Exception
{
- Iterator iter = messages.iterator();
+ Iterator<Message> iter = messages.iterator();
Message msg = null;
while (iter.hasNext())
{
- msg = (Message)iter.next();
+ msg = iter.next();
if (addMessageIDInHeader)
{
@@ -1636,13 +1637,14 @@
*/
private static void copyProperties(final Message msg) throws JMSException
{
- Enumeration en = msg.getPropertyNames();
+ @SuppressWarnings("unchecked")
+ Enumeration<String> en = msg.getPropertyNames();
Map<String, Object> oldProps = null;
while (en.hasMoreElements())
{
- String propName = (String)en.nextElement();
+ String propName = en.nextElement();
if (oldProps == null)
{
@@ -1656,13 +1658,13 @@
if (oldProps != null)
{
- Iterator oldPropsIter = oldProps.entrySet().iterator();
+ Iterator<Entry<String, Object>> oldPropsIter = oldProps.entrySet().iterator();
while (oldPropsIter.hasNext())
{
- Map.Entry entry = (Map.Entry)oldPropsIter.next();
+ Entry<String, Object> entry = oldPropsIter.next();
- String propName = (String)entry.getKey();
+ String propName = entry.getKey();
Object val = entry.getValue();
@@ -1680,7 +1682,7 @@
}
/**
- * Creates a 3-sized thred pool executor (1 thread for the sourceReceiver, 1 for the timeChecker
+ * Creates a 3-sized thread pool executor (1 thread for the sourceReceiver, 1 for the timeChecker
* and 1 for the eventual failureHandler)
*/
private ExecutorService createExecutor()
@@ -1730,7 +1732,7 @@
try
{
msg = sourceConsumer.receive(1000);
-
+
if (msg instanceof HornetQMessage)
{
// We need to check the buffer mainly in the case of LargeMessages
@@ -1876,12 +1878,14 @@
private class StartupFailureHandler extends FailureHandler
{
+ @Override
protected void failed()
{
// Don't call super
JMSBridgeImpl.log.warn("Unable to set up connections, bridge will not be started");
}
+ @Override
protected void succeeded()
{
// Don't call super - a bit ugly in this case but better than taking the lock twice.
12 years, 11 months