activemq-artemis git commit: ARTEMIS-347 Fixing NPE

2016-01-19 Thread clebertsuconic
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 2d4654ca2 -> 0a9a6c92f


ARTEMIS-347 Fixing NPE


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/0a9a6c92
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/0a9a6c92
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/0a9a6c92

Branch: refs/heads/master
Commit: 0a9a6c92f4d2713ffe01639296587ab00566630a
Parents: 2d4654c
Author: Clebert Suconic 
Authored: Tue Jan 19 23:14:47 2016 -0500
Committer: Clebert Suconic 
Committed: Tue Jan 19 23:15:10 2016 -0500

--
 .../artemis/core/config/ClusterConnectionConfiguration.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0a9a6c92/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
--
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
index f3f2b25..3c715af 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
@@ -377,7 +377,7 @@ public final class ClusterConnectionConfiguration 
implements Serializable {
  return list.toArray(new TransportConfiguration[list.size()]);
   }
   else {
- return configuration.getTransportConfigurations(staticConnectors);
+ return staticConnectors != null ? 
configuration.getTransportConfigurations(staticConnectors) : null;
   }
}
 



[3/5] activemq-artemis git commit: ARTEMIS-347 - supporting URIs on the cluster connection

2016-01-19 Thread clebertsuconic
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/JGroupsServerLocatorSchema.java
--
diff --git 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/JGroupsServerLocatorSchema.java
 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/JGroupsServerLocatorSchema.java
new file mode 100644
index 000..73a1b94
--- /dev/null
+++ 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/JGroupsServerLocatorSchema.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.uri.schema.serverLocator;
+
+import org.apache.activemq.artemis.api.core.BroadcastEndpointFactory;
+import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
+import 
org.apache.activemq.artemis.api.core.JGroupsFileBroadcastEndpointFactory;
+import 
org.apache.activemq.artemis.api.core.JGroupsPropertiesBroadcastEndpointFactory;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.utils.uri.SchemaConstants;
+
+import java.io.NotSerializableException;
+import java.net.URI;
+import java.util.Map;
+
+public class JGroupsServerLocatorSchema extends AbstractServerLocatorSchema {
+
+   @Override
+   public String getSchemaName() {
+  return SchemaConstants.JGROUPS;
+   }
+
+   @Override
+   protected ServerLocator internalNewObject(URI uri, Map 
query, String name) throws Exception {
+  ConnectionOptions options = newConnectionOptions(uri, query);
+
+  DiscoveryGroupConfiguration dcConfig = 
getDiscoveryGroupConfiguration(uri, query, name);
+
+  if (options.isHa()) {
+ return ActiveMQClient.createServerLocatorWithHA(dcConfig);
+  }
+  else {
+ return ActiveMQClient.createServerLocatorWithoutHA(dcConfig);
+  }
+   }
+
+   @Override
+   protected URI internalNewURI(ServerLocator bean) throws Exception {
+  DiscoveryGroupConfiguration dgc = bean.getDiscoveryGroupConfiguration();
+  BroadcastEndpointFactory endpoint = dgc.getBroadcastEndpointFactory();
+  String auth;
+  if (endpoint instanceof JGroupsFileBroadcastEndpointFactory) {
+ auth = ((JGroupsFileBroadcastEndpointFactory) 
endpoint).getChannelName();
+  }
+  else if (endpoint instanceof JGroupsPropertiesBroadcastEndpointFactory) {
+ auth = ((JGroupsPropertiesBroadcastEndpointFactory) 
endpoint).getChannelName();
+  }
+  else {
+ throw new NotSerializableException(endpoint + "not serializable");
+  }
+  String query = getData(null, bean, dgc, endpoint);
+  dgc.setBroadcastEndpointFactory(endpoint);
+  return new URI(SchemaConstants.JGROUPS, null, auth, -1, null, query, 
null);
+   }
+
+   public static DiscoveryGroupConfiguration 
getDiscoveryGroupConfiguration(URI uri,
+
Map query,
+
String name) throws Exception {
+  BroadcastEndpointFactory endpointFactory;
+  if (query.containsKey("file")) {
+ endpointFactory = new 
JGroupsFileBroadcastEndpointFactory().setChannelName(uri.getAuthority());
+  }
+  else {
+ endpointFactory = new 
JGroupsPropertiesBroadcastEndpointFactory().setChannelName(uri.getAuthority());
+  }
+
+  setData(uri, endpointFactory, query);
+
+  DiscoveryGroupConfiguration dcConfig = new 
DiscoveryGroupConfiguration().setName(name).setBroadcastEndpointFactory(endpointFactory);
+
+  setData(uri, dcConfig, query);
+  return dcConfig;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/TCPServerLocatorSchema.java
--
diff --git 
a/artemis-core-client/src/main/java/org/apache/activemq/

[4/5] activemq-artemis git commit: ARTEMIS-347 - supporting URIs on the cluster connection

2016-01-19 Thread clebertsuconic
ARTEMIS-347 - supporting URIs on the cluster connection


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3f23c991
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3f23c991
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3f23c991

Branch: refs/heads/master
Commit: 3f23c9916e694abeed281cd03ba476e183ecf866
Parents: 17a443b
Author: Clebert Suconic 
Authored: Thu Jan 14 18:07:12 2016 -0500
Committer: Clebert Suconic 
Committed: Tue Jan 19 17:35:12 2016 -0500

--
 .../activemq/artemis/utils/uri/URIFactory.java  |   9 +
 .../activemq/artemis/utils/uri/URISchema.java   |   7 +
 .../activemq/artemis/utils/uri/URISupport.java  | 560 +++
 .../activemq/artemis/utils/URIParserTest.java   |   6 +-
 .../config/ActiveMQDefaultConfiguration.java|   8 +
 .../artemis/api/core/client/TopologyMember.java |   2 +
 .../core/client/impl/TopologyMemberImpl.java|  13 +
 .../uri/AbstractServerLocatorSchema.java|  30 -
 .../AbstractTransportConfigurationSchema.java   |  26 -
 .../activemq/artemis/uri/ConnectionOptions.java |  76 ---
 .../ConnectorTransportConfigurationParser.java  |   6 +-
 .../artemis/uri/InVMServerLocatorSchema.java|  57 --
 .../uri/InVMTransportConfigurationSchema.java   |  69 ---
 .../artemis/uri/JGroupsServerLocatorSchema.java |  89 ---
 .../artemis/uri/ServerLocatorParser.java|   4 +
 .../artemis/uri/TCPServerLocatorSchema.java | 121 
 .../uri/TCPTransportConfigurationSchema.java|  90 ---
 .../artemis/uri/UDPServerLocatorSchema.java |  82 ---
 .../AbstractTransportConfigurationSchema.java   |  26 +
 .../InVMTransportConfigurationSchema.java   |  69 +++
 .../TCPTransportConfigurationSchema.java|  89 +++
 .../AbstractServerLocatorSchema.java|  30 +
 .../schema/serverLocator/ConnectionOptions.java |  76 +++
 .../serverLocator/InVMServerLocatorSchema.java  |  57 ++
 .../JGroupsServerLocatorSchema.java |  89 +++
 .../serverLocator/TCPServerLocatorSchema.java   | 121 
 .../serverLocator/UDPServerLocatorSchema.java   |  81 +++
 .../artemis/utils/ConfigurationHelper.java  |  31 +-
 .../apache/activemq/artemis/uri/InVMSchema.java |   2 +
 .../activemq/artemis/uri/JGroupsSchema.java |   1 +
 .../artemis/uri/JMSConnectionOptions.java   |   1 +
 .../apache/activemq/artemis/uri/TCPSchema.java  |   2 +
 .../apache/activemq/artemis/uri/UDPSchema.java  |   1 +
 .../jms/server/embedded/EmbeddedJMS.java|  16 +-
 .../config/ClusterConnectionConfiguration.java  | 129 -
 .../artemis/core/config/Configuration.java  |   6 +
 .../core/config/impl/ConfigurationImpl.java |  35 +-
 .../deployers/impl/FileConfigurationParser.java |  21 +-
 .../core/server/ActiveMQServerLogger.java   |   2 +-
 .../core/server/cluster/BackupManager.java  |  14 +-
 .../cluster/ClusterConfigurationUtil.java   |  87 ---
 .../core/server/cluster/ClusterManager.java |  40 +-
 .../core/server/cluster/ha/ScaleDownPolicy.java |  26 +-
 .../cluster/impl/MessageLoadBalancingType.java  |  31 +
 .../core/server/embedded/EmbeddedActiveMQ.java  |  43 +-
 .../impl/SharedNothingLiveActivation.java   |  17 +-
 .../AcceptorTransportConfigurationParser.java   |   6 +-
 .../ClusterConnectionConfigurationParser.java   |  31 +
 ...nVMAcceptorTransportConfigurationSchema.java |  27 -
 ...TCPAcceptorTransportConfigurationSchema.java |  34 --
 ...nVMAcceptorTransportConfigurationSchema.java |  28 +
 ...TCPAcceptorTransportConfigurationSchema.java |  35 ++
 .../ClusterConnectionMulticastSchema.java   |  48 ++
 .../ClusterConnectionStaticSchema.java  |  61 ++
 .../resources/schema/artemis-configuration.xsd  |  60 +-
 .../impl/FileConfigurationParserTest.java   |  18 +
 .../uri/ClusterConnectionConfigurationTest.java |  65 +++
 .../clustered-static-discovery-uri/pom.xml  | 244 
 .../clustered-static-discovery-uri/readme.html  |  58 ++
 .../example/StaticClusteredQueueExample.java| 173 ++
 .../main/resources/activemq/server0/broker.xml  |  70 +++
 .../main/resources/activemq/server1/broker.xml  |  70 +++
 .../main/resources/activemq/server2/broker.xml  |  66 +++
 .../main/resources/activemq/server3/broker.xml  |  67 +++
 .../clustered/clustered-topic-uri/pom.xml   | 156 ++
 .../clustered/clustered-topic-uri/readme.html   |  46 ++
 .../jms/example/ClusteredTopicExample.java  | 129 +
 .../main/resources/activemq/server0/broker.xml  |  89 +++
 .../main/resources/activemq/server1/broker.xml  |  87 +++
 examples/features/clustered/pom.xml |   4 +
 .../cluster/distribution/ClusterTestBase.java   |  18 +
 .../distribution/URISimpleClusterTest.java  | 130 +
 72 files changed, 3327 insertions(+), 891 deletions(-)
---

[1/5] activemq-artemis git commit: adding timeout verification

2016-01-19 Thread clebertsuconic
Repository: activemq-artemis
Updated Branches:
  refs/heads/master c58209f03 -> 2d4654ca2


adding timeout verification

Some VMs (IBM) can eventually ignore the System.gc call.
Adding some mitigation when that happens here


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/17a443b1
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/17a443b1
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/17a443b1

Branch: refs/heads/master
Commit: 17a443b1f0b0ed9d69b043ca6c5535480ba90aec
Parents: c58209f
Author: Clebert Suconic 
Authored: Mon Jan 18 12:31:52 2016 -0500
Committer: Clebert Suconic 
Committed: Tue Jan 19 17:20:49 2016 -0500

--
 .../artemis/tests/util/ActiveMQTestBase.java| 22 ++--
 1 file changed, 20 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/17a443b1/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
--
diff --git 
a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
 
b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
index 5d76df8..5e610d5 100644
--- 
a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
+++ 
b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
@@ -499,13 +499,22 @@ public abstract class ActiveMQTestBase extends Assert {
   }
}
 
+   private static int failedGCCalls = 0;
+
public static void forceGC() {
+
+  if (failedGCCalls >= 10) {
+ log.info("ignoring forceGC call since it seems System.gc is not 
working anyways");
+ return;
+  }
   log.info("#test forceGC");
   CountDownLatch finalized = new CountDownLatch(1);
   WeakReference dumbReference = new WeakReference<>(new 
DumbReference(finalized));
 
+  long timeout = System.currentTimeMillis() + 1000;
+
   // A loop that will wait GC, using the minimal time as possible
-  while (!(dumbReference.get() == null && finalized.getCount() == 0)) {
+  while (!(dumbReference.get() == null && finalized.getCount() == 0) && 
System.currentTimeMillis() < timeout) {
  System.gc();
  System.runFinalization();
  try {
@@ -514,7 +523,16 @@ public abstract class ActiveMQTestBase extends Assert {
  catch (InterruptedException e) {
  }
   }
-  log.info("#test forceGC Done");
+
+  if (dumbReference.get() != null) {
+ failedGCCalls++;
+ log.info("It seems that GC is disabled at your VM");
+  }
+  else {
+ // a success would reset the count
+ failedGCCalls = 0;
+  }
+  log.info("#test forceGC Done ");
}
 
public static void forceGC(final Reference ref, final long timeout) {



[2/5] activemq-artemis git commit: ARTEMIS-347 - supporting URIs on the cluster connection

2016-01-19 Thread clebertsuconic
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/test/java/org/apache/activemq/artemis/uri/ClusterConnectionConfigurationTest.java
--
diff --git 
a/artemis-server/src/test/java/org/apache/activemq/artemis/uri/ClusterConnectionConfigurationTest.java
 
b/artemis-server/src/test/java/org/apache/activemq/artemis/uri/ClusterConnectionConfigurationTest.java
new file mode 100644
index 000..771d89c
--- /dev/null
+++ 
b/artemis-server/src/test/java/org/apache/activemq/artemis/uri/ClusterConnectionConfigurationTest.java
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.uri;
+
+import java.net.URI;
+
+import org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration;
+import 
org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ClusterConnectionConfigurationTest {
+
+   @Test
+   public void testClusterConnectionStatic() throws Exception {
+  ClusterConnectionConfigurationParser parser = new 
ClusterConnectionConfigurationParser();
+  ClusterConnectionConfiguration configuration = parser.newObject(new 
URI("static:(tcp://localhost:6556,tcp://localhost:6557)?minLargeMessageSize=132;s&messageLoadBalancingType=OFF"),
 null);
+  Assert.assertEquals(MessageLoadBalancingType.OFF, 
configuration.getMessageLoadBalancingType());
+  Assert.assertEquals(132, configuration.getMinLargeMessageSize());
+  Assert.assertEquals("tcp://localhost:6556", 
configuration.getCompositeMembers().getComponents()[0].toString());
+  Assert.assertEquals("tcp://localhost:6557", 
configuration.getCompositeMembers().getComponents()[1].toString());
+   }
+
+   @Test
+   public void testClusterConnectionStatic2() throws Exception {
+  ClusterConnectionConfigurationParser parser = new 
ClusterConnectionConfigurationParser();
+  ClusterConnectionConfiguration configuration = parser.newObject(new 
URI("static://(tcp://localhost:6556,tcp://localhost:6557)?minLargeMessageSize=132;messageLoadBalancingType=OFF"),
 null);
+  Assert.assertEquals(132, configuration.getMinLargeMessageSize());
+  Assert.assertEquals(MessageLoadBalancingType.OFF, 
configuration.getMessageLoadBalancingType());
+  Assert.assertEquals(2, 
configuration.getCompositeMembers().getComponents().length);
+  Assert.assertEquals("tcp://localhost:6556", 
configuration.getCompositeMembers().getComponents()[0].toString());
+  Assert.assertEquals("tcp://localhost:6557", 
configuration.getCompositeMembers().getComponents()[1].toString());
+   }
+
+   @Test
+   public void testClusterConnectionStaticOnConstrcutor() throws Exception {
+  ClusterConnectionConfiguration configuration = new 
ClusterConnectionConfiguration(new 
URI("static:(tcp://localhost:6556,tcp://localhost:6557)?minLargeMessageSize=132"));
+  Assert.assertEquals(132, configuration.getMinLargeMessageSize());
+  Assert.assertEquals("tcp://localhost:6556", 
configuration.getCompositeMembers().getComponents()[0].toString());
+  Assert.assertEquals("tcp://localhost:6557", 
configuration.getCompositeMembers().getComponents()[1].toString());
+   }
+
+   @Test
+   public void testClusterConnectionMulticast() throws Exception {
+  ClusterConnectionConfigurationParser parser = new 
ClusterConnectionConfigurationParser();
+  ClusterConnectionConfiguration configuration = parser.newObject(new 
URI("multicast://myGroup?minLargeMessageSize=132"), null);
+  Assert.assertEquals("myGroup", configuration.getDiscoveryGroupName());
+  Assert.assertEquals(132, configuration.getMinLargeMessageSize());
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/examples/features/clustered/clustered-static-discovery-uri/pom.xml
--
diff --git a/examples/features/clustered/clustered-static-discovery-uri/pom.xml 
b/examples/features/clustered/clustered-static-discovery-uri/pom.xml
new file mode 100644
index 000..949d87f
--- /dev/null
+++ b/examples/features/clustered

[5/5] activemq-artemis git commit: This closes #322

2016-01-19 Thread clebertsuconic
This closes #322


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/2d4654ca
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/2d4654ca
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/2d4654ca

Branch: refs/heads/master
Commit: 2d4654ca2631b98094c4021411447e201593b44d
Parents: c58209f 3f23c99
Author: Clebert Suconic 
Authored: Tue Jan 19 17:42:37 2016 -0500
Committer: Clebert Suconic 
Committed: Tue Jan 19 17:42:37 2016 -0500

--
 .../activemq/artemis/utils/uri/URIFactory.java  |   9 +
 .../activemq/artemis/utils/uri/URISchema.java   |   7 +
 .../activemq/artemis/utils/uri/URISupport.java  | 560 +++
 .../activemq/artemis/utils/URIParserTest.java   |   6 +-
 .../config/ActiveMQDefaultConfiguration.java|   8 +
 .../artemis/api/core/client/TopologyMember.java |   2 +
 .../core/client/impl/TopologyMemberImpl.java|  13 +
 .../uri/AbstractServerLocatorSchema.java|  30 -
 .../AbstractTransportConfigurationSchema.java   |  26 -
 .../activemq/artemis/uri/ConnectionOptions.java |  76 ---
 .../ConnectorTransportConfigurationParser.java  |   6 +-
 .../artemis/uri/InVMServerLocatorSchema.java|  57 --
 .../uri/InVMTransportConfigurationSchema.java   |  69 ---
 .../artemis/uri/JGroupsServerLocatorSchema.java |  89 ---
 .../artemis/uri/ServerLocatorParser.java|   4 +
 .../artemis/uri/TCPServerLocatorSchema.java | 121 
 .../uri/TCPTransportConfigurationSchema.java|  90 ---
 .../artemis/uri/UDPServerLocatorSchema.java |  82 ---
 .../AbstractTransportConfigurationSchema.java   |  26 +
 .../InVMTransportConfigurationSchema.java   |  69 +++
 .../TCPTransportConfigurationSchema.java|  89 +++
 .../AbstractServerLocatorSchema.java|  30 +
 .../schema/serverLocator/ConnectionOptions.java |  76 +++
 .../serverLocator/InVMServerLocatorSchema.java  |  57 ++
 .../JGroupsServerLocatorSchema.java |  89 +++
 .../serverLocator/TCPServerLocatorSchema.java   | 121 
 .../serverLocator/UDPServerLocatorSchema.java   |  81 +++
 .../artemis/utils/ConfigurationHelper.java  |  31 +-
 .../apache/activemq/artemis/uri/InVMSchema.java |   2 +
 .../activemq/artemis/uri/JGroupsSchema.java |   1 +
 .../artemis/uri/JMSConnectionOptions.java   |   1 +
 .../apache/activemq/artemis/uri/TCPSchema.java  |   2 +
 .../apache/activemq/artemis/uri/UDPSchema.java  |   1 +
 .../jms/server/embedded/EmbeddedJMS.java|  16 +-
 .../config/ClusterConnectionConfiguration.java  | 129 -
 .../artemis/core/config/Configuration.java  |   6 +
 .../core/config/impl/ConfigurationImpl.java |  35 +-
 .../deployers/impl/FileConfigurationParser.java |  21 +-
 .../core/server/ActiveMQServerLogger.java   |   2 +-
 .../core/server/cluster/BackupManager.java  |  14 +-
 .../cluster/ClusterConfigurationUtil.java   |  87 ---
 .../core/server/cluster/ClusterManager.java |  40 +-
 .../core/server/cluster/ha/ScaleDownPolicy.java |  26 +-
 .../cluster/impl/MessageLoadBalancingType.java  |  31 +
 .../core/server/embedded/EmbeddedActiveMQ.java  |  43 +-
 .../impl/SharedNothingLiveActivation.java   |  17 +-
 .../AcceptorTransportConfigurationParser.java   |   6 +-
 .../ClusterConnectionConfigurationParser.java   |  31 +
 ...nVMAcceptorTransportConfigurationSchema.java |  27 -
 ...TCPAcceptorTransportConfigurationSchema.java |  34 --
 ...nVMAcceptorTransportConfigurationSchema.java |  28 +
 ...TCPAcceptorTransportConfigurationSchema.java |  35 ++
 .../ClusterConnectionMulticastSchema.java   |  48 ++
 .../ClusterConnectionStaticSchema.java  |  61 ++
 .../resources/schema/artemis-configuration.xsd  |  60 +-
 .../impl/FileConfigurationParserTest.java   |  18 +
 .../artemis/tests/util/ActiveMQTestBase.java|  22 +-
 .../uri/ClusterConnectionConfigurationTest.java |  65 +++
 .../clustered-static-discovery-uri/pom.xml  | 244 
 .../clustered-static-discovery-uri/readme.html  |  58 ++
 .../example/StaticClusteredQueueExample.java| 173 ++
 .../main/resources/activemq/server0/broker.xml  |  70 +++
 .../main/resources/activemq/server1/broker.xml  |  70 +++
 .../main/resources/activemq/server2/broker.xml  |  66 +++
 .../main/resources/activemq/server3/broker.xml  |  67 +++
 .../clustered/clustered-topic-uri/pom.xml   | 156 ++
 .../clustered/clustered-topic-uri/readme.html   |  46 ++
 .../jms/example/ClusteredTopicExample.java  | 129 +
 .../main/resources/activemq/server0/broker.xml  |  89 +++
 .../main/resources/activemq/server1/broker.xml  |  87 +++
 examples/features/clustered/pom.xml |   4 +
 .../cluster/distribution/ClusterTestBase.java   |  18 +
 .../distribution/URISimpleClusterTest.java  | 130 +
 73 files changed, 3347 insertions(+), 893 deletions(-)

Jenkins build is back to stable : ActiveMQ-Java7-All-UnitTests #328

2016-01-19 Thread Apache Jenkins Server
See 



[2/2] activemq-artemis git commit: ARTEMIS-352 security examples readme fix

2016-01-19 Thread clebertsuconic
ARTEMIS-352 security examples readme fix


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/c2be2d45
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/c2be2d45
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/c2be2d45

Branch: refs/heads/master
Commit: c2be2d452c6c8bcb0675bc2a8f154c3d17bdf32a
Parents: 1dc7a89
Author: jbertram 
Authored: Tue Jan 19 10:01:47 2016 -0600
Committer: Clebert Suconic 
Committed: Tue Jan 19 13:06:50 2016 -0500

--
 .../features/standard/security-ldap/readme.html | 107 ---
 .../src/main/resources/example.ldif |   2 +-
 examples/features/standard/security/readme.html |  53 -
 3 files changed, 93 insertions(+), 69 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c2be2d45/examples/features/standard/security-ldap/readme.html
--
diff --git a/examples/features/standard/security-ldap/readme.html 
b/examples/features/standard/security-ldap/readme.html
index fad945a..430b319 100644
--- a/examples/features/standard/security-ldap/readme.html
+++ b/examples/features/standard/security-ldap/readme.html
@@ -25,12 +25,12 @@ under the License.
 
   
   
- JMS Security Example
+ JMS Security LDAP Example
 
  To run the example, simply type mvn verify from this 
directory, or mvn -PnoServer verify if you want to start and create 
the server manually.
 
 
- This example shows how to configure and use security using ActiveMQ 
Artemis with LDAP.
+ This example shows how to configure and use security using ActiveMQ 
Artemis and the Apache DS LDAP server.
 
  With security properly configured, ActiveMQ Artemis can restrict 
client access to its resources, including
  connection creation, message sending/receiving, etc. This is done by 
configuring users and roles as well as permissions in
@@ -42,42 +42,82 @@ under the License.
  For a full description of how to configure security with ActiveMQ 
Artemis, please consult the user
  manual.
 
- This example demonstrates how to configure users/roles, how to 
configure topics with proper permissions using wild-card
- expressions, and how they take effects in a simple program. 
+ This example demonstrates how to configure users/roles in the Apache 
DS LDAP server, how to configure topics with
+ proper permissions using wild-card expressions, and how they take effects 
in a simple program.
 
- First we need to configure users with roles. Users and Roles are 
configured in activemq-users.xml. This example has four users
- configured as below 
+ Users and roles are configured in Apache DS. The SecurityExample class 
will start an embedded version of Apache
+ DS and load the contents of example.ldif which contains the users and 
passwords for this example.
 
  
  
-  
- 
-  
-
-  
- 
- 
-  
-
-  
- 
- 
- 
-  
-
-  
- 
- 
-  
+ dn: dc=activemq,dc=org
+ dc: activemq
+ objectClass: top
+ objectClass: domain
+
+ dn: uid=bill,dc=activemq,dc=org
+ uid: bill
+ userPassword: activemq
+ objectClass: account
+ objectClass: simpleSecurityObject
+ objectClass: top
+
+ dn: uid=andrew,dc=activemq,dc=org
+ uid: andrew
+ userPassword: activemq1
+ objectClass: account
+ objectClass: simpleSecurityObject
+ objectClass: top
+
+ dn: uid=frank,dc=activemq,dc=org
+ uid: frank
+ userPassword: activemq2
+ objectClass: account
+ objectClass: simpleSecurityObject
+ objectClass: top
+
+ dn: uid=sam,dc=activemq,dc=org
+ uid: sam
+ userPassword: activemq3
+ objectClass: account
+ objectClass: simpleSecurityObject
+ objectClass: top
+
+ ###
+ ## Define roles ##
+ ###
+
+ dn: cn=user,dc=activemq,dc=org
+ cn: user
+ member: uid=bill,dc=activemq,dc=org
+ member: uid=andrew,dc=activemq,dc=

[1/2] activemq-artemis git commit: This closes #328

2016-01-19 Thread clebertsuconic
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 1dc7a8946 -> c58209f03


This closes #328


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/c58209f0
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/c58209f0
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/c58209f0

Branch: refs/heads/master
Commit: c58209f03c4e86b2d35d0557e4d10cece78c4cd3
Parents: 1dc7a89 c2be2d4
Author: Clebert Suconic 
Authored: Tue Jan 19 13:06:50 2016 -0500
Committer: Clebert Suconic 
Committed: Tue Jan 19 13:06:50 2016 -0500

--
 .../features/standard/security-ldap/readme.html | 107 ---
 .../src/main/resources/example.ldif |   2 +-
 examples/features/standard/security/readme.html |  53 -
 3 files changed, 93 insertions(+), 69 deletions(-)
--




[1/2] activemq-artemis git commit: ARTEMIS-351 throw an exception if we get an IOException

2016-01-19 Thread clebertsuconic
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 54222d866 -> 1dc7a8946


ARTEMIS-351 throw an exception if we get an IOException


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/7b164e45
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/7b164e45
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/7b164e45

Branch: refs/heads/master
Commit: 7b164e45c37e4386b1d53a146045b51e38b34aec
Parents: 54222d8
Author: Tom Jenkinson 
Authored: Fri Jan 15 20:55:06 2016 +
Committer: Clebert Suconic 
Committed: Tue Jan 19 13:02:57 2016 -0500

--
 .../journal/impl/JournalFilesRepository.java| 33 ++--
 1 file changed, 24 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7b164e45/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java
--
diff --git 
a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java
 
b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java
index 066638b..fe9d905 100644
--- 
a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java
+++ 
b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java
@@ -31,6 +31,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
+import org.apache.activemq.artemis.api.core.ActiveMQIOErrorException;
 import org.apache.activemq.artemis.core.io.SequentialFile;
 import org.apache.activemq.artemis.core.io.SequentialFileFactory;
 import org.apache.activemq.artemis.journal.ActiveMQJournalBundle;
@@ -418,8 +419,10 @@ public class JournalFilesRepository {
 * This method will instantly return the opened file, and schedule 
opening and reclaiming.
 * In case there are no cached opened files, this method will block 
until the file was opened,
 * what would happen only if the system is under heavy load by another 
system (like a backup system, or a DB sharing the same box as ActiveMQ).
+*
+* @throws ActiveMQIOErrorException In case the file could not be opened
 */
-   public JournalFile openFile() throws InterruptedException {
+   public JournalFile openFile() throws InterruptedException, 
ActiveMQIOErrorException {
   if (JournalFilesRepository.trace) {
  JournalFilesRepository.trace("enqueueOpenFile with openedFiles.size=" 
+ openedFiles.size());
   }
@@ -431,13 +434,13 @@ public class JournalFilesRepository {
  openFilesExecutor.execute(pushOpenRunnable);
   }
 
-  JournalFile nextFile = null;
-
-  while (nextFile == null) {
- nextFile = openedFiles.poll(5, TimeUnit.SECONDS);
- if (nextFile == null) {
-
fileFactory.onIOError(ActiveMQJournalBundle.BUNDLE.fileNotOpened(), "unable to 
open ",  null);
- }
+  JournalFile nextFile = openedFiles.poll(5, TimeUnit.SECONDS);
+  if (nextFile == null) {
+ fileFactory.onIOError(ActiveMQJournalBundle.BUNDLE.fileNotOpened(), 
"unable to open ", null);
+ // We need to reconnect the current file with the timed buffer as we 
were not able to roll the file forward
+ // If you don't do this you will get a NPE in TimedBuffer::checkSize 
where it uses the bufferobserver
+ fileFactory.activateBuffer(journal.getCurrentFile().getFile());
+ throw ActiveMQJournalBundle.BUNDLE.fileNotOpened();
   }
 
   if (JournalFilesRepository.trace) {
@@ -465,7 +468,19 @@ public class JournalFilesRepository {
public void closeFile(final JournalFile file) throws Exception {
   fileFactory.deactivateBuffer();
   file.getFile().close();
-  dataFiles.add(file);
+  if (!dataFiles.contains(file)) {
+ // This is not a retry from openFile
+ // If you don't check this then retries keep adding the same file into
+ // dataFiles list and the compactor then re-adds multiple copies of 
the
+ // same file into freeFiles.
+ // The consequence of that is that you can end up with the same file
+ // twice in a row in the list of openedFiles
+ // The consequence of that is that JournalImpl::switchFileIfNecessary
+ // will throw throw new IllegalStateException("Invalid logic on 
buffer allocation")
+ // because the file will be checked effectively twice and the buffer 
will
+ // not fit in it
+ dataFiles.add(file);
+  }
}
 
/**



[2/2] activemq-artemis git commit: This closes #326

2016-01-19 Thread clebertsuconic
This closes #326


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/1dc7a894
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/1dc7a894
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/1dc7a894

Branch: refs/heads/master
Commit: 1dc7a8946a5247e16d41973426cf7e5b6588fdd8
Parents: 54222d8 7b164e4
Author: Clebert Suconic 
Authored: Tue Jan 19 13:03:16 2016 -0500
Committer: Clebert Suconic 
Committed: Tue Jan 19 13:03:16 2016 -0500

--
 .../journal/impl/JournalFilesRepository.java| 33 ++--
 1 file changed, 24 insertions(+), 9 deletions(-)
--




[2/3] activemq-artemis git commit: ARTEMIS-350 Small improvement on the replication stop

2016-01-19 Thread clebertsuconic
ARTEMIS-350 Small improvement on the replication stop


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/68faa1d2
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/68faa1d2
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/68faa1d2

Branch: refs/heads/master
Commit: 68faa1d25245c45c15cf79cdc0ef25e0881baa61
Parents: b7f0d14
Author: Clebert Suconic 
Authored: Tue Jan 19 11:14:16 2016 -0500
Committer: Clebert Suconic 
Committed: Tue Jan 19 11:20:47 2016 -0500

--
 .../core/replication/ReplicationManager.java| 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/68faa1d2/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
--
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
index 74f9906..3c2d236 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
@@ -263,14 +263,17 @@ public final class ReplicationManager implements 
ActiveMQComponent, ReadyListene
   if (!started) {
  return;
   }
-  
replicatingChannel.getConnection().getTransportConnection().fireReady(true);
-  latch.setCount(0);
+
+  enabled = false;
+
+  // This is to avoid the write holding a lock while we are trying to 
close it
+  if (replicatingChannel != null) {
+ replicatingChannel.close();
+ 
replicatingChannel.getConnection().getTransportConnection().fireReady(true);
+ latch.setCount(0);
+  }
 
   synchronized (replicationLock) {
- enabled = false;
- if (replicatingChannel != null) {
-replicatingChannel.close();
- }
  clearReplicationTokens();
   }
 
@@ -278,7 +281,6 @@ public final class ReplicationManager implements 
ActiveMQComponent, ReadyListene
   if (toStop != null) {
  toStop.removeFailureListener(failureListener);
   }
-
   remotingConnection = null;
   started = false;
}



[1/3] activemq-artemis git commit: ARTEMIS-350 - possible OOM in replication manager

2016-01-19 Thread clebertsuconic
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 8e4aca126 -> 54222d866


ARTEMIS-350 - possible OOM in replication manager

https://issues.apache.org/jira/browse/ARTEMIS-350


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/b7f0d14b
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/b7f0d14b
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/b7f0d14b

Branch: refs/heads/master
Commit: b7f0d14b18b98b6a989281a046f0117ab39f6f9c
Parents: 8e4aca1
Author: Andy Taylor 
Authored: Tue Jan 19 10:11:17 2016 +
Committer: Clebert Suconic 
Committed: Tue Jan 19 11:18:01 2016 -0500

--
 .../core/replication/ReplicationManager.java| 22 +++-
 1 file changed, 21 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7f0d14b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
--
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
index a8984fc..74f9906 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
@@ -29,6 +29,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
+import org.apache.activemq.artemis.api.core.ActiveMQInterruptedException;
 import org.apache.activemq.artemis.api.core.Pair;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.SessionFailureListener;
@@ -65,6 +66,7 @@ import 
org.apache.activemq.artemis.core.server.ActiveMQComponent;
 import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
+import org.apache.activemq.artemis.spi.core.remoting.ReadyListener;
 import org.apache.activemq.artemis.utils.ExecutorFactory;
 import org.apache.activemq.artemis.utils.ReusableLatch;
 
@@ -76,7 +78,7 @@ import org.apache.activemq.artemis.utils.ReusableLatch;
  *
  * @see ReplicationEndpoint
  */
-public final class ReplicationManager implements ActiveMQComponent {
+public final class ReplicationManager implements ActiveMQComponent, 
ReadyListener {
 
public enum ADD_OPERATION_TYPE {
   UPDATE {
@@ -109,6 +111,7 @@ public final class ReplicationManager implements 
ActiveMQComponent {
 
private final Object replicationLock = new Object();
 
+   private final ReusableLatch latch = new ReusableLatch();
private final Queue pendingTokens = new 
ConcurrentLinkedQueue<>();
 
private final ExecutorFactory executorFactory;
@@ -260,6 +263,8 @@ public final class ReplicationManager implements 
ActiveMQComponent {
   if (!started) {
  return;
   }
+  
replicatingChannel.getConnection().getTransportConnection().fireReady(true);
+  latch.setCount(0);
 
   synchronized (replicationLock) {
  enabled = false;
@@ -273,6 +278,7 @@ public final class ReplicationManager implements 
ActiveMQComponent {
   if (toStop != null) {
  toStop.removeFailureListener(failureListener);
   }
+
   remotingConnection = null;
   started = false;
}
@@ -332,6 +338,15 @@ public final class ReplicationManager implements 
ActiveMQComponent {
   synchronized (replicationLock) {
  if (enabled) {
 pendingTokens.add(repliToken);
+if (!replicatingChannel.getConnection().isWritable(this)) {
+   latch.countUp();
+   try {
+  latch.await();
+   }
+   catch (InterruptedException e) {
+  throw new ActiveMQInterruptedException(e);
+   }
+}
 replicatingChannel.send(packet);
  }
  else {
@@ -349,6 +364,11 @@ public final class ReplicationManager implements 
ActiveMQComponent {
   return repliToken;
}
 
+   @Override
+   public void readyForWriting() {
+  latch.countDown();
+   }
+
/**
 * @throws IllegalStateException By default, all replicated packets 
generate a replicated
 *   response. If your packets are triggering 
this exception, it may be because the



[3/3] activemq-artemis git commit: This closes #327

2016-01-19 Thread clebertsuconic
This closes #327


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/54222d86
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/54222d86
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/54222d86

Branch: refs/heads/master
Commit: 54222d8667b4f906567b67b709be7fd5195254ba
Parents: 8e4aca1 68faa1d
Author: Clebert Suconic 
Authored: Tue Jan 19 13:02:09 2016 -0500
Committer: Clebert Suconic 
Committed: Tue Jan 19 13:02:09 2016 -0500

--
 .../core/replication/ReplicationManager.java| 32 +---
 1 file changed, 27 insertions(+), 5 deletions(-)
--




[2/3] activemq-artemis git commit: ARTEMIS-336 fix 'stop' command

2016-01-19 Thread clebertsuconic
ARTEMIS-336 fix 'stop' command


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/2dcd10be
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/2dcd10be
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/2dcd10be

Branch: refs/heads/master
Commit: 2dcd10befc74f8e8392302ad8570c8960a6b9f1e
Parents: d94c044
Author: jbertram 
Authored: Mon Jan 18 11:48:40 2016 -0600
Committer: Clebert Suconic 
Committed: Tue Jan 19 09:45:52 2016 -0500

--
 .../org/apache/activemq/artemis/cli/commands/Stop.java| 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2dcd10be/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Stop.java
--
diff --git 
a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Stop.java 
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Stop.java
index 5f89253..800c0cf 100644
--- 
a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Stop.java
+++ 
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Stop.java
@@ -19,7 +19,6 @@ package org.apache.activemq.artemis.cli.commands;
 import java.io.File;
 
 import io.airlift.airline.Command;
-import org.apache.activemq.artemis.dto.BrokerDTO;
 
 @Command(name = "stop", description = "stops the broker instance")
 public class Stop extends Configurable {
@@ -27,9 +26,14 @@ public class Stop extends Configurable {
@Override
public Object execute(ActionContext context) throws Exception {
   super.execute(context);
-  BrokerDTO broker = getBrokerDTO();
 
-  File file = broker.server.getConfigurationFile().getParentFile();
+  String value = getConfiguration();
+
+  if (value != null && value.startsWith("xml:")) {
+ value = value.substring("xml:".length());
+  }
+
+  File file = new File(value).getParentFile();
 
   File stopFile = new File(file, "STOP_ME");
 



[3/3] activemq-artemis git commit: ARTEMIS-349 LDAP plugin listener

2016-01-19 Thread clebertsuconic
ARTEMIS-349 LDAP plugin listener

This feature required a bit of refactoring to the plugin interface itself as
well as a restriction on the configuration so that either only one plugin could
be specified or an ulimited number of security-setting matches. This was done
to prevent messy situations where a plugin could update settings from the XML
or even another plugin if there were overlapping matches.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/d94c044e
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/d94c044e
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/d94c044e

Branch: refs/heads/master
Commit: d94c044e900407134ca426827ccd7b73594aca6f
Parents: 3433f53
Author: jbertram 
Authored: Mon Jan 11 16:39:35 2016 -0600
Committer: Clebert Suconic 
Committed: Tue Jan 19 09:45:52 2016 -0500

--
 .../artemis/core/config/Configuration.java  |   2 +
 .../core/config/impl/ConfigurationImpl.java |   6 +
 .../deployers/impl/FileConfigurationParser.java |   4 +-
 .../core/server/SecuritySettingPlugin.java  |  24 +-
 .../core/server/impl/ActiveMQServerImpl.java|   9 +
 .../impl/LegacyLDAPSecuritySettingPlugin.java   | 375 +++
 .../resources/schema/artemis-configuration.xsd  |   6 +-
 .../impl/FileConfigurationParserTest.java   |  12 +-
 .../core/config/impl/FileConfigurationTest.java |  25 +-
 .../resources/ConfigurationTest-full-config.xml |  14 -
 .../resources/InvalidConfigurationTest6.xml |  45 +++
 .../test/resources/securitySettingPlugin.xml|  40 ++
 docs/user-manual/en/security.md |  47 +--
 .../integration/openwire/OpenWireTestBase.java  |  23 +-
 .../integration/security/LDAPSecurityTest.java  |   4 +-
 ...cyLDAPSecuritySettingPluginListenerTest.java | 352 +
 .../LegacyLDAPSecuritySettingPluginTest.java|   3 +-
 .../integration/security/SecurityTest.java  |  10 +-
 18 files changed, 817 insertions(+), 184 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d94c044e/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java
--
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java
index 96d5050..e493769 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java
@@ -868,6 +868,8 @@ public interface Configuration {
 */
Map> getSecurityRoles();
 
+   Configuration putSecurityRoles(String match, Set roles);
+
Configuration 
setConnectorServiceConfigurations(List configs);
 
Configuration 
addConnectorServiceConfiguration(ConnectorServiceConfiguration config);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d94c044e/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
--
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
index fc36809..0a6582f 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
@@ -1145,6 +1145,12 @@ public class ConfigurationImpl implements Configuration, 
Serializable {
}
 
@Override
+   public ConfigurationImpl putSecurityRoles(String match, Set roles) {
+  securitySettings.put(match, roles);
+  return this;
+   }
+
+   @Override
public ConfigurationImpl setSecurityRoles(final Map> 
securitySettings) {
   this.securitySettings = securitySettings;
   return this;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d94c044e/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
--
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
index 8b11b3b..e34207e 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationP

[1/3] activemq-artemis git commit: This closes #325

2016-01-19 Thread clebertsuconic
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 3433f5345 -> 8e4aca126


This closes #325


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/8e4aca12
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/8e4aca12
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/8e4aca12

Branch: refs/heads/master
Commit: 8e4aca126b4474938a4d430e7c17b5a17e0b804f
Parents: 3433f53 2dcd10b
Author: Clebert Suconic 
Authored: Tue Jan 19 09:45:52 2016 -0500
Committer: Clebert Suconic 
Committed: Tue Jan 19 09:45:52 2016 -0500

--
 .../activemq/artemis/cli/commands/Stop.java |  10 +-
 .../artemis/core/config/Configuration.java  |   2 +
 .../core/config/impl/ConfigurationImpl.java |   6 +
 .../deployers/impl/FileConfigurationParser.java |   4 +-
 .../core/server/SecuritySettingPlugin.java  |  24 +-
 .../core/server/impl/ActiveMQServerImpl.java|   9 +
 .../impl/LegacyLDAPSecuritySettingPlugin.java   | 375 +++
 .../resources/schema/artemis-configuration.xsd  |   6 +-
 .../impl/FileConfigurationParserTest.java   |  12 +-
 .../core/config/impl/FileConfigurationTest.java |  25 +-
 .../resources/ConfigurationTest-full-config.xml |  14 -
 .../resources/InvalidConfigurationTest6.xml |  45 +++
 .../test/resources/securitySettingPlugin.xml|  40 ++
 docs/user-manual/en/security.md |  47 +--
 .../integration/openwire/OpenWireTestBase.java  |  23 +-
 .../integration/security/LDAPSecurityTest.java  |   4 +-
 ...cyLDAPSecuritySettingPluginListenerTest.java | 352 +
 .../LegacyLDAPSecuritySettingPluginTest.java|   3 +-
 .../integration/security/SecurityTest.java  |  10 +-
 19 files changed, 824 insertions(+), 187 deletions(-)
--




[3/3] activemq-artemis git commit: This closes #324

2016-01-19 Thread clebertsuconic
This closes #324


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3433f534
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3433f534
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3433f534

Branch: refs/heads/master
Commit: 3433f5345ce2d58b57cc5fd29247267020bd1c90
Parents: 044e8e1 4258370
Author: Clebert Suconic 
Authored: Tue Jan 19 09:43:49 2016 -0500
Committer: Clebert Suconic 
Committed: Tue Jan 19 09:43:49 2016 -0500

--
 artemis-website/npm-shrinkwrap.json | 1253 ++
 docs/hacking-guide/en/building.md   |   19 +-
 pom.xml |3 +
 3 files changed, 1269 insertions(+), 6 deletions(-)
--




[1/3] activemq-artemis git commit: Update hacking guide with instructions to regenerate the shrinkwrap file

2016-01-19 Thread clebertsuconic
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 044e8e115 -> 3433f5345


Update hacking guide with instructions to regenerate the shrinkwrap file


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/42583701
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/42583701
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/42583701

Branch: refs/heads/master
Commit: 4258370142575392ddc6e61f7ce9b912fc0f3d2d
Parents: dcdba1f
Author: Paul Gallagher 
Authored: Tue Jan 19 11:46:45 2016 +
Committer: Paul Gallagher 
Committed: Tue Jan 19 11:57:25 2016 +

--
 docs/hacking-guide/en/building.md | 19 +--
 1 file changed, 13 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/42583701/docs/hacking-guide/en/building.md
--
diff --git a/docs/hacking-guide/en/building.md 
b/docs/hacking-guide/en/building.md
index 2651745..e1cd45b 100644
--- a/docs/hacking-guide/en/building.md
+++ b/docs/hacking-guide/en/building.md
@@ -9,12 +9,19 @@ still unsolved. This is specially true for the ['site' 
plugin](https://maven.apa
 
 ## Full Release
 
-The full release uses `gitbook` to build a static website from the 
documentation, if you don't have `gitbook` installed 
-then you can build the distribution without docs (see below) or install 
`gitbook` using `npm`:
+ Upgrading the `gitbook` version and regenerating the 
`npm-shrinkwrap.json` file
+The full release uses `gitbook` to build a static website from the 
documentation. This is automatically installed using
+an `NPM` plugin and is controled via a package.json file.
 
-$ npm install -g gitbook gitbook-cli
+Install `NPM` using the instructions below
 
-If you don't have `npm` installed then you would need to install it first.
+cd artemis-website
+alter the `package.json` changing the version
+npm cache clean; rm -rf ./node_modules/ ./node npm-shrinkwrap.json
+npm install --save-dev
+npm shrinkwrap --dev
+
+The new npm-shrinkwrap.json should be written, commit it.
 
  Install npm On Fedora
 
@@ -42,7 +49,7 @@ To install it to your local maven repo:
 
 ## Build the distribution without docs
 
-It is possible to build a distribution with out the manuals and Javadocs if 
you don't have or want `gitbook` installed, 
+It is possible to build a distribution with out the manuals and Javadocs.
 simply run
 
-$ mvn package
\ No newline at end of file
+$ mvn package



[2/3] activemq-artemis git commit: Added npm shrinkwrap file

2016-01-19 Thread clebertsuconic
Added npm shrinkwrap file


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/dcdba1fc
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/dcdba1fc
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/dcdba1fc

Branch: refs/heads/master
Commit: dcdba1fcbb269e49de0dae482ac23c3db171b2ac
Parents: 044e8e1
Author: Paul Gallagher 
Authored: Mon Jan 18 16:14:19 2016 +
Committer: Paul Gallagher 
Committed: Tue Jan 19 11:57:25 2016 +

--
 artemis-website/npm-shrinkwrap.json | 1253 ++
 pom.xml |3 +
 2 files changed, 1256 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dcdba1fc/artemis-website/npm-shrinkwrap.json
--
diff --git a/artemis-website/npm-shrinkwrap.json 
b/artemis-website/npm-shrinkwrap.json
new file mode 100644
index 000..815d2ba
--- /dev/null
+++ b/artemis-website/npm-shrinkwrap.json
@@ -0,0 +1,1253 @@
+{
+  "name": "artemis-websiteb",
+  "version": "1.5.0",
+  "dependencies": {
+"gitbook-cli": {
+  "version": "0.3.6",
+  "from": "gitbook-cli@~0.3.6",
+  "resolved": 
"https://registry.npmjs.org/gitbook-cli/-/gitbook-cli-0.3.6.tgz";,
+  "dependencies": {
+"q": {
+  "version": "1.4.1",
+  "from": "q@1.4.1",
+  "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz";
+},
+"lodash": {
+  "version": "3.10.1",
+  "from": "lodash@3.10.1",
+  "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz";
+},
+"semver": {
+  "version": "5.0.1",
+  "from": "semver@5.0.1",
+  "resolved": "https://registry.npmjs.org/semver/-/semver-5.0.1.tgz";
+},
+"npmi": {
+  "version": "1.0.1",
+  "from": "npmi@1.0.1",
+  "resolved": "https://registry.npmjs.org/npmi/-/npmi-1.0.1.tgz";,
+  "dependencies": {
+"semver": {
+  "version": "4.3.6",
+  "from": "semver@^4.1.0",
+  "resolved": 
"https://registry.npmjs.org/semver/-/semver-4.3.6.tgz";
+}
+  }
+},
+"tmp": {
+  "version": "0.0.27",
+  "from": "tmp@0.0.27",
+  "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.27.tgz";,
+  "dependencies": {
+"os-tmpdir": {
+  "version": "1.0.1",
+  "from": "os-tmpdir@~1.0.0",
+  "resolved": 
"https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz";
+}
+  }
+},
+"commander": {
+  "version": "2.8.1",
+  "from": "commander@2.8.1",
+  "resolved": 
"https://registry.npmjs.org/commander/-/commander-2.8.1.tgz";,
+  "dependencies": {
+"graceful-readlink": {
+  "version": "1.0.1",
+  "from": "graceful-readlink@>= 1.0.0",
+  "resolved": 
"https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz";
+}
+  }
+},
+"optimist": {
+  "version": "0.6.1",
+  "from": "optimist@0.6.1",
+  "resolved": 
"https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz";,
+  "dependencies": {
+"wordwrap": {
+  "version": "0.0.3",
+  "from": "wordwrap@~0.0.2",
+  "resolved": 
"https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz";
+},
+"minimist": {
+  "version": "0.0.10",
+  "from": "minimist@~0.0.1",
+  "resolved": 
"https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz";
+}
+  }
+},
+"fs-extra": {
+  "version": "0.24.0",
+  "from": "fs-extra@0.24.0",
+  "resolved": 
"https://registry.npmjs.org/fs-extra/-/fs-extra-0.24.0.tgz";,
+  "dependencies": {
+"graceful-fs": {
+  "version": "4.1.2",
+  "from": "graceful-fs@^4.1.2",
+  "resolved": 
"https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.2.tgz";
+},
+"jsonfile": {
+  "version": "2.2.3",
+  "from": "jsonfile@^2.1.0",
+  "resolved": 
"https://registry.npmjs.org/jsonfile/-/jsonfile-2.2.3.tgz";
+},
+"path-is-absolute": {
+  "version": "1.0.0",
+  "from": "path-is-absolute@^1.0.0",
+  "resolved": 
"https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz";
+},
+"rimraf": {
+  "version": "2.5.0",
+  "from": "rimraf@^2.2.8",
+  "resolved"

Jenkins build is still unstable: ActiveMQ-Java7 #921

2016-01-19 Thread Apache Jenkins Server
See 



Jenkins build became unstable: ActiveMQ-Java7 » ActiveMQ :: STOMP Protocol #921

2016-01-19 Thread Apache Jenkins Server
See 




Jenkins build is still unstable: ActiveMQ-Java7 » ActiveMQ :: Unit Tests #921

2016-01-19 Thread Apache Jenkins Server
See 




buildbot failure in ASF Buildbot on activemq-site-production

2016-01-19 Thread buildbot
The Buildbot has detected a new failure on builder activemq-site-production 
while building ASF Buildbot. Full details are available at:
http://ci.apache.org/builders/activemq-site-production/builds/4879

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'activemq-site-production' triggered 
this build
Build Source Stamp: [branch activemq/activemq-website] HEAD
Blamelist: 

BUILD FAILED: failed compile

Sincerely,
 -The Buildbot





buildbot success in ASF Buildbot on activemq-site-production

2016-01-19 Thread buildbot
The Buildbot has detected a restored build on builder activemq-site-production 
while building ASF Buildbot. Full details are available at:
http://ci.apache.org/builders/activemq-site-production/builds/4877

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-cms-slave

Build Reason: The Nightly scheduler named 'activemq-site-production' triggered 
this build
Build Source Stamp: [branch activemq/activemq-website] HEAD
Blamelist: 

Build succeeded!

Sincerely,
 -The Buildbot