JBoss hornetq SVN: r8938 - trunk.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-03-19 13:03:28 -0400 (Fri, 19 Mar 2010)
New Revision: 8938
Modified:
trunk/build-maven.xml
Log:
version update
Modified: trunk/build-maven.xml
===================================================================
--- trunk/build-maven.xml 2010-03-19 13:38:37 UTC (rev 8937)
+++ trunk/build-maven.xml 2010-03-19 17:03:28 UTC (rev 8938)
@@ -13,7 +13,7 @@
-->
<project default="upload" name="HornetQ">
- <property name="hornetq.version" value="2.1.0.r8936"/>
+ <property name="hornetq.version" value="2.1.0.r8938"/>
<property name="build.dir" value="build"/>
<property name="jars.dir" value="${build.dir}/jars"/>
14 years, 2 months
JBoss hornetq SVN: r8937 - in trunk/src: main/org/hornetq/ra and 1 other directory.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-03-19 09:38:37 -0400 (Fri, 19 Mar 2010)
New Revision: 8937
Modified:
trunk/src/config/ra.xml
trunk/src/main/org/hornetq/ra/HornetQRAConnectionRequestInfo.java
trunk/src/main/org/hornetq/ra/HornetQRALocalTransaction.java
trunk/src/main/org/hornetq/ra/HornetQRAManagedConnection.java
trunk/src/main/org/hornetq/ra/HornetQRASession.java
trunk/src/main/org/hornetq/ra/HornetQRAXAResource.java
Log:
fix resource adapter
Modified: trunk/src/config/ra.xml
===================================================================
--- trunk/src/config/ra.xml 2010-03-18 18:38:32 UTC (rev 8936)
+++ trunk/src/config/ra.xml 2010-03-19 13:38:37 UTC (rev 8937)
@@ -45,15 +45,9 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>server-id=0</config-property-value>
</config-property>
- <config-property>
- <description>Use XA?</description>
- <config-property-name>UseXA</config-property-name>
- <config-property-type>java.lang.Boolean</config-property-type>
- <config-property-value>true</config-property-value>
- </config-property>
<!--
<config-property>
- <description>The method to use for locatingthe transactionmanager</description>
+ <description>The method to use for locating the transactionmanager</description>
<config-property-name>TransactionManagerLocatorMethod</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>getTm</config-property-value>
Modified: trunk/src/main/org/hornetq/ra/HornetQRAConnectionRequestInfo.java
===================================================================
--- trunk/src/main/org/hornetq/ra/HornetQRAConnectionRequestInfo.java 2010-03-18 18:38:32 UTC (rev 8936)
+++ trunk/src/main/org/hornetq/ra/HornetQRAConnectionRequestInfo.java 2010-03-19 13:38:37 UTC (rev 8937)
@@ -43,9 +43,6 @@
/** The client id */
private String clientID;
- /** Use XA */
- private boolean useXA;
-
/** The type */
private final int type;
@@ -70,7 +67,6 @@
userName = prop.getUserName();
password = prop.getPassword();
clientID = prop.getClientID();
- useXA = prop.isUseXA();
this.type = type;
transacted = true;
acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
@@ -138,7 +134,6 @@
{
clientID = prop.getClientID();
}
- useXA = prop.isUseXA();
}
/**
@@ -240,20 +235,6 @@
}
/**
- * Use XA communication
- * @return True if XA; otherwise false
- */
- public boolean isUseXA()
- {
- if (HornetQRAConnectionRequestInfo.trace)
- {
- HornetQRAConnectionRequestInfo.log.trace("isUseXA() " + useXA);
- }
-
- return useXA;
- }
-
- /**
* Use transactions
* @return True if transacted; otherwise false
*/
@@ -305,7 +286,6 @@
return Util.compare(userName, you.getUserName()) && Util.compare(password, you.getPassword()) &&
Util.compare(clientID, you.getClientID()) &&
type == you.getType() &&
- useXA == you.isUseXA() &&
transacted == you.isTransacted() &&
acknowledgeMode == you.getAcknowledgeMode();
}
@@ -332,7 +312,6 @@
hash += 31 * hash + (userName != null ? userName.hashCode() : 0);
hash += 31 * hash + (password != null ? password.hashCode() : 0);
hash += 31 * hash + Integer.valueOf(type).hashCode();
- hash += 31 * hash + (useXA ? 1 : 0);
hash += 31 * hash + (transacted ? 1 : 0);
hash += 31 * hash + Integer.valueOf(acknowledgeMode).hashCode();
@@ -343,7 +322,7 @@
public String toString()
{
return "HornetQRAConnectionRequestInfo[type=" + type +
- ", useXA=" + useXA + ", transacted=" + transacted + ", acknowledgeMode=" + acknowledgeMode +
+ ", transacted=" + transacted + ", acknowledgeMode=" + acknowledgeMode +
", clientID=" + clientID + ", userName=" + userName + ", password=" + password + "]";
}
}
Modified: trunk/src/main/org/hornetq/ra/HornetQRALocalTransaction.java
===================================================================
--- trunk/src/main/org/hornetq/ra/HornetQRALocalTransaction.java 2010-03-18 18:38:32 UTC (rev 8936)
+++ trunk/src/main/org/hornetq/ra/HornetQRALocalTransaction.java 2010-03-19 13:38:37 UTC (rev 8937)
@@ -57,6 +57,12 @@
*/
public void begin() throws ResourceException
{
+ if (HornetQRALocalTransaction.trace)
+ {
+ HornetQRALocalTransaction.log.trace("begin()");
+ }
+
+ mc.setInManagedTx(true);
}
/**
@@ -65,6 +71,11 @@
*/
public void commit() throws ResourceException
{
+ if (HornetQRALocalTransaction.trace)
+ {
+ HornetQRALocalTransaction.log.trace("commit()");
+ }
+
mc.lock();
try
{
@@ -79,6 +90,7 @@
}
finally
{
+ mc.setInManagedTx(false);
mc.unlock();
}
}
@@ -89,6 +101,11 @@
*/
public void rollback() throws ResourceException
{
+ if (HornetQRALocalTransaction.trace)
+ {
+ HornetQRALocalTransaction.log.trace("rollback()");
+ }
+
mc.lock();
try
{
@@ -103,6 +120,7 @@
}
finally
{
+ mc.setInManagedTx(false);
mc.unlock();
}
}
Modified: trunk/src/main/org/hornetq/ra/HornetQRAManagedConnection.java
===================================================================
--- trunk/src/main/org/hornetq/ra/HornetQRAManagedConnection.java 2010-03-18 18:38:32 UTC (rev 8936)
+++ trunk/src/main/org/hornetq/ra/HornetQRAManagedConnection.java 2010-03-19 13:38:37 UTC (rev 8937)
@@ -27,18 +27,13 @@
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import javax.jms.QueueConnection;
-import javax.jms.QueueSession;
import javax.jms.ResourceAllocationException;
import javax.jms.Session;
import javax.jms.TopicConnection;
-import javax.jms.TopicSession;
import javax.jms.XAConnection;
import javax.jms.XAQueueConnection;
-import javax.jms.XAQueueSession;
import javax.jms.XASession;
import javax.jms.XATopicConnection;
-import javax.jms.XATopicSession;
-import javax.resource.NotSupportedException;
import javax.resource.ResourceException;
import javax.resource.spi.ConnectionEvent;
import javax.resource.spi.ConnectionEventListener;
@@ -95,22 +90,14 @@
// Physical JMS connection stuff
private Connection connection;
- private XAConnection xaConnection;
-
private Session session;
- private TopicSession topicSession;
-
- private QueueSession queueSession;
-
private XASession xaSession;
- private XATopicSession xaTopicSession;
-
- private XAQueueSession xaQueueSession;
-
private XAResource xaResource;
+ private boolean inManagedTx;
+
/**
* Constructor
* @param mcf The managed connection factory
@@ -136,13 +123,8 @@
handles = Collections.synchronizedSet(new HashSet<HornetQRASession>());
connection = null;
- xaConnection = null;
session = null;
- topicSession = null;
- queueSession = null;
xaSession = null;
- xaTopicSession = null;
- xaQueueSession = null;
xaResource = null;
try
@@ -213,11 +195,6 @@
try
{
- if (xaConnection != null)
- {
- xaConnection.stop();
- }
-
if (connection != null)
{
connection.stop();
@@ -247,7 +224,7 @@
HornetQRAManagedConnection.log.trace("destroy()");
}
- if (isDestroyed.get() || xaConnection == null && connection == null)
+ if (isDestroyed.get() || connection == null)
{
return;
}
@@ -256,14 +233,7 @@
try
{
- if (xaConnection != null)
- {
- xaConnection.setExceptionListener(null);
- }
- else
- {
- connection.setExceptionListener(null);
- }
+ connection.setExceptionListener(null);
}
catch (JMSException e)
{
@@ -276,26 +246,6 @@
{
try
{
- if (topicSession != null)
- {
- topicSession.close();
- }
-
- if (xaTopicSession != null)
- {
- xaTopicSession.close();
- }
-
- if (queueSession != null)
- {
- queueSession.close();
- }
-
- if (xaQueueSession != null)
- {
- xaQueueSession.close();
- }
-
if (session != null)
{
session.close();
@@ -315,11 +265,6 @@
{
connection.close();
}
-
- if (xaConnection != null)
- {
- xaConnection.close();
- }
}
catch (Throwable e)
{
@@ -345,6 +290,8 @@
destroyHandles();
+ inManagedTx = false;
+
// I'm recreating the lock object when we return to the pool
// because it looks too nasty to expect the connection handle
// to unlock properly in certain race conditions
@@ -473,29 +420,13 @@
HornetQRAManagedConnection.log.trace("getXAResource()");
}
- if (xaConnection == null)
- {
- throw new NotSupportedException("Non XA transaction not supported");
- }
-
//
// Spec says a mc must allways return the same XA resource,
// so we cache it.
//
if (xaResource == null)
{
- if (xaTopicSession != null)
- {
- xaResource = xaTopicSession.getXAResource();
- }
- else if (xaQueueSession != null)
- {
- xaResource = xaQueueSession.getXAResource();
- }
- else
- {
xaResource = xaSession.getXAResource();
- }
}
if (HornetQRAManagedConnection.trace)
@@ -602,14 +533,7 @@
try
{
- if (xaConnection != null)
- {
- xaConnection.setExceptionListener(null);
- }
- else
- {
- connection.setExceptionListener(null);
- }
+ connection.setExceptionListener(null);
}
catch (JMSException e)
{
@@ -621,72 +545,28 @@
}
/**
- * Is managed connection running in XA mode
- * @return True if XA; otherwise false
+ * Get the session for this connection.
+ * @return The session
+ * @throws JMSException
*/
- protected boolean isXA()
+ protected Session getSession() throws JMSException
{
- if (HornetQRAManagedConnection.trace)
+ if (xaResource != null && inManagedTx)
{
- HornetQRAManagedConnection.log.trace("isXA()");
- }
-
- return xaConnection != null;
- }
-
- /**
- * Get the XA session for this connection.
- * @return The XA session
- */
- protected XASession getXASession()
- {
- if (HornetQRAManagedConnection.trace)
- {
- HornetQRAManagedConnection.log.trace("getXASession()");
- }
-
- if (isXA())
- {
- if (xaTopicSession != null)
+ if (HornetQRAManagedConnection.trace)
{
- return xaTopicSession;
+ HornetQRAManagedConnection.log.trace("getSession() -> XA session " + xaSession.getSession());
}
- else if (xaQueueSession != null)
- {
- return xaQueueSession;
- }
- else
- {
- return xaSession;
- }
- }
- else
- {
- return null;
- }
- }
- /**
- * Get the session for this connection.
- * @return The session
- */
- protected Session getSession()
- {
- if (HornetQRAManagedConnection.trace)
- {
- HornetQRAManagedConnection.log.trace("getSession()");
- }
-
- if (topicSession != null)
- {
- return topicSession;
- }
- else if (queueSession != null)
- {
- return queueSession;
- }
+ return xaSession.getSession();
+ }
else
{
+ if (HornetQRAManagedConnection.trace)
+ {
+ HornetQRAManagedConnection.log.trace("getSession() -> session " + xaSession.getSession());
+ }
+
return session;
}
}
@@ -794,11 +674,6 @@
{
connection.start();
}
-
- if (xaConnection != null)
- {
- xaConnection.start();
- }
}
/**
@@ -812,11 +687,6 @@
HornetQRAManagedConnection.log.trace("stop()");
}
- if (xaConnection != null)
- {
- xaConnection.stop();
- }
-
if (connection != null)
{
connection.stop();
@@ -851,109 +721,55 @@
try
{
boolean transacted = cri.isTransacted();
- int acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
-
+ int acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
+
if (cri.getType() == HornetQRAConnectionFactory.TOPIC_CONNECTION)
{
- if (cri.isUseXA())
+ if (userName != null && password != null)
{
- if (userName != null && password != null)
- {
- xaConnection = mcf.getHornetQConnectionFactory().createXATopicConnection(userName, password);
- }
- else
- {
- xaConnection = mcf.getHornetQConnectionFactory().createXATopicConnection();
- }
-
- xaConnection.setExceptionListener(this);
-
- xaTopicSession = ((XATopicConnection)xaConnection).createXATopicSession();
- topicSession = xaTopicSession.getTopicSession();
+ connection = mcf.getHornetQConnectionFactory().createXATopicConnection(userName, password);
}
else
{
- if (userName != null && password != null)
- {
- connection = mcf.getHornetQConnectionFactory().createTopicConnection(userName, password);
- }
- else
- {
- connection = mcf.getHornetQConnectionFactory().createTopicConnection();
- }
+ connection = mcf.getHornetQConnectionFactory().createXATopicConnection();
+ }
- connection.setExceptionListener(this);
+ connection.setExceptionListener(this);
- topicSession = ((TopicConnection)connection).createTopicSession(transacted, acknowledgeMode);
- }
+ xaSession = ((XATopicConnection)connection).createXATopicSession();
+ session = ((TopicConnection)connection).createTopicSession(transacted, acknowledgeMode);
}
else if (cri.getType() == HornetQRAConnectionFactory.QUEUE_CONNECTION)
{
- if (cri.isUseXA())
+ if (userName != null && password != null)
{
- if (userName != null && password != null)
- {
- xaConnection = mcf.getHornetQConnectionFactory().createXAQueueConnection(userName, password);
- }
- else
- {
- xaConnection = mcf.getHornetQConnectionFactory().createXAQueueConnection();
- }
-
- xaConnection.setExceptionListener(this);
-
- xaQueueSession = ((XAQueueConnection)xaConnection).createXAQueueSession();
- queueSession = xaQueueSession.getQueueSession();
+ connection = mcf.getHornetQConnectionFactory().createXAQueueConnection(userName, password);
}
else
{
- if (userName != null && password != null)
- {
- connection = mcf.getHornetQConnectionFactory().createQueueConnection(userName, password);
- }
- else
- {
- connection = mcf.getHornetQConnectionFactory().createQueueConnection();
- }
+ connection = mcf.getHornetQConnectionFactory().createXAQueueConnection();
+ }
- connection.setExceptionListener(this);
+ connection.setExceptionListener(this);
- queueSession = ((QueueConnection)connection).createQueueSession(transacted, acknowledgeMode);
- }
+ xaSession = ((XAQueueConnection)connection).createXAQueueSession();
+ session = ((QueueConnection)connection).createQueueSession(transacted, acknowledgeMode);
}
else
{
- if (cri.isUseXA())
+ if (userName != null && password != null)
{
- if (userName != null && password != null)
- {
- xaConnection = mcf.getHornetQConnectionFactory().createXAConnection(userName, password);
- }
- else
- {
- xaConnection = mcf.getHornetQConnectionFactory().createXAConnection();
- }
-
- xaConnection.setExceptionListener(this);
-
- xaSession = xaConnection.createXASession();
- session = xaSession.getSession();
+ connection = mcf.getHornetQConnectionFactory().createXAConnection(userName, password);
}
else
{
- if (userName != null && password != null)
- {
- connection = mcf.getHornetQConnectionFactory().createConnection(userName, password);
- }
- else
- {
- connection = mcf.getHornetQConnectionFactory().createConnection();
- }
+ connection = mcf.getHornetQConnectionFactory().createXAConnection();
+ }
- connection.setExceptionListener(this);
+ connection.setExceptionListener(this);
- session = connection.createSession(transacted, acknowledgeMode);
- }
+ xaSession = ((XAConnection)connection).createXASession();
+ session = connection.createSession(transacted, acknowledgeMode);
}
}
catch (JMSException je)
@@ -961,4 +777,9 @@
throw new ResourceException(je.getMessage(), je);
}
}
+
+ protected void setInManagedTx(boolean inManagedTx)
+ {
+ this.inManagedTx = inManagedTx;
+ }
}
Modified: trunk/src/main/org/hornetq/ra/HornetQRASession.java
===================================================================
--- trunk/src/main/org/hornetq/ra/HornetQRASession.java 2010-03-18 18:38:32 UTC (rev 8936)
+++ trunk/src/main/org/hornetq/ra/HornetQRASession.java 2010-03-19 13:38:37 UTC (rev 8937)
@@ -47,6 +47,7 @@
import javax.jms.XAQueueSession;
import javax.jms.XASession;
import javax.jms.XATopicSession;
+import javax.resource.ResourceException;
import javax.resource.spi.ConnectionEvent;
import javax.transaction.xa.XAResource;
@@ -1214,9 +1215,7 @@
{
lock();
- XASession session = getXASessionInternal();
-
- return session.getXAResource();
+ return getXAResourceInternal();
}
catch (Throwable t)
{
@@ -1551,26 +1550,35 @@
}
/**
- * Get the XA session and ensure that it is open
- * @return The session
+ * Get the XA resource and ensure that it is open
+ * @return The XA Resource
* @exception JMSException Thrown if an error occurs
* @exception IllegalStateException The session is closed
*/
- XASession getXASessionInternal() throws JMSException
+ XAResource getXAResourceInternal() throws JMSException
{
if (mc == null)
{
throw new IllegalStateException("The session is closed");
}
- XASession session = mc.getXASession();
+ try
+ {
+ XAResource xares = mc.getXAResource();
- if (HornetQRASession.trace)
+ if (HornetQRASession.trace)
+ {
+ HornetQRASession.log.trace("getXAResourceInternal " + xares + " for " + this);
+ }
+
+ return xares;
+ }
+ catch (ResourceException e)
{
- HornetQRASession.log.trace("getXASessionInternal " + session + " for " + this);
+ JMSException jmse = new JMSException("Unable to get XA Resource");
+ jmse.initCause(e);
+ throw jmse;
}
-
- return session;
}
/**
Modified: trunk/src/main/org/hornetq/ra/HornetQRAXAResource.java
===================================================================
--- trunk/src/main/org/hornetq/ra/HornetQRAXAResource.java 2010-03-18 18:38:32 UTC (rev 8936)
+++ trunk/src/main/org/hornetq/ra/HornetQRAXAResource.java 2010-03-19 13:38:37 UTC (rev 8937)
@@ -76,6 +76,7 @@
}
finally
{
+ managedConnection.setInManagedTx(true);
managedConnection.unlock();
}
}
@@ -100,6 +101,7 @@
}
finally
{
+ managedConnection.setInManagedTx(false);
managedConnection.unlock();
}
}
14 years, 2 months
JBoss hornetq SVN: r8936 - trunk.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-03-18 14:38:32 -0400 (Thu, 18 Mar 2010)
New Revision: 8936
Modified:
trunk/build-maven.xml
Log:
AS6 integration changes
Modified: trunk/build-maven.xml
===================================================================
--- trunk/build-maven.xml 2010-03-18 18:37:05 UTC (rev 8935)
+++ trunk/build-maven.xml 2010-03-18 18:38:32 UTC (rev 8936)
@@ -13,7 +13,7 @@
-->
<project default="upload" name="HornetQ">
- <property name="hornetq.version" value="2.1.0.r8931"/>
+ <property name="hornetq.version" value="2.1.0.r8936"/>
<property name="build.dir" value="build"/>
<property name="jars.dir" value="${build.dir}/jars"/>
14 years, 2 months
JBoss hornetq SVN: r8935 - in trunk/src: config/jboss-6/non-clustered and 1 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-03-18 14:37:05 -0400 (Thu, 18 Mar 2010)
New Revision: 8935
Modified:
trunk/src/config/jboss-6/clustered/hornetq-jboss-beans.xml
trunk/src/config/jboss-6/non-clustered/hornetq-jboss-beans.xml
trunk/src/main/org/hornetq/core/config/impl/FileConfiguration.java
Log:
AS6 integration changes
Modified: trunk/src/config/jboss-6/clustered/hornetq-jboss-beans.xml
===================================================================
--- trunk/src/config/jboss-6/clustered/hornetq-jboss-beans.xml 2010-03-18 15:25:10 UTC (rev 8934)
+++ trunk/src/config/jboss-6/clustered/hornetq-jboss-beans.xml 2010-03-18 18:37:05 UTC (rev 8935)
@@ -9,7 +9,9 @@
</bean>
<!-- The core configuration -->
- <bean name="Configuration" class="org.hornetq.core.config.impl.FileConfiguration"/>
+ <bean name="Configuration" class="org.hornetq.core.config.impl.FileConfiguration">
+ <property name="configurationUrl">${jboss.server.home.url}${/}deploy${/}hornetq${/}hornetq-configuration.xml</property>
+ </bean>
<!-- The security manager -->
<bean name="HornetQSecurityManager" class="org.hornetq.integration.jboss.security.JBossASSecurityManager">
Modified: trunk/src/config/jboss-6/non-clustered/hornetq-jboss-beans.xml
===================================================================
--- trunk/src/config/jboss-6/non-clustered/hornetq-jboss-beans.xml 2010-03-18 15:25:10 UTC (rev 8934)
+++ trunk/src/config/jboss-6/non-clustered/hornetq-jboss-beans.xml 2010-03-18 18:37:05 UTC (rev 8935)
@@ -9,7 +9,9 @@
</bean>
<!-- The core configuration -->
- <bean name="Configuration" class="org.hornetq.core.config.impl.FileConfiguration"/>
+ <bean name="Configuration" class="org.hornetq.core.config.impl.FileConfiguration">
+ <property name="configurationUrl">${jboss.server.home.url}${/}deploy${/}hornetq${/}hornetq-configuration.xml</property>
+ </bean>
<!-- The security manager -->
<bean name="HornetQSecurityManager" class="org.hornetq.integration.jboss.security.JBossASSecurityManager">
Modified: trunk/src/main/org/hornetq/core/config/impl/FileConfiguration.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/impl/FileConfiguration.java 2010-03-18 15:25:10 UTC (rev 8934)
+++ trunk/src/main/org/hornetq/core/config/impl/FileConfiguration.java 2010-03-18 18:37:05 UTC (rev 8935)
@@ -16,6 +16,7 @@
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
+import java.util.Properties;
import org.hornetq.core.deployers.impl.FileConfigurationParser;
import org.hornetq.core.logging.Logger;
@@ -59,8 +60,16 @@
{
return;
}
-
+
+
URL url = getClass().getClassLoader().getResource(configurationUrl);
+
+ if (url == null)
+ {
+ // The URL is outside of the classloader. Trying a pure url now
+ url = new URL(configurationUrl);
+ }
+
FileConfiguration.log.debug("Loading server configuration from " + url);
Reader reader = new InputStreamReader(url.openStream());
14 years, 2 months
JBoss hornetq SVN: r8933 - trunk/src/main/org/hornetq/api/core/management.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-03-17 07:06:55 -0400 (Wed, 17 Mar 2010)
New Revision: 8933
Modified:
trunk/src/main/org/hornetq/api/core/management/ResourceNames.java
Log:
fixed topic resource key
Modified: trunk/src/main/org/hornetq/api/core/management/ResourceNames.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/management/ResourceNames.java 2010-03-17 09:56:20 UTC (rev 8932)
+++ trunk/src/main/org/hornetq/api/core/management/ResourceNames.java 2010-03-17 11:06:55 UTC (rev 8933)
@@ -48,7 +48,7 @@
public static final String JMS_QUEUE = "jms.queue.";
- public static final String JMS_TOPIC = "jms.address.";
+ public static final String JMS_TOPIC = "jms.topic.";
public static final String JMS_CONNECTION_FACTORY = "jms.connectionfactory.";
14 years, 2 months
JBoss hornetq SVN: r8932 - trunk/src/main/org/hornetq/jms/server/impl.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-03-17 05:56:20 -0400 (Wed, 17 Mar 2010)
New Revision: 8932
Modified:
trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
Log:
JMS Server deployment
* do not start the JMSServerDeployer if HornetQ configuration
has disabled file deployment
Modified: trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2010-03-17 05:20:45 UTC (rev 8931)
+++ trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2010-03-17 09:56:20 UTC (rev 8932)
@@ -139,16 +139,19 @@
// start the JMS deployer only if the configuration is not done using the JMSConfiguration object
if (config == null)
{
- jmsDeployer = new JMSServerDeployer(this, deploymentManager, server.getConfiguration());
-
- if (configFileName != null)
+ if (server.getConfiguration().isFileDeploymentEnabled())
{
- jmsDeployer.setConfigFileNames(new String[] { configFileName });
- }
+ jmsDeployer = new JMSServerDeployer(this, deploymentManager, server.getConfiguration());
- jmsDeployer.start();
+ if (configFileName != null)
+ {
+ jmsDeployer.setConfigFileNames(new String[] { configFileName });
+ }
- deploymentManager.start();
+ jmsDeployer.start();
+
+ deploymentManager.start();
+ }
}
else
{
14 years, 2 months
JBoss hornetq SVN: r8931 - trunk.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-03-17 01:20:45 -0400 (Wed, 17 Mar 2010)
New Revision: 8931
Modified:
trunk/build-maven.xml
Log:
maven tweaks
Modified: trunk/build-maven.xml
===================================================================
--- trunk/build-maven.xml 2010-03-17 02:39:17 UTC (rev 8930)
+++ trunk/build-maven.xml 2010-03-17 05:20:45 UTC (rev 8931)
@@ -13,7 +13,7 @@
-->
<project default="upload" name="HornetQ">
- <property name="hornetq.version" value="2.1.0.snapshot"/>
+ <property name="hornetq.version" value="2.1.0.r8931"/>
<property name="build.dir" value="build"/>
<property name="jars.dir" value="${build.dir}/jars"/>
@@ -181,72 +181,74 @@
</target>
<target name="updateMavenRepos">
- <fail unless="hornetq.distro" message="*** Please set the hornetq.distro property i.e. -Dhornetq.distro=foo ***"/>
<fail unless="hornetq.repos" message="*** Please set the hornetq.repos property i.e. -Dhornetq.repos=foo ***"/>
- <property name="src.dir" value="${hornetq.distro}"/>
<property name="dest.dir" value="${hornetq.repos}"/>
+
+
+ <antcall target="deploy-jar">
+ <param name="artifact.id" value="hornetq-resources"/>
+ </antcall>
- <tstamp>
- <format property="TIMESTAMP" pattern="yyyyMMddhhmmss" locale="en,UK"/>
- </tstamp>
- <antcall target="copyJar">
- <param name="jarName" value="hornetq-bootstrap"/>
- <param name="libDir" value="${src.dir}/lib"/>
- </antcall>
- <antcall target="copyJar">
- <param name="jarName" value="hornetq-core"/>
- <param name="libDir" value="${src.dir}/lib"/>
- </antcall>
- <antcall target="copyJar">
- <param name="jarName" value="hornetq-jboss-as-integration"/>
- <param name="libDir" value="${src.dir}/lib"/>
- </antcall>
- <antcall target="copyJar">
- <param name="jarName" value="hornetq-jms"/>
- <param name="libDir" value="${src.dir}/lib"/>
- </antcall>
- <antcall target="copyJar">
- <param name="jarName" value="hornetq-logging"/>
- <param name="libDir" value="${src.dir}/lib"/>
- </antcall>
- <antcall target="copyJar">
- <param name="jarName" value="hornetq-transports"/>
- <param name="libDir" value="${src.dir}/lib"/>
- </antcall>
- <mkdir dir="tmpLib"/>
- <unjar src="${src.dir}/lib/hornetq-ra.rar" dest="tmpLib"/>
- <antcall target="copyJar">
- <param name="jarName" value="hornetq-ra"/>
- <param name="libDir" value="tmpLib"/>
- </antcall>
- <delete dir="tmpLib"/>
- <antcall target="copyJar">
- <param name="jarName" value="hornetq-core-client"/>
- <param name="libDir" value="${src.dir}/client"/>
- </antcall>
- <antcall target="copyJar">
- <param name="jarName" value="hornetq-jms-client"/>
- <param name="libDir" value="${src.dir}/client"/>
- </antcall>
+ <antcall target="deploy-jar">
+ <param name="artifact.id" value="hornetq-jms"/>
+ </antcall>
+
+ <antcall target="deploy-jar">
+ <param name="artifact.id" value="hornetq-jms-client"/>
+ </antcall>
+
+ <antcall target="deploy-jar">
+ <param name="artifact.id" value="hornetq-core"/>
+ </antcall>
+
+ <antcall target="deploy-jar">
+ <param name="artifact.id" value="hornetq-jboss-as-integration"/>
+ </antcall>
+
+ <antcall target="deploy-jar">
+ <param name="artifact.id" value="hornetq-bootstrap"/>
+ </antcall>
+
+ <antcall target="deploy-jar">
+ <param name="artifact.id" value="hornetq-core-client"/>
+ </antcall>
+
+ <antcall target="deploy-jar">
+ <param name="artifact.id" value="hornetq-logging"/>
+ </antcall>
+
+ <antcall target="deploy-jar">
+ <param name="artifact.id" value="hornetq-ra"/>
+ </antcall>
+
+ <antcall target="deploy-jar">
+ <param name="artifact.id" value="hornetq-transports"/>
+ </antcall>
</target>
- <target name="copyJar">
- <mkdir dir="${dest.dir}/${jarName}/${hornetq.version}"/>
- <echo file="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.pom"
+ <target name="deploy-jar">
+ <tempfile property="temporary.pom" prefix="pom" suffix=".xml"/>
+ <echo file="${temporary.pom}"
message="<?xml version="1.0" encoding="UTF-8"?><project>${line.separator}
<modelVersion>4.0.0</modelVersion>${line.separator}
<groupId>org.hornetq</groupId>${line.separator}
- <artifactId>${jarName}</artifactId>${line.separator}
+ <artifactId>${artifact.id}</artifactId>${line.separator}
<version>${hornetq.version}</version>${line.separator}</project>"/>
- <copy file="${libDir}/${jarName}.jar" tofile="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.jar"/>
- <checksum file="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.jar" algorithm="md5"/>
- <checksum file="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.jar" algorithm="sha1"/>
- <checksum file="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.pom" algorithm="md5"/>
- <checksum file="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.pom" algorithm="sha1"/>
- <replace file="${dest.dir}/${jarName}/maven-metadata.xml" token="</versions>" value=" <version>${hornetq.version}</version>${line.separator} </versions>"/>
- <replaceregexp flags="g" file="${dest.dir}/${jarName}/maven-metadata.xml" match="<lastUpdated>(.+)</lastUpdated>" replace="<lastUpdated>${TIMESTAMP}</lastUpdated>"/>
- <checksum file="${dest.dir}/${jarName}/maven-metadata.xml" algorithm="md5"/>
- <checksum file="${dest.dir}/${jarName}/maven-metadata.xml" algorithm="sha1"/>
+
+ <exec executable="mvn">
+ <arg value="-e"/>
+ <arg value="deploy:deploy-file"/>
+ <arg value="-DpomFile=${temporary.pom}"/>
+ <arg value="-DgroupId=org.hornetq"/>
+ <arg value="-DartifactId=${artifact.id}"/>
+ <arg value="-Dversion=${hornetq.version}"/>
+ <arg value="-Dpackaging=jar"/>
+ <arg value="-Dfile=./build/jars/${artifact.id}.jar"/>
+ <arg value="-DrepositoryId=jboss-releases"/>
+ <arg value="-Durl=file:///${dest.dir}"/>
+ </exec>
+
+ <delete file="${temporary.pom}"/>
</target>
</project>
14 years, 2 months
JBoss hornetq SVN: r8930 - trunk/tests/src/org/hornetq/tests/integration/jms/server/management.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-03-16 22:39:17 -0400 (Tue, 16 Mar 2010)
New Revision: 8930
Modified:
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
Log:
Fixing compilation errors
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java 2010-03-16 21:50:12 UTC (rev 8929)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java 2010-03-17 02:39:17 UTC (rev 8930)
@@ -265,6 +265,11 @@
{
proxy.invokeOperation("resume");
}
+
+ public String getSelector()
+ {
+ return (String)proxy.retrieveAttributeValue("selector");
+ }
};
}
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2010-03-16 21:50:12 UTC (rev 8929)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2010-03-17 02:39:17 UTC (rev 8930)
@@ -20,11 +20,11 @@
import javax.jms.Session;
import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.management.Parameter;
import org.hornetq.api.core.management.ResourceNames;
import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.management.JMSServerControl;
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
+import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.jms.client.HornetQConnectionFactory;
import org.hornetq.jms.client.HornetQDestination;
@@ -236,6 +236,53 @@
return (String[])proxy.invokeOperation("listSessions", connectionID);
}
+ public void addAddressSettings(String addressMatch,
+ String DLA,
+ String expiryAddress,
+ boolean lastValueQueue,
+ int deliveryAttempts,
+ long maxSizeBytes,
+ int pageSizeBytes,
+ long redeliveryDelay,
+ long redistributionDelay,
+ boolean sendToDLAOnNoRoute,
+ String addressFullMessagePolicy) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void addSecuritySettings(String addressMatch,
+ String sendRoles,
+ String consumeRoles,
+ String createDurableQueueRoles,
+ String deleteDurableQueueRoles,
+ String createTempQueueRoles,
+ String deleteTempQueueRoles,
+ String manageRoles) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public AddressSettings getAddressSettings(String address)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getAddressSettingsAsJSON(String addressMatch) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void removeSecuritySettings(String addressMatch) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
};
}
// Public --------------------------------------------------------
14 years, 2 months
JBoss hornetq SVN: r8929 - in trunk: src/main/org/hornetq/api/jms/management and 7 other directories.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-03-16 17:50:12 -0400 (Tue, 16 Mar 2010)
New Revision: 8929
Added:
trunk/src/main/org/hornetq/utils/SecurityFormatter.java
Modified:
trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java
trunk/src/main/org/hornetq/api/jms/management/JMSQueueControl.java
trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java
trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
trunk/src/main/org/hornetq/jms/server/JMSServerManager.java
trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
trunk/tests/src/org/hornetq/tests/unit/core/deployers/impl/QueueDeployerTest.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-288 - added address settings stuff to management api + some tweaks
Modified: trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java 2010-03-16 18:24:13 UTC (rev 8928)
+++ trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java 2010-03-16 21:50:12 UTC (rev 8929)
@@ -17,7 +17,12 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Interceptor;
+import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
+import org.hornetq.core.settings.impl.AddressSettings;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* A HornetQServerControl is used to manage HornetQ servers.
*/
@@ -487,10 +492,17 @@
@Parameter(desc="a comma-separated list of roles allowed to create temporary queues", name="createTempQueueRoles") String createTempQueueRoles,
@Parameter(desc="a comma-separated list of roles allowed to delete temporary queues", name="deleteTempQueueRoles") String deleteTempQueueRoles,
@Parameter(desc="a comma-separated list of roles allowed to send management messages messages", name="manage") String manageRoles) throws Exception;
-
- void removeSecuritySettings(String addressMatch) throws Exception;
- Object[] getRoles(String addressMatch) throws Exception;
+ @Operation(desc = "Remove security settings for an address", impact = MBeanOperationInfo.ACTION)
+ void removeSecuritySettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
- String getRolesAsJSON(String addressMatch) throws Exception;
+ @Operation(desc = "get roles for a specific address match", impact = MBeanOperationInfo.INFO)
+ Object[] getRoles(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
+
+ @Operation(desc = "get roles (as a JSON string) for a specific address match", impact = MBeanOperationInfo.INFO)
+ String getRolesAsJSON(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
+
+ @Operation(desc = "get address settings (as a JSON string) for a specific address match", impact = MBeanOperationInfo.INFO)
+ String getAddressSettingsAsJSON(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
+
}
Modified: trunk/src/main/org/hornetq/api/jms/management/JMSQueueControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/JMSQueueControl.java 2010-03-16 18:24:13 UTC (rev 8928)
+++ trunk/src/main/org/hornetq/api/jms/management/JMSQueueControl.java 2010-03-16 21:50:12 UTC (rev 8929)
@@ -69,6 +69,11 @@
*/
int getDeliveringCount();
+ /**
+ * returns the selector for the queue
+ */
+ String getSelector();
+
// Operations ----------------------------------------------------
/**
Modified: trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java 2010-03-16 18:24:13 UTC (rev 8928)
+++ trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java 2010-03-16 21:50:12 UTC (rev 8929)
@@ -21,6 +21,7 @@
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.management.Operation;
import org.hornetq.api.core.management.Parameter;
+import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.spi.core.remoting.ConnectorFactory;
/**
@@ -200,4 +201,45 @@
*/
@Operation(desc = "List the sessions for the given connectionID", impact = MBeanOperationInfo.INFO)
String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
+
+ /**
+ * adds a new address setting for a specific address
+ */
+ @Operation(desc= "Add address settings for addresses matching the addressMatch", impact = MBeanOperationInfo.ACTION)
+ void addAddressSettings(@Parameter(desc="an address match", name="addressMatch") String addressMatch,
+ @Parameter(desc="the dead letter address setting", name="DLA") String DLA,
+ @Parameter(desc="the expiry address setting", name="expiryAddress") String expiryAddress,
+ @Parameter(desc="are any queues created for this address a last value queue", name="lastValueQueue") boolean lastValueQueue,
+ @Parameter(desc="the delivery attempts", name="deliveryAttempts") int deliveryAttempts,
+ @Parameter(desc="the max size in bytes", name="maxSizeBytes") long maxSizeBytes,
+ @Parameter(desc="the page size in bytes", name="pageSizeBytes") int pageSizeBytes,
+ @Parameter(desc="the redelivery delay", name="redeliveryDelay") long redeliveryDelay,
+ @Parameter(desc="the redistribution delay", name="redistributionDelay") long redistributionDelay,
+ @Parameter(desc="do we send to the DLA when there is no where to route the message", name="sendToDLAOnNoRoute") boolean sendToDLAOnNoRoute,
+ @Parameter(desc="the ploicy to use when the address is full", name="addressFullMessagePolicy") String addressFullMessagePolicy) throws Exception;
+
+ AddressSettings getAddressSettings(String address);
+
+ /**
+ * returns the address settings as a JSON string
+ */
+ @Operation(desc = "returns the address settings as a JSON string for an address match", impact = MBeanOperationInfo.INFO)
+ String getAddressSettingsAsJSON(@Parameter(desc="an address match", name="addressMatch") String addressMatch) throws Exception;
+
+ @Operation(desc= "Add security settings for addresses matching the addressMatch", impact = MBeanOperationInfo.ACTION)
+ void addSecuritySettings(
+ @Parameter(desc="an address match", name="addressMatch") String addressMatch,
+ @Parameter(desc="a comma-separated list of roles allowed to send messages", name="send") String sendRoles,
+ @Parameter(desc="a comma-separated list of roles allowed to consume messages", name="consume") String consumeRoles,
+ @Parameter(desc="a comma-separated list of roles allowed to create durable queues", name="createDurableQueueRoles") String createDurableQueueRoles,
+ @Parameter(desc="a comma-separated list of roles allowed to delete durable queues", name="deleteDurableQueueRoles") String deleteDurableQueueRoles,
+ @Parameter(desc="a comma-separated list of roles allowed to create temporary queues", name="createTempQueueRoles") String createTempQueueRoles,
+ @Parameter(desc="a comma-separated list of roles allowed to delete temporary queues", name="deleteTempQueueRoles") String deleteTempQueueRoles,
+ @Parameter(desc="a comma-separated list of roles allowed to send management messages messages", name="manage") String manageRoles) throws Exception;
+
+ /**
+ * removes the address settings as a JSON string
+ */
+ @Operation(desc = "removes the address settings for an address match", impact = MBeanOperationInfo.INFO)
+ void removeSecuritySettings(@Parameter(desc="an address match", name="addressMatch") String addressMatch) throws Exception;
}
Modified: trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-03-16 18:24:13 UTC (rev 8928)
+++ trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-03-16 21:50:12 UTC (rev 8929)
@@ -14,15 +14,7 @@
package org.hornetq.core.management.impl;
import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
import java.util.Map.Entry;
import javax.management.ListenerNotFoundException;
@@ -53,10 +45,13 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.JournalType;
import org.hornetq.core.server.ServerSession;
+import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
+import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.core.transaction.ResourceManager;
import org.hornetq.core.transaction.Transaction;
import org.hornetq.core.transaction.impl.XidImpl;
import org.hornetq.spi.core.protocol.RemotingConnection;
+import org.hornetq.utils.SecurityFormatter;
import org.hornetq.utils.json.JSONArray;
import org.hornetq.utils.json.JSONObject;
@@ -90,20 +85,6 @@
// Static --------------------------------------------------------
- private static List<String> toList(final String commaSeparatedString)
- {
- List<String> list = new ArrayList<String>();
- if (commaSeparatedString == null || commaSeparatedString.trim().length() == 0)
- {
- return list;
- }
- String[] values = commaSeparatedString.split(",");
- for (int i = 0; i < values.length; i++)
- {
- list.add(values[i].trim());
- }
- return list;
- }
// Constructors --------------------------------------------------
@@ -1084,36 +1065,8 @@
clearIO();
try
{
- List<String> createDurableQueue = toList(createDurableQueueRoles);
- List<String> deleteDurableQueue = toList(deleteDurableQueueRoles);
- List<String> createTempQueue = toList(createTempQueueRoles);
- List<String> deleteTempQueue = toList(deleteTempQueueRoles);
- List<String> send = toList(sendRoles);
- List<String> consume = toList(consumeRoles);
- List<String> manage = toList(manageRoles);
+ Set<Role> roles = SecurityFormatter.createSecurity(sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createTempQueueRoles, deleteTempQueueRoles, manageRoles);
- Set<String> allRoles = new HashSet<String>();
- allRoles.addAll(createDurableQueue);
- allRoles.addAll(deleteDurableQueue);
- allRoles.addAll(createTempQueue);
- allRoles.addAll(deleteTempQueue);
- allRoles.addAll(send);
- allRoles.addAll(consume);
- allRoles.addAll(manage);
-
- Set<Role> roles = new HashSet<Role>();
- for (String role : allRoles)
- {
- roles.add(new Role(role,
- send.contains(role),
- consume.contains(role),
- createDurableQueue.contains(role),
- deleteDurableQueue.contains(role),
- createTempQueue.contains(role),
- deleteTempQueue.contains(role),
- manageRoles.contains(role)));
- }
-
server.getSecurityRepository().addMatch(addressMatch, roles );
}
finally
@@ -1122,6 +1075,7 @@
}
}
+
public void removeSecuritySettings(String addressMatch)
{
clearIO();
@@ -1184,6 +1138,32 @@
}
}
+ public String getAddressSettingsAsJSON(final String address) throws Exception
+ {
+ AddressSettings addressSettings = server.getAddressSettingsRepository().getMatch(address);
+ Map<String, Object> settings = new HashMap<String, Object>();
+ if(addressSettings.getDeadLetterAddress() != null)
+ {
+ settings.put("DLA", addressSettings.getDeadLetterAddress());
+ }
+ if(addressSettings.getExpiryAddress() != null)
+ {
+ settings.put("expiryAddress", addressSettings.getExpiryAddress());
+ }
+ settings.put("maxDeliveryAttempts", addressSettings.getMaxDeliveryAttempts());
+ settings.put("maxSizeBytes", addressSettings.getMaxSizeBytes());
+ settings.put("pageSizeBytes", addressSettings.getPageSizeBytes());
+ settings.put("redeliveryDelay", addressSettings.getRedeliveryDelay());
+ settings.put("redistributionDelay", addressSettings.getRedistributionDelay());
+ settings.put("lastValueQueue", addressSettings.isLastValueQueue());
+ settings.put("sendToDLAOnNoRoute", addressSettings.isSendToDLAOnNoRoute());
+ String policy = addressSettings.getAddressFullMessagePolicy() == AddressFullMessagePolicy.PAGE?"PAGE":addressSettings.getAddressFullMessagePolicy() == AddressFullMessagePolicy.BLOCK?"BLOCK":"DROP";
+ settings.put("addressFullMessagePolicy", policy);
+
+ JSONObject jsonObject = new JSONObject(settings);
+ return jsonObject.toString();
+ }
+
public void sendQueueInfoToQueue(final String queueName, final String address) throws Exception
{
clearIO();
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java 2010-03-16 18:24:13 UTC (rev 8928)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java 2010-03-16 21:50:12 UTC (rev 8929)
@@ -339,6 +339,11 @@
coreQueueControl.resume();
}
+ public String getSelector()
+ {
+ return coreQueueControl.getFilter();
+ }
+
@Override
public MBeanInfo getMBeanInfo()
{
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-03-16 18:24:13 UTC (rev 8928)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-03-16 21:50:12 UTC (rev 8929)
@@ -13,9 +13,7 @@
package org.hornetq.jms.management.impl;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.concurrent.atomic.AtomicLong;
import javax.management.ListenerNotFoundException;
@@ -29,14 +27,21 @@
import javax.management.StandardMBean;
import org.hornetq.api.core.Pair;
+import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.management.ManagementHelper;
+import org.hornetq.api.core.management.Parameter;
import org.hornetq.api.jms.management.ConnectionFactoryControl;
import org.hornetq.api.jms.management.JMSQueueControl;
import org.hornetq.api.jms.management.JMSServerControl;
import org.hornetq.api.jms.management.TopicControl;
import org.hornetq.core.management.impl.MBeanInfoHelper;
+import org.hornetq.core.security.Role;
+import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
+import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.jms.server.JMSServerManager;
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+import org.hornetq.utils.SecurityFormatter;
/**
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
@@ -367,6 +372,76 @@
return server.listSessions(connectionID);
}
+
+ public void addAddressSettings(final String address,
+ final String DLA,
+ final String expiryAddress,
+ final boolean lastValueQueue,
+ final int deliveryAttempts,
+ final long maxSizeBytes,
+ final int pageSizeBytes,
+ final long redeliveryDelay,
+ final long redistributionDelay,
+ final boolean sendToDLAOnNoRoute,
+ final String addressFullMessagePolicy) throws Exception
+ {
+ AddressSettings addressSettings = new AddressSettings();
+ addressSettings.setDeadLetterAddress(DLA == null?null:new SimpleString(DLA));
+ addressSettings.setExpiryAddress(expiryAddress == null?null:new SimpleString(expiryAddress));
+ addressSettings.setLastValueQueue(lastValueQueue);
+ addressSettings.setMaxDeliveryAttempts(deliveryAttempts);
+ addressSettings.setMaxSizeBytes(maxSizeBytes);
+ addressSettings.setPageSizeBytes(pageSizeBytes);
+ addressSettings.setRedeliveryDelay(redeliveryDelay);
+ addressSettings.setRedistributionDelay(redistributionDelay);
+ addressSettings.setSendToDLAOnNoRoute(sendToDLAOnNoRoute);
+ if(addressFullMessagePolicy == null)
+ {
+ addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
+ }
+ else if(addressFullMessagePolicy.equalsIgnoreCase("PAGE"))
+ {
+ addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
+ }
+ else if(addressFullMessagePolicy.equalsIgnoreCase("DROP"))
+ {
+ addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.DROP);
+ }
+ else if(addressFullMessagePolicy.equalsIgnoreCase("BLOCK"))
+ {
+ addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
+ }
+ server.addAddressSettings(address, addressSettings);
+ }
+
+ public AddressSettings getAddressSettings(final String address)
+ {
+ return server.getAddressSettings(address);
+ }
+
+ public String getAddressSettingsAsJSON(final String address) throws Exception
+ {
+ return server.getHornetQServer().getHornetQServerControl().getAddressSettingsAsJSON(address);
+ }
+
+ public void addSecuritySettings(final String addressMatch,
+ final String sendRoles,
+ final String consumeRoles,
+ final String createDurableQueueRoles,
+ final String deleteDurableQueueRoles,
+ final String createTempQueueRoles,
+ final String deleteTempQueueRoles,
+ final String manageRoles) throws Exception
+ {
+ Set<Role> roles = SecurityFormatter.createSecurity(sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createTempQueueRoles, deleteTempQueueRoles, manageRoles);
+ server.addSecurity(addressMatch, roles);
+ }
+
+ public void removeSecuritySettings(String addressMatch) throws Exception
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
@Override
public MBeanInfo getMBeanInfo()
{
@@ -403,4 +478,18 @@
CONNECTION_FACTORY_DESTROYED;
}
+ private static List<String> toList(final String commaSeparatedString)
+ {
+ List<String> list = new ArrayList<String>();
+ if (commaSeparatedString == null || commaSeparatedString.trim().length() == 0)
+ {
+ return list;
+ }
+ String[] values = commaSeparatedString.split(",");
+ for (int i = 0; i < values.length; i++)
+ {
+ list.add(values[i].trim());
+ }
+ return list;
+ }
}
Modified: trunk/src/main/org/hornetq/jms/server/JMSServerManager.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/JMSServerManager.java 2010-03-16 18:24:13 UTC (rev 8928)
+++ trunk/src/main/org/hornetq/jms/server/JMSServerManager.java 2010-03-16 21:50:12 UTC (rev 8929)
@@ -14,13 +14,16 @@
package org.hornetq.jms.server;
import java.util.List;
+import java.util.Set;
import javax.naming.Context;
import org.hornetq.api.core.Pair;
import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.core.security.Role;
import org.hornetq.core.server.HornetQComponent;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.jms.server.config.ConnectionFactoryConfiguration;
/**
@@ -230,4 +233,10 @@
void setContext(final Context context);
HornetQServer getHornetQServer();
+
+ void addAddressSettings(String address, AddressSettings addressSettings);
+
+ AddressSettings getAddressSettings(String address);
+
+ void addSecurity(String addressMatch, Set<Role> roles);
}
Modified: trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2010-03-16 18:24:13 UTC (rev 8928)
+++ trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2010-03-16 21:50:12 UTC (rev 8929)
@@ -13,12 +13,7 @@
package org.hornetq.jms.server.impl;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import javax.naming.Context;
import javax.naming.InitialContext;
@@ -40,8 +35,10 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.postoffice.Binding;
import org.hornetq.core.postoffice.BindingType;
+import org.hornetq.core.security.Role;
import org.hornetq.core.server.ActivateCallback;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.jms.client.HornetQConnectionFactory;
import org.hornetq.jms.client.HornetQDestination;
import org.hornetq.jms.client.SelectorTranslator;
@@ -244,6 +241,21 @@
return server;
}
+ public void addAddressSettings(final String address, final AddressSettings addressSettings)
+ {
+ server.getAddressSettingsRepository().addMatch(address, addressSettings);
+ }
+
+ public AddressSettings getAddressSettings(final String address)
+ {
+ return server.getAddressSettingsRepository().getMatch(address);
+ }
+
+ public void addSecurity(final String addressMatch, final Set<Role> roles)
+ {
+ server.getSecurityRepository().addMatch(addressMatch, roles);
+ }
+
public synchronized void setContext(final Context context)
{
this.context = context;
@@ -786,7 +798,6 @@
checkInitialised();
return server.getHornetQServerControl().listSessions(connectionID);
}
-
// Public --------------------------------------------------------
// Private -------------------------------------------------------
Added: trunk/src/main/org/hornetq/utils/SecurityFormatter.java
===================================================================
--- trunk/src/main/org/hornetq/utils/SecurityFormatter.java (rev 0)
+++ trunk/src/main/org/hornetq/utils/SecurityFormatter.java 2010-03-16 21:50:12 UTC (rev 8929)
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat 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.hornetq.utils;
+
+import org.hornetq.core.security.Role;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class SecurityFormatter
+{
+ public static Set<Role> createSecurity(String sendRoles, String consumeRoles, String createDurableQueueRoles, String deleteDurableQueueRoles, String createTempQueueRoles, String deleteTempQueueRoles, String manageRoles)
+ {
+ List<String> createDurableQueue = toList(createDurableQueueRoles);
+ List<String> deleteDurableQueue = toList(deleteDurableQueueRoles);
+ List<String> createTempQueue = toList(createTempQueueRoles);
+ List<String> deleteTempQueue = toList(deleteTempQueueRoles);
+ List<String> send = toList(sendRoles);
+ List<String> consume = toList(consumeRoles);
+ List<String> manage = toList(manageRoles);
+
+ Set<String> allRoles = new HashSet<String>();
+ allRoles.addAll(createDurableQueue);
+ allRoles.addAll(deleteDurableQueue);
+ allRoles.addAll(createTempQueue);
+ allRoles.addAll(deleteTempQueue);
+ allRoles.addAll(send);
+ allRoles.addAll(consume);
+ allRoles.addAll(manage);
+
+ Set<Role> roles = new HashSet<Role>();
+ for (String role : allRoles)
+ {
+ roles.add(new Role(role,
+ send.contains(role),
+ consume.contains(role),
+ createDurableQueue.contains(role),
+ deleteDurableQueue.contains(role),
+ createTempQueue.contains(role),
+ deleteTempQueue.contains(role),
+ manageRoles.contains(role)));
+ }
+ return roles;
+ }
+
+
+ private static List<String> toList(final String commaSeparatedString)
+ {
+ List<String> list = new ArrayList<String>();
+ if (commaSeparatedString == null || commaSeparatedString.trim().length() == 0)
+ {
+ return list;
+ }
+ String[] values = commaSeparatedString.split(",");
+ for (int i = 0; i < values.length; i++)
+ {
+ list.add(values[i].trim());
+ }
+ return list;
+ }
+}
Modified: trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java 2010-03-16 18:24:13 UTC (rev 8928)
+++ trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java 2010-03-16 21:50:12 UTC (rev 8929)
@@ -18,6 +18,7 @@
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.HornetQClient;
import org.hornetq.api.core.management.HornetQServerControl;
+import org.hornetq.api.core.management.Parameter;
import org.hornetq.api.core.management.ResourceNames;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
@@ -476,6 +477,11 @@
{
return (String)proxy.invokeOperation("getRolesAsJSON", addressMatch);
}
+
+ public String getAddressSettingsAsJSON(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception
+ {
+ return (String)proxy.invokeOperation("getAddressSettingsAsJSON", addressMatch);
+ }
};
}
// Package protected ---------------------------------------------
Modified: trunk/tests/src/org/hornetq/tests/unit/core/deployers/impl/QueueDeployerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/deployers/impl/QueueDeployerTest.java 2010-03-16 18:24:13 UTC (rev 8928)
+++ trunk/tests/src/org/hornetq/tests/unit/core/deployers/impl/QueueDeployerTest.java 2010-03-16 21:50:12 UTC (rev 8929)
@@ -19,6 +19,7 @@
import junit.framework.Assert;
import org.hornetq.api.core.management.HornetQServerControl;
+import org.hornetq.api.core.management.Parameter;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.CoreQueueConfiguration;
import org.hornetq.core.deployers.DeploymentManager;
@@ -586,6 +587,10 @@
return null;
}
+ public String getAddressSettingsAsJSON(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
}
}
14 years, 2 months
JBoss hornetq SVN: r8928 - trunk.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-03-16 14:24:13 -0400 (Tue, 16 Mar 2010)
New Revision: 8928
Modified:
trunk/build-maven.xml
Log:
Adding script to upload snapshots
Modified: trunk/build-maven.xml
===================================================================
--- trunk/build-maven.xml 2010-03-16 09:38:22 UTC (rev 8927)
+++ trunk/build-maven.xml 2010-03-16 18:24:13 UTC (rev 8928)
@@ -86,6 +86,29 @@
<param name="artifact.type" value="jar"/>
</antcall>
</target>
+
+
+ <target name="upload-snapshot">
+ <antcall target="uploadHornetQBootstrap"/>
+
+ <antcall target="uploadHornetQCore"/>
+
+ <antcall target="uploadHornetQLogging"/>
+
+ <antcall target="uploadHornetQTransports"/>
+
+ <antcall target="uploadHornetQCoreClient"/>
+
+ <antcall target="uploadHornetQJms"/>
+
+ <antcall target="uploadHornetQJmsClient"/>
+
+ <antcall target="uploadHornetQSecurity"/>
+
+ <antcall target="uploadHornetQRa"/>
+
+ <antcall target="uploadHornetQResources"/>
+ </target>
<target name="install">
@@ -144,8 +167,8 @@
<target name="upload">
<exec executable="mvn">
- <arg value="-s settings.xml"/>
<arg value="deploy:deploy-file"/>
+ <arg value="-e"/>
<arg value="-DgroupId=org.hornetq"/>
<arg value="-DartifactId=${artifact.id}"/>
<arg value="-Dversion=${hornetq.version}"/>
14 years, 2 months