[jboss-cvs] JBossAS SVN: r81065 - in trunk/messaging: src/etc/aspects and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Nov 14 10:09:17 EST 2008
Author: dimitris at jboss.org
Date: 2008-11-14 10:09:16 -0500 (Fri, 14 Nov 2008)
New Revision: 81065
Modified:
trunk/messaging/README.txt
trunk/messaging/pom.xml
trunk/messaging/src/etc/aspects/jboss-aop-messaging-client.xml
trunk/messaging/src/etc/aspects/jboss-aop-messaging-server.xml
trunk/messaging/src/etc/deploy/common/destinations-service.xml
trunk/messaging/src/etc/deploy/common/jms-ds.xml
trunk/messaging/src/etc/deploy/common/legacy-service.xml
trunk/messaging/src/etc/deploy/common/messaging-jboss-beans.xml
trunk/messaging/src/etc/deploy/common/messaging-roles.properties
trunk/messaging/src/etc/deploy/common/messaging-service.xml
trunk/messaging/src/etc/deploy/common/messaging-users.properties
trunk/messaging/src/etc/xmbean/ServerPeer-xmbean.xml
trunk/messaging/src/main/org/jboss/jms/server/destination/JBossMessagingCreateDestinationFactory.java
trunk/messaging/src/main/org/jboss/jms/server/destination/QueueServiceMO.java
trunk/messaging/src/main/org/jboss/jms/server/destination/TopicServiceMO.java
trunk/messaging/src/main/org/jboss/jms/server/jbosssx/JBossASSecurityMetadataStore.java
trunk/messaging/src/main/org/jboss/jms/server/jbosssx/JBossASSecurityMetadataStoreMBean.java
trunk/messaging/src/main/org/jboss/jms/server/jbosssx/MemorySecurityStore.java
trunk/messaging/src/main/org/jboss/jms/server/jbosssx/MemorySecurityStoreMBean.java
trunk/messaging/src/main/org/jboss/jms/server/jbosssx/SecurityActions.java
trunk/messaging/src/main/org/jboss/mq/server/jmx/DummyDestMgr.java
trunk/messaging/src/main/org/jboss/mq/server/jmx/DummyDestMgrMBean.java
trunk/messaging/src/main/org/jboss/mq/server/jmx/DummySecurityMgr.java
trunk/messaging/src/main/org/jboss/mq/server/jmx/DummySecurityMgrMBean.java
trunk/messaging/src/main/org/jboss/mq/server/jmx/Queue.java
trunk/messaging/src/main/org/jboss/mq/server/jmx/QueueMBean.java
trunk/messaging/src/main/org/jboss/mq/server/jmx/Topic.java
trunk/messaging/src/main/org/jboss/mq/server/jmx/TopicMBean.java
Log:
fix svn properties
Modified: trunk/messaging/README.txt
===================================================================
--- trunk/messaging/README.txt 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/README.txt 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,4 +1,4 @@
-$Id:$
+$Id$
The messaging project deals with integration of the JBoss Messaging code into
the JBossAS server.
Property changes on: trunk/messaging/README.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/messaging/pom.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/messaging/src/etc/aspects/jboss-aop-messaging-client.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/messaging/src/etc/aspects/jboss-aop-messaging-server.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/messaging/src/etc/deploy/common/destinations-service.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/etc/deploy/common/jms-ds.xml
===================================================================
--- trunk/messaging/src/etc/deploy/common/jms-ds.xml 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/etc/deploy/common/jms-ds.xml 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,36 +1,36 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<connection-factories>
-
- <!-- ==================================================================== -->
- <!-- JMS Stuff -->
- <!-- ==================================================================== -->
-
- <!--
- The JMS provider loader. Currently pointing to a non-clustered ConnectionFactory. Need to
- be replaced with a clustered non-load-balanced ConnectionFactory when it becomes available.
- See http://jira.jboss.org/jira/browse/JBMESSAGING-843.
- -->
- <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
- name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider">
- <attribute name="ProviderName">DefaultJMSProvider</attribute>
- <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
- <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
- <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
- <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
- </mbean>
-
- <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
- <tx-connection-factory>
- <jndi-name>JmsXA</jndi-name>
- <xa-transaction/>
- <rar-name>jms-ra.rar</rar-name>
- <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
- <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
- <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
- <max-pool-size>20</max-pool-size>
- <security-domain-and-application>JmsXARealm</security-domain-and-application>
- <depends>jboss.messaging:service=ServerPeer</depends>
- </tx-connection-factory>
-
-</connection-factories>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connection-factories>
+
+ <!-- ==================================================================== -->
+ <!-- JMS Stuff -->
+ <!-- ==================================================================== -->
+
+ <!--
+ The JMS provider loader. Currently pointing to a non-clustered ConnectionFactory. Need to
+ be replaced with a clustered non-load-balanced ConnectionFactory when it becomes available.
+ See http://jira.jboss.org/jira/browse/JBMESSAGING-843.
+ -->
+ <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
+ name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider">
+ <attribute name="ProviderName">DefaultJMSProvider</attribute>
+ <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
+ <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
+ <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
+ <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
+ </mbean>
+
+ <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
+ <tx-connection-factory>
+ <jndi-name>JmsXA</jndi-name>
+ <xa-transaction/>
+ <rar-name>jms-ra.rar</rar-name>
+ <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
+ <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
+ <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
+ <max-pool-size>20</max-pool-size>
+ <security-domain-and-application>JmsXARealm</security-domain-and-application>
+ <depends>jboss.messaging:service=ServerPeer</depends>
+ </tx-connection-factory>
+
+</connection-factories>
Property changes on: trunk/messaging/src/etc/deploy/common/jms-ds.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/messaging/src/etc/deploy/common/legacy-service.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/etc/deploy/common/messaging-jboss-beans.xml
===================================================================
--- trunk/messaging/src/etc/deploy/common/messaging-jboss-beans.xml 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/etc/deploy/common/messaging-jboss-beans.xml 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,60 +1,60 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Messaging beans
- $Id: messaging-beans.xml 68282 2007-12-14 13:43:52Z alex.loubyansky at jboss.com $
--->
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <!-- messaging application-policy definition -->
- <application-policy xmlns="urn:jboss:security-beans:1.0" name="messaging">
- <authentication>
- <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
- <module-option name="unauthenticatedIdentity">guest</module-option>
- <module-option name="dsJndiName">java:/DefaultDS</module-option>
- <module-option name="principalsQuery">SELECT PASSWD FROM JBM_USER WHERE USER_ID=?</module-option>
- <module-option name="rolesQuery">SELECT ROLE_ID, 'Roles' FROM JBM_ROLE WHERE USER_ID=?</module-option>
- </login-module>
- </authentication>
- </application-policy>
-
- <bean name="SecurityStore" class="org.jboss.jms.server.jbosssx.JBossASSecurityMetadataStore">
- <!-- default security configuration -->
- <property name="defaultSecurityConfig">
- <![CDATA[
- <security>
- <role name="guest" read="true" write="true" create="true"/>
- </security>
- ]]>
- </property>
- <property name="suckerPassword">CHANGE ME!!</property>
- <property name="securityDomain">messaging</property>
- <property name="securityManagement"><inject bean="JNDIBasedSecurityManagement"/></property>
- <!-- @JMX annotation to export the management view of this bean -->
- <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.messaging:service=SecurityStore",exposedInterface=org.jboss.jms.server.jbosssx.JBossASSecurityMetadataStoreMBean.class)</annotation>
- </bean>
-
- <bean name="QueueTemplate" class="org.jboss.profileservice.management.templates.JmsDestinationTemplate">
- <property name="info"><inject bean="QueueTemplateInfo"/></property>
- </bean>
- <bean name="QueueTemplateInfo"
- class="org.jboss.profileservice.management.templates.JmsDestinationTemplateInfo">
- <constructor>
- <parameter>QueueTemplate</parameter>
- <parameter>A template for JMS queue *-service.xml deployments</parameter>
- <parameter>queue</parameter>
- </constructor>
- </bean>
-
- <bean name="TopicTemplate" class="org.jboss.profileservice.management.templates.JmsDestinationTemplate">
- <property name="info"><inject bean="TopicTemplateInfo"/></property>
- </bean>
- <bean name="TopicTemplateInfo"
- class="org.jboss.profileservice.management.templates.JmsDestinationTemplateInfo">
- <constructor>
- <parameter>TopicTemplate</parameter>
- <parameter>A template for JMS topic *-service.xml deployments</parameter>
- <parameter>topic</parameter>
- </constructor>
- </bean>
-</deployment>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Messaging beans
+ $Id: messaging-beans.xml 68282 2007-12-14 13:43:52Z alex.loubyansky at jboss.com $
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- messaging application-policy definition -->
+ <application-policy xmlns="urn:jboss:security-beans:1.0" name="messaging">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
+ <module-option name="unauthenticatedIdentity">guest</module-option>
+ <module-option name="dsJndiName">java:/DefaultDS</module-option>
+ <module-option name="principalsQuery">SELECT PASSWD FROM JBM_USER WHERE USER_ID=?</module-option>
+ <module-option name="rolesQuery">SELECT ROLE_ID, 'Roles' FROM JBM_ROLE WHERE USER_ID=?</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <bean name="SecurityStore" class="org.jboss.jms.server.jbosssx.JBossASSecurityMetadataStore">
+ <!-- default security configuration -->
+ <property name="defaultSecurityConfig">
+ <![CDATA[
+ <security>
+ <role name="guest" read="true" write="true" create="true"/>
+ </security>
+ ]]>
+ </property>
+ <property name="suckerPassword">CHANGE ME!!</property>
+ <property name="securityDomain">messaging</property>
+ <property name="securityManagement"><inject bean="JNDIBasedSecurityManagement"/></property>
+ <!-- @JMX annotation to export the management view of this bean -->
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.messaging:service=SecurityStore",exposedInterface=org.jboss.jms.server.jbosssx.JBossASSecurityMetadataStoreMBean.class)</annotation>
+ </bean>
+
+ <bean name="QueueTemplate" class="org.jboss.profileservice.management.templates.JmsDestinationTemplate">
+ <property name="info"><inject bean="QueueTemplateInfo"/></property>
+ </bean>
+ <bean name="QueueTemplateInfo"
+ class="org.jboss.profileservice.management.templates.JmsDestinationTemplateInfo">
+ <constructor>
+ <parameter>QueueTemplate</parameter>
+ <parameter>A template for JMS queue *-service.xml deployments</parameter>
+ <parameter>queue</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="TopicTemplate" class="org.jboss.profileservice.management.templates.JmsDestinationTemplate">
+ <property name="info"><inject bean="TopicTemplateInfo"/></property>
+ </bean>
+ <bean name="TopicTemplateInfo"
+ class="org.jboss.profileservice.management.templates.JmsDestinationTemplateInfo">
+ <constructor>
+ <parameter>TopicTemplate</parameter>
+ <parameter>A template for JMS topic *-service.xml deployments</parameter>
+ <parameter>topic</parameter>
+ </constructor>
+ </bean>
+</deployment>
Property changes on: trunk/messaging/src/etc/deploy/common/messaging-jboss-beans.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/etc/deploy/common/messaging-roles.properties
===================================================================
--- trunk/messaging/src/etc/deploy/common/messaging-roles.properties 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/etc/deploy/common/messaging-roles.properties 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,4 +1,4 @@
-#
-# user=role1,role2,...
-#
-guest=guest
+#
+# user=role1,role2,...
+#
+guest=guest
Property changes on: trunk/messaging/src/etc/deploy/common/messaging-roles.properties
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/messaging/src/etc/deploy/common/messaging-service.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/etc/deploy/common/messaging-users.properties
===================================================================
--- trunk/messaging/src/etc/deploy/common/messaging-users.properties 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/etc/deploy/common/messaging-users.properties 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,4 +1,4 @@
-#
-# user=password
-#
-guest=guest
+#
+# user=password
+#
+guest=guest
Property changes on: trunk/messaging/src/etc/deploy/common/messaging-users.properties
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/messaging/src/etc/xmbean/ServerPeer-xmbean.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/jms/server/destination/JBossMessagingCreateDestinationFactory.java
===================================================================
--- trunk/messaging/src/main/org/jboss/jms/server/destination/JBossMessagingCreateDestinationFactory.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/jms/server/destination/JBossMessagingCreateDestinationFactory.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,215 +1,215 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.jms.server.destination;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.jms.Queue;
-import javax.jms.Topic;
-import javax.management.ObjectName;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.ejb.deployers.CreateDestinationFactory;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.ejb.jboss.JBossMessageDrivenBeanMetaData;
-import org.jboss.metadata.ejb.spec.ActivationConfigMetaData;
-import org.jboss.metadata.ejb.spec.ActivationConfigPropertiesMetaData;
-import org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData;
-import org.jboss.mx.util.ObjectNameFactory;
-import org.jboss.system.metadata.ServiceAttributeMetaData;
-import org.jboss.system.metadata.ServiceConstructorMetaData;
-import org.jboss.system.metadata.ServiceDependencyMetaData;
-import org.jboss.system.metadata.ServiceMetaData;
-import org.jboss.system.metadata.ServiceTextValueMetaData;
-
-/**
- * JBossMessagingCreateDestinationFactory.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public class JBossMessagingCreateDestinationFactory implements CreateDestinationFactory
-{
- /** The log */
- private static final Logger log = Logger.getLogger(JBossMessagingCreateDestinationFactory.class);
-
- /** The server peer name */
- private String serverPeerName;
-
- /** The post office name */
- private String postOfficeName;
-
- /**
- * Get the serverPeerName.
- *
- * @return the serverPeerName.
- */
- public String getServerPeerName()
- {
- return serverPeerName;
- }
-
- /**
- * Set the serverPeerName.
- *
- * @param serverPeerName the serverPeerName.
- */
- public void setServerPeerName(String serverPeerName)
- {
- this.serverPeerName = serverPeerName;
- }
-
- /**
- * Get the postOfficeName.
- *
- * @return the postOfficeName.
- */
- public String getPostOfficeName()
- {
- return postOfficeName;
- }
-
- /**
- * Set the postOfficeName.
- *
- * @param postOfficeName the postOfficeName.
- */
- public void setPostOfficeName(String postOfficeName)
- {
- this.postOfficeName = postOfficeName;
- }
-
- public void create()
- {
- if (serverPeerName == null)
- throw new IllegalStateException("serverPeerName has not been set");
- if (postOfficeName == null)
- throw new IllegalStateException("postOfficeName has not been set");
- }
-
- public Object create(DeploymentUnit unit, JBossMessageDrivenBeanMetaData mdb) throws DeploymentException
- {
- String destinationName = null;
- String destinationType = null;
-
- ActivationConfigMetaData activationConfig = mdb.getActivationConfig();
- if (activationConfig != null)
- {
- ActivationConfigPropertiesMetaData properties = activationConfig.getActivationConfigProperties();
- if (properties != null)
- {
- destinationName = getActivationConfigProperty(properties, "destination");
- destinationType = getActivationConfigProperty(properties, "destinationType");
- }
- }
-
- // TODO message-destination-link?
-
- if (destinationName == null || destinationName.trim().length() == 0)
- {
- log.warn("Unable to determine destination for " + mdb.getName());
- return null;
- }
- boolean isTopic = false;
- if (destinationType == null)
- {
- log.warn("Unable to determine destination type for " + mdb.getName());
- return null;
- }
- else if (destinationType.equals(Queue.class.getName()))
- {
- // Its a queue
- }
- else if (destinationType.equals(Topic.class.getName()))
- {
- isTopic = true;
- }
- else
- {
- log.warn("Unknown destination type '" + destinationType + "' for " + mdb.getName());
- return null;
- }
-
- ServiceMetaData result = new ServiceMetaData();
- result.setConstructor(new ServiceConstructorMetaData());
- ObjectName objectName;
- if (isTopic)
- {
- objectName = ObjectNameFactory.create("jboss.messaging.destination:service=Topic,name=" + destinationName);
- result.setCode("org.jboss.jms.server.destination.TopicService");
- result.setXMBeanDD("xmdesc/Topic-xmbean.xml");
- }
- else
- {
- objectName = ObjectNameFactory.create("jboss.messaging.destination:service=Queue,name=" + destinationName);
- result.setCode("org.jboss.jms.server.destination.QueueService");
- result.setXMBeanDD("xmdesc/Queue-xmbean.xml");
- }
- result.setObjectName(objectName);
-
- ServiceAttributeMetaData attribute = new ServiceAttributeMetaData();
- attribute.setName("JNDIName");
- attribute.setValue(new ServiceTextValueMetaData(destinationName));
- result.addAttribute(attribute);
-
- attribute = new ServiceAttributeMetaData();
- attribute.setName("ServerPeer");
- attribute.setValue(new ServiceTextValueMetaData(serverPeerName));
- result.addAttribute(attribute);
-
- ServiceDependencyMetaData dependency = new ServiceDependencyMetaData();
- dependency.setIDependOn(serverPeerName);
- result.addDependency(dependency);
-
- dependency = new ServiceDependencyMetaData();
- dependency.setIDependOn(postOfficeName);
- result.addDependency(dependency);
-
- // Add this mbean to the mdbs depends
- Set<String> depends = mdb.getDepends();
- if (depends == null)
- {
- depends = new HashSet<String>();
- mdb.setDepends(depends);
- }
- depends.add(objectName.getCanonicalName());
-
- return result;
- }
-
- /**
- * Get an activation config property
- *
- * @param properties the properties
- * @param name the name
- * @return the property or null if not found
- */
- protected static String getActivationConfigProperty(ActivationConfigPropertiesMetaData properties, String name)
- {
- ActivationConfigPropertyMetaData property = properties.get(name);
- if (property == null)
- return null;
- return property.getValue();
- }
-}
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.jms.server.destination;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.jms.Queue;
+import javax.jms.Topic;
+import javax.management.ObjectName;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.ejb.deployers.CreateDestinationFactory;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ejb.jboss.JBossMessageDrivenBeanMetaData;
+import org.jboss.metadata.ejb.spec.ActivationConfigMetaData;
+import org.jboss.metadata.ejb.spec.ActivationConfigPropertiesMetaData;
+import org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData;
+import org.jboss.mx.util.ObjectNameFactory;
+import org.jboss.system.metadata.ServiceAttributeMetaData;
+import org.jboss.system.metadata.ServiceConstructorMetaData;
+import org.jboss.system.metadata.ServiceDependencyMetaData;
+import org.jboss.system.metadata.ServiceMetaData;
+import org.jboss.system.metadata.ServiceTextValueMetaData;
+
+/**
+ * JBossMessagingCreateDestinationFactory.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossMessagingCreateDestinationFactory implements CreateDestinationFactory
+{
+ /** The log */
+ private static final Logger log = Logger.getLogger(JBossMessagingCreateDestinationFactory.class);
+
+ /** The server peer name */
+ private String serverPeerName;
+
+ /** The post office name */
+ private String postOfficeName;
+
+ /**
+ * Get the serverPeerName.
+ *
+ * @return the serverPeerName.
+ */
+ public String getServerPeerName()
+ {
+ return serverPeerName;
+ }
+
+ /**
+ * Set the serverPeerName.
+ *
+ * @param serverPeerName the serverPeerName.
+ */
+ public void setServerPeerName(String serverPeerName)
+ {
+ this.serverPeerName = serverPeerName;
+ }
+
+ /**
+ * Get the postOfficeName.
+ *
+ * @return the postOfficeName.
+ */
+ public String getPostOfficeName()
+ {
+ return postOfficeName;
+ }
+
+ /**
+ * Set the postOfficeName.
+ *
+ * @param postOfficeName the postOfficeName.
+ */
+ public void setPostOfficeName(String postOfficeName)
+ {
+ this.postOfficeName = postOfficeName;
+ }
+
+ public void create()
+ {
+ if (serverPeerName == null)
+ throw new IllegalStateException("serverPeerName has not been set");
+ if (postOfficeName == null)
+ throw new IllegalStateException("postOfficeName has not been set");
+ }
+
+ public Object create(DeploymentUnit unit, JBossMessageDrivenBeanMetaData mdb) throws DeploymentException
+ {
+ String destinationName = null;
+ String destinationType = null;
+
+ ActivationConfigMetaData activationConfig = mdb.getActivationConfig();
+ if (activationConfig != null)
+ {
+ ActivationConfigPropertiesMetaData properties = activationConfig.getActivationConfigProperties();
+ if (properties != null)
+ {
+ destinationName = getActivationConfigProperty(properties, "destination");
+ destinationType = getActivationConfigProperty(properties, "destinationType");
+ }
+ }
+
+ // TODO message-destination-link?
+
+ if (destinationName == null || destinationName.trim().length() == 0)
+ {
+ log.warn("Unable to determine destination for " + mdb.getName());
+ return null;
+ }
+ boolean isTopic = false;
+ if (destinationType == null)
+ {
+ log.warn("Unable to determine destination type for " + mdb.getName());
+ return null;
+ }
+ else if (destinationType.equals(Queue.class.getName()))
+ {
+ // Its a queue
+ }
+ else if (destinationType.equals(Topic.class.getName()))
+ {
+ isTopic = true;
+ }
+ else
+ {
+ log.warn("Unknown destination type '" + destinationType + "' for " + mdb.getName());
+ return null;
+ }
+
+ ServiceMetaData result = new ServiceMetaData();
+ result.setConstructor(new ServiceConstructorMetaData());
+ ObjectName objectName;
+ if (isTopic)
+ {
+ objectName = ObjectNameFactory.create("jboss.messaging.destination:service=Topic,name=" + destinationName);
+ result.setCode("org.jboss.jms.server.destination.TopicService");
+ result.setXMBeanDD("xmdesc/Topic-xmbean.xml");
+ }
+ else
+ {
+ objectName = ObjectNameFactory.create("jboss.messaging.destination:service=Queue,name=" + destinationName);
+ result.setCode("org.jboss.jms.server.destination.QueueService");
+ result.setXMBeanDD("xmdesc/Queue-xmbean.xml");
+ }
+ result.setObjectName(objectName);
+
+ ServiceAttributeMetaData attribute = new ServiceAttributeMetaData();
+ attribute.setName("JNDIName");
+ attribute.setValue(new ServiceTextValueMetaData(destinationName));
+ result.addAttribute(attribute);
+
+ attribute = new ServiceAttributeMetaData();
+ attribute.setName("ServerPeer");
+ attribute.setValue(new ServiceTextValueMetaData(serverPeerName));
+ result.addAttribute(attribute);
+
+ ServiceDependencyMetaData dependency = new ServiceDependencyMetaData();
+ dependency.setIDependOn(serverPeerName);
+ result.addDependency(dependency);
+
+ dependency = new ServiceDependencyMetaData();
+ dependency.setIDependOn(postOfficeName);
+ result.addDependency(dependency);
+
+ // Add this mbean to the mdbs depends
+ Set<String> depends = mdb.getDepends();
+ if (depends == null)
+ {
+ depends = new HashSet<String>();
+ mdb.setDepends(depends);
+ }
+ depends.add(objectName.getCanonicalName());
+
+ return result;
+ }
+
+ /**
+ * Get an activation config property
+ *
+ * @param properties the properties
+ * @param name the name
+ * @return the property or null if not found
+ */
+ protected static String getActivationConfigProperty(ActivationConfigPropertiesMetaData properties, String name)
+ {
+ ActivationConfigPropertyMetaData property = properties.get(name);
+ if (property == null)
+ return null;
+ return property.getValue();
+ }
+}
Property changes on: trunk/messaging/src/main/org/jboss/jms/server/destination/JBossMessagingCreateDestinationFactory.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/jms/server/destination/QueueServiceMO.java
===================================================================
--- trunk/messaging/src/main/org/jboss/jms/server/destination/QueueServiceMO.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/jms/server/destination/QueueServiceMO.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,183 +1,183 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jms.server.destination;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.management.ObjectName;
-
-import org.jboss.jms.server.messagecounter.MessageCounter;
-import org.jboss.jms.server.messagecounter.MessageStatistics;
-import org.jboss.managed.api.ManagedOperation.Impact;
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementOperation;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ViewUse;
-import org.w3c.dom.Element;
-
-/**
- * Empty class to provide the management metadata for JBoss Messaging
- * org.jboss.jms.server.destination.QueueService, when deployed in AS5.
- *
- * @see {@linkplain org.jboss.jms.server.destination.QueueService}
- *
- * @author Dimitris.Andreadis at jboss.org
- * @version $Revision:$
- */
- at ManagementObject(
- componentType = @ManagementComponent(type = "JMSDestination", subtype = "Queue"),
- properties = ManagementProperties.EXPLICIT)
-public class QueueServiceMO implements Serializable
-{
- private static final long serialVersionUID = 8483702123881698540L;
-
-// Management Properties
-
- @ManagementProperty(use={ViewUse.RUNTIME}, description="The destination name")
- public String getName() { return null; }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The destination's JNDI name")
- @ManagementObjectID(type="Queue")
- public String getJNDIName() { return null; }
- public void setJNDIName(String arg0) throws Exception { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The ObjectName of the server peer this destination was deployed on")
- public ObjectName getServerPeer() { return null; }
- public void setServerPeer(ObjectName arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The DLQ for this queue, overrides the default DLQ on the server peer")
- public ObjectName getDLQ() { return null; }
- public void setDLQ(ObjectName arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The expiry queue for this queue, overrides the default expiry queue on the server peer")
- public ObjectName getExpiryQueue() { return null; }
- public void setExpiryQueue(ObjectName arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The delay before redelivering")
- public long getRedeliveryDelay() { return 0; }
- public void setRedeliveryDelay(long arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The destination's security configuration")
- public Element getSecurityConfig() { return null; }
- public void setSecurityConfig(Element arg0) { }
-
- @ManagementProperty(use={ViewUse.RUNTIME}, description="True if this destination was created programmatically")
- public boolean isCreatedProgrammatically() { return false; }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="The number of messages in the queue")
- public int getMessageCount() { return 0; }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="The number of messages currently being delivered")
- public int getDeliveringCount() { return 0; }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="The number of scheduled messages in the queue")
- public int getScheduledMessageCount() { return 0; }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The maximum number of messages this queue can hold before they are dropped")
- public int getMaxSize() { return 0; }
- public void setMaxSize(int arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The in-memory message limit, can only be set when queue is stopped")
- public int getFullSize() { return 0; }
- public void setFullSize(int arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The paging size, can only be set when queue is stopped")
- public int getPageSize() { return 0; }
- public void setPageSize(int arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The write-cache size, can only be set when queue is stopped")
- public int getDownCacheSize() { return 0; }
- public void setDownCacheSize(int arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="Is this a clustered destination?")
- public boolean isClustered() { return false; }
- public void setClustered(boolean arg0) { }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="Get the message counter for the queue")
- public MessageCounter getMessageCounter() { return null; }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="Get the message statistics for the queue")
- public MessageStatistics getMessageStatistics() { return null; }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The day limit for the message counter")
- public int getMessageCounterHistoryDayLimit() { return 0; }
- public void setMessageCounterHistoryDayLimit(int arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The maximum delivery attempts to the queue")
- public int getMaxDeliveryAttempts() { return 0; }
- public void setMaxDeliveryAttempts(int arg0) { }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="The number of consumers on the queue")
- public int getConsumerCount() { return 0; }
-
- // Management Operations
-
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void create() throws Exception { }
-
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void start() throws Exception { }
-
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void stop() { }
-
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void destroy() { }
-
- @ManagementOperation(description = "Remove all messages in the queue", impact = Impact.WriteOnly)
- public void removeAllMessages() throws Exception { }
-
- @ManagementOperation(description = "List all messages", impact = Impact.ReadOnly)
- public List listAllMessages() throws Exception { return null; }
-
- @ManagementOperation(description = "List all messages with selector", impact = Impact.ReadOnly)
- public List listAllMessages(String selector) throws Exception { return null; }
-
- @ManagementOperation(description = "List all durable mesages", impact = Impact.ReadOnly)
- public List listDurableMessages() throws Exception { return null; }
-
- @ManagementOperation(description = "List all durable mesages using a selector", impact = Impact.ReadOnly)
- public List listDurableMessages(String selector) throws Exception { return null; }
-
- @ManagementOperation(description = "List all non durable mesages", impact = Impact.ReadOnly)
- public List listNonDurableMessages() throws Exception { return null; }
-
- @ManagementOperation(description = "List all non durable mesages using a selector", impact = Impact.ReadOnly)
- public List listNonDurableMessages(String selector) throws Exception { return null; }
-
- @ManagementOperation(description = "Reset the message counter", impact = Impact.WriteOnly)
- public void resetMessageCounter() throws Exception { }
-
- @ManagementOperation(description = "Reset the message counter history", impact = Impact.WriteOnly)
- public void resetMessageCounterHistory() throws Exception { }
-
- @ManagementOperation(description = "Get the message counter as HTML", impact = Impact.ReadOnly)
- public String listMessageCounterAsHTML() throws Exception { return null; }
-
- @ManagementOperation(description = "Get the message counter history as HTML", impact = Impact.ReadOnly)
- public String listMessageCounterHistoryAsHTML() throws Exception { return null; }
-
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.server.destination;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jboss.jms.server.messagecounter.MessageCounter;
+import org.jboss.jms.server.messagecounter.MessageStatistics;
+import org.jboss.managed.api.ManagedOperation.Impact;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.api.annotation.ManagementOperation;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.managed.api.annotation.ViewUse;
+import org.w3c.dom.Element;
+
+/**
+ * Empty class to provide the management metadata for JBoss Messaging
+ * org.jboss.jms.server.destination.QueueService, when deployed in AS5.
+ *
+ * @see {@linkplain org.jboss.jms.server.destination.QueueService}
+ *
+ * @author Dimitris.Andreadis at jboss.org
+ * @version $Revision:$
+ */
+ at ManagementObject(
+ componentType = @ManagementComponent(type = "JMSDestination", subtype = "Queue"),
+ properties = ManagementProperties.EXPLICIT)
+public class QueueServiceMO implements Serializable
+{
+ private static final long serialVersionUID = 8483702123881698540L;
+
+// Management Properties
+
+ @ManagementProperty(use={ViewUse.RUNTIME}, description="The destination name")
+ public String getName() { return null; }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The destination's JNDI name")
+ @ManagementObjectID(type="Queue")
+ public String getJNDIName() { return null; }
+ public void setJNDIName(String arg0) throws Exception { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The ObjectName of the server peer this destination was deployed on")
+ public ObjectName getServerPeer() { return null; }
+ public void setServerPeer(ObjectName arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The DLQ for this queue, overrides the default DLQ on the server peer")
+ public ObjectName getDLQ() { return null; }
+ public void setDLQ(ObjectName arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The expiry queue for this queue, overrides the default expiry queue on the server peer")
+ public ObjectName getExpiryQueue() { return null; }
+ public void setExpiryQueue(ObjectName arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The delay before redelivering")
+ public long getRedeliveryDelay() { return 0; }
+ public void setRedeliveryDelay(long arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The destination's security configuration")
+ public Element getSecurityConfig() { return null; }
+ public void setSecurityConfig(Element arg0) { }
+
+ @ManagementProperty(use={ViewUse.RUNTIME}, description="True if this destination was created programmatically")
+ public boolean isCreatedProgrammatically() { return false; }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="The number of messages in the queue")
+ public int getMessageCount() { return 0; }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="The number of messages currently being delivered")
+ public int getDeliveringCount() { return 0; }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="The number of scheduled messages in the queue")
+ public int getScheduledMessageCount() { return 0; }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The maximum number of messages this queue can hold before they are dropped")
+ public int getMaxSize() { return 0; }
+ public void setMaxSize(int arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The in-memory message limit, can only be set when queue is stopped")
+ public int getFullSize() { return 0; }
+ public void setFullSize(int arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The paging size, can only be set when queue is stopped")
+ public int getPageSize() { return 0; }
+ public void setPageSize(int arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The write-cache size, can only be set when queue is stopped")
+ public int getDownCacheSize() { return 0; }
+ public void setDownCacheSize(int arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="Is this a clustered destination?")
+ public boolean isClustered() { return false; }
+ public void setClustered(boolean arg0) { }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="Get the message counter for the queue")
+ public MessageCounter getMessageCounter() { return null; }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="Get the message statistics for the queue")
+ public MessageStatistics getMessageStatistics() { return null; }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The day limit for the message counter")
+ public int getMessageCounterHistoryDayLimit() { return 0; }
+ public void setMessageCounterHistoryDayLimit(int arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The maximum delivery attempts to the queue")
+ public int getMaxDeliveryAttempts() { return 0; }
+ public void setMaxDeliveryAttempts(int arg0) { }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="The number of consumers on the queue")
+ public int getConsumerCount() { return 0; }
+
+ // Management Operations
+
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void create() throws Exception { }
+
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void start() throws Exception { }
+
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void stop() { }
+
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void destroy() { }
+
+ @ManagementOperation(description = "Remove all messages in the queue", impact = Impact.WriteOnly)
+ public void removeAllMessages() throws Exception { }
+
+ @ManagementOperation(description = "List all messages", impact = Impact.ReadOnly)
+ public List listAllMessages() throws Exception { return null; }
+
+ @ManagementOperation(description = "List all messages with selector", impact = Impact.ReadOnly)
+ public List listAllMessages(String selector) throws Exception { return null; }
+
+ @ManagementOperation(description = "List all durable mesages", impact = Impact.ReadOnly)
+ public List listDurableMessages() throws Exception { return null; }
+
+ @ManagementOperation(description = "List all durable mesages using a selector", impact = Impact.ReadOnly)
+ public List listDurableMessages(String selector) throws Exception { return null; }
+
+ @ManagementOperation(description = "List all non durable mesages", impact = Impact.ReadOnly)
+ public List listNonDurableMessages() throws Exception { return null; }
+
+ @ManagementOperation(description = "List all non durable mesages using a selector", impact = Impact.ReadOnly)
+ public List listNonDurableMessages(String selector) throws Exception { return null; }
+
+ @ManagementOperation(description = "Reset the message counter", impact = Impact.WriteOnly)
+ public void resetMessageCounter() throws Exception { }
+
+ @ManagementOperation(description = "Reset the message counter history", impact = Impact.WriteOnly)
+ public void resetMessageCounterHistory() throws Exception { }
+
+ @ManagementOperation(description = "Get the message counter as HTML", impact = Impact.ReadOnly)
+ public String listMessageCounterAsHTML() throws Exception { return null; }
+
+ @ManagementOperation(description = "Get the message counter history as HTML", impact = Impact.ReadOnly)
+ public String listMessageCounterHistoryAsHTML() throws Exception { return null; }
+
}
\ No newline at end of file
Property changes on: trunk/messaging/src/main/org/jboss/jms/server/destination/QueueServiceMO.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/jms/server/destination/TopicServiceMO.java
===================================================================
--- trunk/messaging/src/main/org/jboss/jms/server/destination/TopicServiceMO.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/jms/server/destination/TopicServiceMO.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,190 +1,190 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jms.server.destination;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.management.ObjectName;
-
-import org.jboss.managed.api.ManagedOperation.Impact;
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementOperation;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ViewUse;
-import org.w3c.dom.Element;
-
-/**
- * Empty class to provide the management metadata for JBoss Messaging
- * org.jboss.jms.server.destination.TopicService, when deployed in AS5.
- *
- * @see {@linkplain org.jboss.jms.server.destination.TopicService}
- *
- * @author Dimitris.Andreadis at jboss.org
- * @version $Revision:$
- */
- at ManagementObject(
- componentType = @ManagementComponent(type = "JMSDestination", subtype = "Topic"),
- properties = ManagementProperties.EXPLICIT)
-public class TopicServiceMO implements Serializable
-{
- private static final long serialVersionUID = -2972719964517681496L;
-
- // Management Properties
-
- @ManagementProperty(use={ViewUse.RUNTIME}, description="The destination name")
- public String getName() { return null; }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The destination's JNDI name")
- @ManagementObjectID(type="Topic")
- public String getJNDIName() { return null; }
- public void setJNDIName(String arg0) throws Exception { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The ObjectName of the server peer this destination was deployed on")
- public ObjectName getServerPeer() { return null; }
- public void setServerPeer(ObjectName arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The DLQ for this topic, overrides the default DLQ on the server peer")
- public ObjectName getDLQ() { return null; }
- public void setDLQ(ObjectName arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The expiry queue for this topic, overrides the default expiry queue on the server peer")
- public ObjectName getExpiryQueue() { return null; }
- public void setExpiryQueue(ObjectName arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The delay before redelivering")
- public long getRedeliveryDelay() { return 0; }
- public void setRedeliveryDelay(long arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The destination's security configuration")
- public Element getSecurityConfig() { return null; }
- public void setSecurityConfig(Element arg0) { }
-
- @ManagementProperty(use={ViewUse.RUNTIME}, description="True if this destination was created programmatically")
- public boolean isCreatedProgrammatically() { return false; }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The maximum number of messages this topic can hold before they are dropped")
- public int getMaxSize() { return 0; }
- public void setMaxSize(int arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The in-memory message limit, can only be set when topic is stopped")
- public int getFullSize() { return 0; }
- public void setFullSize(int arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The paging size, can only be set when topic is stopped")
- public int getPageSize() { return 0; }
- public void setPageSize(int arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The write-cache size, can only be set when topic is stopped")
- public int getDownCacheSize() { return 0; }
- public void setDownCacheSize(int arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="Is this a clustered destination?")
- public boolean isClustered() { return false; }
- public void setClustered(boolean arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The day limit for the message counter")
- public int getMessageCounterHistoryDayLimit() { return 0; }
- public void setMessageCounterHistoryDayLimit(int arg0) { }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The maximum delivery attempts to the topic")
- public int getMaxDeliveryAttempts() { return 0; }
- public void setMaxDeliveryAttempts(int arg0) { }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="The message counters for the topic")
- public List getMessageCounters() { return null; }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="The count of all messages in all subscriptions of this topic")
- public int getAllMessageCount() { return 0; }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="The count of all messages in all durable subscriptions of this topic")
- public int getDurableMessageCount() { return 0; }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="The count of all messages in all non durable subscriptions of this topic")
- public int getNonDurableMessageCount() { return 0; }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="The count of all subscriptions of this topic")
- public int getAllSubscriptionsCount() { return 0; }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="The count of all durable subscriptions of this topic")
- public int getDurableSubscriptionsCount() { return 0; }
-
- @ManagementProperty(use={ViewUse.STATISTIC}, description="The count of all non durable subscriptions of this topic")
- public int getNonDurableSubscriptionsCount() { return 0; }
-
- // Management Operations
-
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void create() throws Exception { }
-
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void start() throws Exception { }
-
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void stop() { }
-
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void destroy() { }
-
- @ManagementOperation(description = "Remove all messages", impact = Impact.WriteOnly)
- public void removeAllMessages() throws Exception { }
-
- @ManagementOperation(description = "Return all subscriptions for the topic", impact = Impact.ReadOnly)
- public List listAllSubscriptions() throws Exception { return null; }
-
- @ManagementOperation(description = "Return all durable subscriptions for the topic", impact = Impact.ReadOnly)
- public List listDurableSubscriptions() throws Exception { return null; }
-
- @ManagementOperation(description = "Return all non durable subscriptions for the topic", impact = Impact.ReadOnly)
- public List listNonDurableSubscriptions() throws Exception { return null; }
-
- @ManagementOperation(description = "Return all subscriptions for the topic in HTML", impact = Impact.ReadOnly)
- public String listAllSubscriptionsAsHTML() throws Exception { return null; }
-
- @ManagementOperation(description = "Return all durable subscriptions for the topic in HTML", impact = Impact.ReadOnly)
- public String listDurableSubscriptionsAsHTML() throws Exception { return null; }
-
- @ManagementOperation(description = "Return all non durable subscriptions for the topic in HTML", impact = Impact.ReadOnly)
- public String listNonDurableSubscriptionsAsHTML() throws Exception { return null; }
-
- @ManagementOperation(description = "List all messages for the specified subscription", impact = Impact.ReadOnly)
- public List listAllMessages(String subscriptionID) throws Exception { return null; }
-
- @ManagementOperation(description = "List all messages for the specified subscription with the specified selector", impact = Impact.ReadOnly)
- public List listAllMessages(String subscriptionID, String selector) throws Exception { return null; }
-
- @ManagementOperation(description = "List all durable messages for the specified subscription", impact = Impact.ReadOnly)
- public List listDurableMessages(String subscriptionID) throws Exception { return null; }
-
- @ManagementOperation(description = "List all durable messages for the specified subscription with the specified selector", impact = Impact.ReadOnly)
- public List listDurableMessages(String subscriptionID, String selector) throws Exception { return null; }
-
- @ManagementOperation(description = "List all non durable messages for the specified subscription", impact = Impact.ReadOnly)
- public List listNonDurableMessages(String subscriptionID) throws Exception { return null; }
-
- @ManagementOperation(description = "List all non durable messages for the specified subscription with the specified selector", impact = Impact.ReadOnly)
- public List listNonDurableMessages(String subscriptionID, String selector) throws Exception { return null; }
-
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.server.destination;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jboss.managed.api.ManagedOperation.Impact;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.api.annotation.ManagementOperation;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.managed.api.annotation.ViewUse;
+import org.w3c.dom.Element;
+
+/**
+ * Empty class to provide the management metadata for JBoss Messaging
+ * org.jboss.jms.server.destination.TopicService, when deployed in AS5.
+ *
+ * @see {@linkplain org.jboss.jms.server.destination.TopicService}
+ *
+ * @author Dimitris.Andreadis at jboss.org
+ * @version $Revision:$
+ */
+ at ManagementObject(
+ componentType = @ManagementComponent(type = "JMSDestination", subtype = "Topic"),
+ properties = ManagementProperties.EXPLICIT)
+public class TopicServiceMO implements Serializable
+{
+ private static final long serialVersionUID = -2972719964517681496L;
+
+ // Management Properties
+
+ @ManagementProperty(use={ViewUse.RUNTIME}, description="The destination name")
+ public String getName() { return null; }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The destination's JNDI name")
+ @ManagementObjectID(type="Topic")
+ public String getJNDIName() { return null; }
+ public void setJNDIName(String arg0) throws Exception { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The ObjectName of the server peer this destination was deployed on")
+ public ObjectName getServerPeer() { return null; }
+ public void setServerPeer(ObjectName arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The DLQ for this topic, overrides the default DLQ on the server peer")
+ public ObjectName getDLQ() { return null; }
+ public void setDLQ(ObjectName arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The expiry queue for this topic, overrides the default expiry queue on the server peer")
+ public ObjectName getExpiryQueue() { return null; }
+ public void setExpiryQueue(ObjectName arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The delay before redelivering")
+ public long getRedeliveryDelay() { return 0; }
+ public void setRedeliveryDelay(long arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The destination's security configuration")
+ public Element getSecurityConfig() { return null; }
+ public void setSecurityConfig(Element arg0) { }
+
+ @ManagementProperty(use={ViewUse.RUNTIME}, description="True if this destination was created programmatically")
+ public boolean isCreatedProgrammatically() { return false; }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The maximum number of messages this topic can hold before they are dropped")
+ public int getMaxSize() { return 0; }
+ public void setMaxSize(int arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The in-memory message limit, can only be set when topic is stopped")
+ public int getFullSize() { return 0; }
+ public void setFullSize(int arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The paging size, can only be set when topic is stopped")
+ public int getPageSize() { return 0; }
+ public void setPageSize(int arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The write-cache size, can only be set when topic is stopped")
+ public int getDownCacheSize() { return 0; }
+ public void setDownCacheSize(int arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="Is this a clustered destination?")
+ public boolean isClustered() { return false; }
+ public void setClustered(boolean arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The day limit for the message counter")
+ public int getMessageCounterHistoryDayLimit() { return 0; }
+ public void setMessageCounterHistoryDayLimit(int arg0) { }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The maximum delivery attempts to the topic")
+ public int getMaxDeliveryAttempts() { return 0; }
+ public void setMaxDeliveryAttempts(int arg0) { }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="The message counters for the topic")
+ public List getMessageCounters() { return null; }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="The count of all messages in all subscriptions of this topic")
+ public int getAllMessageCount() { return 0; }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="The count of all messages in all durable subscriptions of this topic")
+ public int getDurableMessageCount() { return 0; }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="The count of all messages in all non durable subscriptions of this topic")
+ public int getNonDurableMessageCount() { return 0; }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="The count of all subscriptions of this topic")
+ public int getAllSubscriptionsCount() { return 0; }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="The count of all durable subscriptions of this topic")
+ public int getDurableSubscriptionsCount() { return 0; }
+
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="The count of all non durable subscriptions of this topic")
+ public int getNonDurableSubscriptionsCount() { return 0; }
+
+ // Management Operations
+
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void create() throws Exception { }
+
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void start() throws Exception { }
+
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void stop() { }
+
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void destroy() { }
+
+ @ManagementOperation(description = "Remove all messages", impact = Impact.WriteOnly)
+ public void removeAllMessages() throws Exception { }
+
+ @ManagementOperation(description = "Return all subscriptions for the topic", impact = Impact.ReadOnly)
+ public List listAllSubscriptions() throws Exception { return null; }
+
+ @ManagementOperation(description = "Return all durable subscriptions for the topic", impact = Impact.ReadOnly)
+ public List listDurableSubscriptions() throws Exception { return null; }
+
+ @ManagementOperation(description = "Return all non durable subscriptions for the topic", impact = Impact.ReadOnly)
+ public List listNonDurableSubscriptions() throws Exception { return null; }
+
+ @ManagementOperation(description = "Return all subscriptions for the topic in HTML", impact = Impact.ReadOnly)
+ public String listAllSubscriptionsAsHTML() throws Exception { return null; }
+
+ @ManagementOperation(description = "Return all durable subscriptions for the topic in HTML", impact = Impact.ReadOnly)
+ public String listDurableSubscriptionsAsHTML() throws Exception { return null; }
+
+ @ManagementOperation(description = "Return all non durable subscriptions for the topic in HTML", impact = Impact.ReadOnly)
+ public String listNonDurableSubscriptionsAsHTML() throws Exception { return null; }
+
+ @ManagementOperation(description = "List all messages for the specified subscription", impact = Impact.ReadOnly)
+ public List listAllMessages(String subscriptionID) throws Exception { return null; }
+
+ @ManagementOperation(description = "List all messages for the specified subscription with the specified selector", impact = Impact.ReadOnly)
+ public List listAllMessages(String subscriptionID, String selector) throws Exception { return null; }
+
+ @ManagementOperation(description = "List all durable messages for the specified subscription", impact = Impact.ReadOnly)
+ public List listDurableMessages(String subscriptionID) throws Exception { return null; }
+
+ @ManagementOperation(description = "List all durable messages for the specified subscription with the specified selector", impact = Impact.ReadOnly)
+ public List listDurableMessages(String subscriptionID, String selector) throws Exception { return null; }
+
+ @ManagementOperation(description = "List all non durable messages for the specified subscription", impact = Impact.ReadOnly)
+ public List listNonDurableMessages(String subscriptionID) throws Exception { return null; }
+
+ @ManagementOperation(description = "List all non durable messages for the specified subscription with the specified selector", impact = Impact.ReadOnly)
+ public List listNonDurableMessages(String subscriptionID, String selector) throws Exception { return null; }
+
}
\ No newline at end of file
Property changes on: trunk/messaging/src/main/org/jboss/jms/server/destination/TopicServiceMO.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/jms/server/jbosssx/JBossASSecurityMetadataStore.java
===================================================================
--- trunk/messaging/src/main/org/jboss/jms/server/jbosssx/JBossASSecurityMetadataStore.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/jms/server/jbosssx/JBossASSecurityMetadataStore.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,326 +1,326 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jms.server.jbosssx;
-
-import java.security.AccessController;
-import java.security.Principal;
-import java.security.PrivilegedAction;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.jms.JMSSecurityException;
-import javax.naming.NamingException;
-import javax.security.auth.Subject;
-
-import org.jboss.jms.server.SecurityStore;
-import org.jboss.jms.server.security.CheckType;
-import org.jboss.jms.server.security.SecurityMetadata;
-import org.jboss.logging.Logger;
-import org.jboss.security.AuthenticationManager;
-import org.jboss.security.AuthorizationManager;
-import org.jboss.security.ISecurityManagement;
-import org.jboss.security.SimplePrincipal;
-import org.w3c.dom.Element;
-
-/**
- * A security metadate store for JMS. Stores security information for destinations and delegates authentication and
- * authorization to a JaasSecurityManager.
- *
- * @author Peter Antman
- * @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @author Anil.Saldhana at redhat.com
- * @version $Revision$
- *
- * $Id$
- */
- at SuppressWarnings("unchecked")
-public class JBossASSecurityMetadataStore implements SecurityStore, JBossASSecurityMetadataStoreMBean
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(JBossASSecurityMetadataStore.class);
-
- public static final String DEFAULT_SUCKER_USER_PASSWORD = "CHANGE ME!!";
-
- // Attributes ----------------------------------------------------
-
- private final boolean trace = log.isTraceEnabled();
-
- private final Map queueSecurityConf;
-
- private final Map topicSecurityConf;
-
- private Element defaultSecurityConfig;
-
- private String securityDomain = "messaging";
-
- private String suckerPassword;
-
- private ISecurityManagement securityManagement = null;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public JBossASSecurityMetadataStore()
- {
- queueSecurityConf = new HashMap();
- topicSecurityConf = new HashMap();
- }
-
- // SecurityManager implementation --------------------------------
-
- public SecurityMetadata getSecurityMetadata(boolean isQueue, String destName)
- {
- SecurityMetadata m = (SecurityMetadata) (isQueue ? queueSecurityConf.get(destName) : topicSecurityConf
- .get(destName));
-
- if (m == null)
- {
- // No SecurityMetadata was configured for the destination, apply the default
- if (defaultSecurityConfig != null)
- {
- log.debug("No SecurityMetadadata was available for " + destName + ", using default security config");
- try
- {
- m = new SecurityMetadata(defaultSecurityConfig);
- }
- catch (Exception e)
- {
- log.warn("Unable to apply default security for destName, using guest " + destName, e);
- m = new SecurityMetadata();
- }
- }
- else
- {
- // default to guest
- log.warn("No SecurityMetadadata was available for " + destName + ", adding guest");
- m = new SecurityMetadata();
- }
-
- // don't cache it! this way the callers will be able to take advantage of default security
- // configuration updates
- // securityConf.put(destName, m);
- }
- return m;
- }
-
- public void setSecurityConfig(boolean isQueue, String destName, Element conf) throws Exception
- {
- if (trace)
- {
- log.trace("adding security configuration for " + (isQueue ? "queue " : "topic ") + destName);
- }
-
- if (conf == null)
- {
- clearSecurityConfig(isQueue, destName);
- }
- else
- {
- SecurityMetadata m = new SecurityMetadata(conf);
-
- if (isQueue)
- {
- queueSecurityConf.put(destName, m);
- }
- else
- {
- topicSecurityConf.put(destName, m);
- }
- }
- }
-
- public void clearSecurityConfig(boolean isQueue, String name) throws Exception
- {
- if (trace)
- {
- log.trace("clearing security configuration for " + (isQueue ? "queue " : "topic ") + name);
- }
-
- if (isQueue)
- {
- queueSecurityConf.remove(name);
- }
- else
- {
- topicSecurityConf.remove(name);
- }
- }
-
- public Subject authenticate(String user, String password) throws JMSSecurityException
- {
- if (trace)
- {
- log.trace("authenticating user " + user);
- }
-
- SimplePrincipal principal = new SimplePrincipal(user);
- char[] passwordChars = null;
- if (password != null)
- {
- passwordChars = password.toCharArray();
- }
-
- Subject subject = new Subject();
-
- boolean authenticated = false;
-
- if (SUCKER_USER.equals(user))
- {
- if (trace)
- {
- log.trace("Authenticating sucker user");
- }
-
- checkDefaultSuckerPassword(password);
-
- // The special user SUCKER_USER is used for creating internal connections that suck messages between nodes
-
- authenticated = suckerPassword.equals(password);
- }
- else
- {
- if (securityManagement == null)
- throw new SecurityException("SecurityManagement has not been set");
- AuthenticationManager authenticationManager = securityManagement.getAuthenticationManager(securityDomain);
- if (authenticationManager == null)
- throw new SecurityException("AuthenticationManager is null for domain=" + securityDomain);
- authenticated = authenticationManager.isValid(principal, passwordChars, subject);
- }
-
- if (authenticated)
- {
- // Warning! This "taints" thread local. Make sure you pop it off the stack as soon as
- // you're done with it.
- SecurityActions.pushSubjectContext(principal, passwordChars, subject, securityDomain);
- return subject;
- }
- else
- {
- throw new JMSSecurityException("User " + user + " is NOT authenticated");
- }
- }
-
- public boolean authorize(String user, final Set rolePrincipals, CheckType checkType)
- {
- if (trace)
- {
- log.trace("authorizing user " + user + " for role(s) " + rolePrincipals.toString());
- }
-
- if (SUCKER_USER.equals(user))
- {
- // The special user SUCKER_USER is used for creating internal connections that suck messages between nodes
- // It has automatic read/write access to all destinations
- return (checkType.equals(CheckType.READ) || checkType.equals(CheckType.WRITE));
- }
-
- final Principal principal = user == null ? null : new SimplePrincipal(user);
- if (securityManagement == null)
- throw new SecurityException("SecurityManagement has not been set");
- final AuthorizationManager authorizationManager = securityManagement.getAuthorizationManager(securityDomain);
- if (authorizationManager == null)
- throw new SecurityException("AuthorizationManager is null for domain=" + securityDomain);
- boolean hasRole = AccessController.doPrivileged(new PrivilegedAction<Boolean>()
- {
- public Boolean run()
- {
- return authorizationManager.doesUserHaveRole(principal, rolePrincipals);
- }});
-
- if (trace)
- {
- log.trace("user " + user + (hasRole ? " is " : " is NOT ") + "authorized");
- }
-
- return hasRole;
- }
-
- // Public --------------------------------------------------------
-
- public void setSuckerPassword(String password)
- {
- checkDefaultSuckerPassword(password);
-
- this.suckerPassword = password;
- }
-
- /**
- * @see JBossASSecurityMetadataStoreMBean#setSecurityManagement(ISecurityManagement)
- */
- public void setSecurityManagement(ISecurityManagement securityManagement)
- {
- this.securityManagement = securityManagement;
- }
-
- public void start() throws NamingException
- {
- }
-
- public void stop() throws Exception
- {
- }
-
- public String getSecurityDomain()
- {
- return this.securityDomain;
- }
-
- public void setSecurityDomain(String securityDomain)
- {
- this.securityDomain = securityDomain;
- }
-
- public Element getDefaultSecurityConfig()
- {
- return this.defaultSecurityConfig;
- }
-
- public void setDefaultSecurityConfig(Element conf) throws Exception
- {
- // Force a parse
- new SecurityMetadata(conf);
- defaultSecurityConfig = conf;
- }
-
- // Protected -----------------------------------------------------
-
- // Package Private -----------------------------------------------
-
- // Private -------------------------------------------------------
-
- private void checkDefaultSuckerPassword(String password)
- {
- // Sanity check
- if (DEFAULT_SUCKER_USER_PASSWORD.equals(password))
- {
- log
- .warn("WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component "
- + "which sucks messages from one node to another has not had its password changed from the installation default. "
- + "Please see the JBoss Messaging user guide for instructions on how to do this.");
- }
- }
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.server.jbosssx;
+
+import java.security.AccessController;
+import java.security.Principal;
+import java.security.PrivilegedAction;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.jms.JMSSecurityException;
+import javax.naming.NamingException;
+import javax.security.auth.Subject;
+
+import org.jboss.jms.server.SecurityStore;
+import org.jboss.jms.server.security.CheckType;
+import org.jboss.jms.server.security.SecurityMetadata;
+import org.jboss.logging.Logger;
+import org.jboss.security.AuthenticationManager;
+import org.jboss.security.AuthorizationManager;
+import org.jboss.security.ISecurityManagement;
+import org.jboss.security.SimplePrincipal;
+import org.w3c.dom.Element;
+
+/**
+ * A security metadate store for JMS. Stores security information for destinations and delegates authentication and
+ * authorization to a JaasSecurityManager.
+ *
+ * @author Peter Antman
+ * @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @author Anil.Saldhana at redhat.com
+ * @version $Revision$
+ *
+ * $Id$
+ */
+ at SuppressWarnings("unchecked")
+public class JBossASSecurityMetadataStore implements SecurityStore, JBossASSecurityMetadataStoreMBean
+{
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(JBossASSecurityMetadataStore.class);
+
+ public static final String DEFAULT_SUCKER_USER_PASSWORD = "CHANGE ME!!";
+
+ // Attributes ----------------------------------------------------
+
+ private final boolean trace = log.isTraceEnabled();
+
+ private final Map queueSecurityConf;
+
+ private final Map topicSecurityConf;
+
+ private Element defaultSecurityConfig;
+
+ private String securityDomain = "messaging";
+
+ private String suckerPassword;
+
+ private ISecurityManagement securityManagement = null;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public JBossASSecurityMetadataStore()
+ {
+ queueSecurityConf = new HashMap();
+ topicSecurityConf = new HashMap();
+ }
+
+ // SecurityManager implementation --------------------------------
+
+ public SecurityMetadata getSecurityMetadata(boolean isQueue, String destName)
+ {
+ SecurityMetadata m = (SecurityMetadata) (isQueue ? queueSecurityConf.get(destName) : topicSecurityConf
+ .get(destName));
+
+ if (m == null)
+ {
+ // No SecurityMetadata was configured for the destination, apply the default
+ if (defaultSecurityConfig != null)
+ {
+ log.debug("No SecurityMetadadata was available for " + destName + ", using default security config");
+ try
+ {
+ m = new SecurityMetadata(defaultSecurityConfig);
+ }
+ catch (Exception e)
+ {
+ log.warn("Unable to apply default security for destName, using guest " + destName, e);
+ m = new SecurityMetadata();
+ }
+ }
+ else
+ {
+ // default to guest
+ log.warn("No SecurityMetadadata was available for " + destName + ", adding guest");
+ m = new SecurityMetadata();
+ }
+
+ // don't cache it! this way the callers will be able to take advantage of default security
+ // configuration updates
+ // securityConf.put(destName, m);
+ }
+ return m;
+ }
+
+ public void setSecurityConfig(boolean isQueue, String destName, Element conf) throws Exception
+ {
+ if (trace)
+ {
+ log.trace("adding security configuration for " + (isQueue ? "queue " : "topic ") + destName);
+ }
+
+ if (conf == null)
+ {
+ clearSecurityConfig(isQueue, destName);
+ }
+ else
+ {
+ SecurityMetadata m = new SecurityMetadata(conf);
+
+ if (isQueue)
+ {
+ queueSecurityConf.put(destName, m);
+ }
+ else
+ {
+ topicSecurityConf.put(destName, m);
+ }
+ }
+ }
+
+ public void clearSecurityConfig(boolean isQueue, String name) throws Exception
+ {
+ if (trace)
+ {
+ log.trace("clearing security configuration for " + (isQueue ? "queue " : "topic ") + name);
+ }
+
+ if (isQueue)
+ {
+ queueSecurityConf.remove(name);
+ }
+ else
+ {
+ topicSecurityConf.remove(name);
+ }
+ }
+
+ public Subject authenticate(String user, String password) throws JMSSecurityException
+ {
+ if (trace)
+ {
+ log.trace("authenticating user " + user);
+ }
+
+ SimplePrincipal principal = new SimplePrincipal(user);
+ char[] passwordChars = null;
+ if (password != null)
+ {
+ passwordChars = password.toCharArray();
+ }
+
+ Subject subject = new Subject();
+
+ boolean authenticated = false;
+
+ if (SUCKER_USER.equals(user))
+ {
+ if (trace)
+ {
+ log.trace("Authenticating sucker user");
+ }
+
+ checkDefaultSuckerPassword(password);
+
+ // The special user SUCKER_USER is used for creating internal connections that suck messages between nodes
+
+ authenticated = suckerPassword.equals(password);
+ }
+ else
+ {
+ if (securityManagement == null)
+ throw new SecurityException("SecurityManagement has not been set");
+ AuthenticationManager authenticationManager = securityManagement.getAuthenticationManager(securityDomain);
+ if (authenticationManager == null)
+ throw new SecurityException("AuthenticationManager is null for domain=" + securityDomain);
+ authenticated = authenticationManager.isValid(principal, passwordChars, subject);
+ }
+
+ if (authenticated)
+ {
+ // Warning! This "taints" thread local. Make sure you pop it off the stack as soon as
+ // you're done with it.
+ SecurityActions.pushSubjectContext(principal, passwordChars, subject, securityDomain);
+ return subject;
+ }
+ else
+ {
+ throw new JMSSecurityException("User " + user + " is NOT authenticated");
+ }
+ }
+
+ public boolean authorize(String user, final Set rolePrincipals, CheckType checkType)
+ {
+ if (trace)
+ {
+ log.trace("authorizing user " + user + " for role(s) " + rolePrincipals.toString());
+ }
+
+ if (SUCKER_USER.equals(user))
+ {
+ // The special user SUCKER_USER is used for creating internal connections that suck messages between nodes
+ // It has automatic read/write access to all destinations
+ return (checkType.equals(CheckType.READ) || checkType.equals(CheckType.WRITE));
+ }
+
+ final Principal principal = user == null ? null : new SimplePrincipal(user);
+ if (securityManagement == null)
+ throw new SecurityException("SecurityManagement has not been set");
+ final AuthorizationManager authorizationManager = securityManagement.getAuthorizationManager(securityDomain);
+ if (authorizationManager == null)
+ throw new SecurityException("AuthorizationManager is null for domain=" + securityDomain);
+ boolean hasRole = AccessController.doPrivileged(new PrivilegedAction<Boolean>()
+ {
+ public Boolean run()
+ {
+ return authorizationManager.doesUserHaveRole(principal, rolePrincipals);
+ }});
+
+ if (trace)
+ {
+ log.trace("user " + user + (hasRole ? " is " : " is NOT ") + "authorized");
+ }
+
+ return hasRole;
+ }
+
+ // Public --------------------------------------------------------
+
+ public void setSuckerPassword(String password)
+ {
+ checkDefaultSuckerPassword(password);
+
+ this.suckerPassword = password;
+ }
+
+ /**
+ * @see JBossASSecurityMetadataStoreMBean#setSecurityManagement(ISecurityManagement)
+ */
+ public void setSecurityManagement(ISecurityManagement securityManagement)
+ {
+ this.securityManagement = securityManagement;
+ }
+
+ public void start() throws NamingException
+ {
+ }
+
+ public void stop() throws Exception
+ {
+ }
+
+ public String getSecurityDomain()
+ {
+ return this.securityDomain;
+ }
+
+ public void setSecurityDomain(String securityDomain)
+ {
+ this.securityDomain = securityDomain;
+ }
+
+ public Element getDefaultSecurityConfig()
+ {
+ return this.defaultSecurityConfig;
+ }
+
+ public void setDefaultSecurityConfig(Element conf) throws Exception
+ {
+ // Force a parse
+ new SecurityMetadata(conf);
+ defaultSecurityConfig = conf;
+ }
+
+ // Protected -----------------------------------------------------
+
+ // Package Private -----------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ private void checkDefaultSuckerPassword(String password)
+ {
+ // Sanity check
+ if (DEFAULT_SUCKER_USER_PASSWORD.equals(password))
+ {
+ log
+ .warn("WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component "
+ + "which sucks messages from one node to another has not had its password changed from the installation default. "
+ + "Please see the JBoss Messaging user guide for instructions on how to do this.");
+ }
+ }
}
\ No newline at end of file
Property changes on: trunk/messaging/src/main/org/jboss/jms/server/jbosssx/JBossASSecurityMetadataStore.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/jms/server/jbosssx/JBossASSecurityMetadataStoreMBean.java
===================================================================
--- trunk/messaging/src/main/org/jboss/jms/server/jbosssx/JBossASSecurityMetadataStoreMBean.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/jms/server/jbosssx/JBossASSecurityMetadataStoreMBean.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,89 +1,89 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jms.server.jbosssx;
-
-import java.security.Principal;
-import java.util.Set;
-
-import javax.jms.JMSSecurityException;
-import javax.security.auth.Subject;
-
-import org.jboss.jms.server.security.CheckType;
-import org.jboss.jms.server.security.SecurityMetadata;
-import org.jboss.security.ISecurityManagement;
-import org.w3c.dom.Element;
-
-/**
- * The SecurityMetadataStore mbean interface
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public interface JBossASSecurityMetadataStoreMBean
-{
- public String getSecurityDomain();
- public void setSecurityDomain(String securityDomain);
- public void setDefaultSecurityConfig(Element conf) throws Exception;
- public Element getDefaultSecurityConfig();
-
- public void setSuckerPassword(String password);
- public void start() throws Exception;
- public void stop() throws Exception;
- /**
- * @return the security meta-data for the given destination.
- */
- SecurityMetadata getSecurityMetadata(boolean isQueue, String destName);
-
- /**
- * Inject a SecurityManagement instance
- * (Locator for Security Managers for authentication
- * and authorization)
- * @param securityManagement
- */
- void setSecurityManagement(ISecurityManagement securityManagement);
-
- void setSecurityConfig(boolean isQueue, String destName, Element conf) throws Exception;
-
- void clearSecurityConfig(boolean isQueue, String name) throws Exception;
-
- /**
- * Authenticate the specified user with the given password. Implementations are most likely to
- * delegates to a JBoss AuthenticationManager.
- *
- * Successful authentication will place a new SubjectContext on thread local, which will be used
- * in the authorization process. However, we need to make sure we clean up thread local
- * immediately after we used the information, otherwise some other people security my be screwed
- * up, on account of thread local security stack being corrupted.
- *
- * @throws JMSSecurityException if the user is not authenticated
- */
- Subject authenticate(String user, String password) throws JMSSecurityException;
-
- /**
- * Authorize that the subject has at least one of the specified roles. Implementations are most
- * likely to delegates to a JBoss AuthenticationManager.
- *
- * @param rolePrincipals - The set of roles allowed to read/write/create the destination.
- * @return true if the subject is authorized, or false if not.
- */
- boolean authorize(String user, Set<Principal> rolePrincipals, CheckType checkType);
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.server.jbosssx;
+
+import java.security.Principal;
+import java.util.Set;
+
+import javax.jms.JMSSecurityException;
+import javax.security.auth.Subject;
+
+import org.jboss.jms.server.security.CheckType;
+import org.jboss.jms.server.security.SecurityMetadata;
+import org.jboss.security.ISecurityManagement;
+import org.w3c.dom.Element;
+
+/**
+ * The SecurityMetadataStore mbean interface
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface JBossASSecurityMetadataStoreMBean
+{
+ public String getSecurityDomain();
+ public void setSecurityDomain(String securityDomain);
+ public void setDefaultSecurityConfig(Element conf) throws Exception;
+ public Element getDefaultSecurityConfig();
+
+ public void setSuckerPassword(String password);
+ public void start() throws Exception;
+ public void stop() throws Exception;
+ /**
+ * @return the security meta-data for the given destination.
+ */
+ SecurityMetadata getSecurityMetadata(boolean isQueue, String destName);
+
+ /**
+ * Inject a SecurityManagement instance
+ * (Locator for Security Managers for authentication
+ * and authorization)
+ * @param securityManagement
+ */
+ void setSecurityManagement(ISecurityManagement securityManagement);
+
+ void setSecurityConfig(boolean isQueue, String destName, Element conf) throws Exception;
+
+ void clearSecurityConfig(boolean isQueue, String name) throws Exception;
+
+ /**
+ * Authenticate the specified user with the given password. Implementations are most likely to
+ * delegates to a JBoss AuthenticationManager.
+ *
+ * Successful authentication will place a new SubjectContext on thread local, which will be used
+ * in the authorization process. However, we need to make sure we clean up thread local
+ * immediately after we used the information, otherwise some other people security my be screwed
+ * up, on account of thread local security stack being corrupted.
+ *
+ * @throws JMSSecurityException if the user is not authenticated
+ */
+ Subject authenticate(String user, String password) throws JMSSecurityException;
+
+ /**
+ * Authorize that the subject has at least one of the specified roles. Implementations are most
+ * likely to delegates to a JBoss AuthenticationManager.
+ *
+ * @param rolePrincipals - The set of roles allowed to read/write/create the destination.
+ * @return true if the subject is authorized, or false if not.
+ */
+ boolean authorize(String user, Set<Principal> rolePrincipals, CheckType checkType);
}
\ No newline at end of file
Property changes on: trunk/messaging/src/main/org/jboss/jms/server/jbosssx/JBossASSecurityMetadataStoreMBean.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/jms/server/jbosssx/MemorySecurityStore.java
===================================================================
--- trunk/messaging/src/main/org/jboss/jms/server/jbosssx/MemorySecurityStore.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/jms/server/jbosssx/MemorySecurityStore.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,164 +1,164 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jms.server.jbosssx;
-
-import java.security.Principal;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.jms.JMSSecurityException;
-import javax.security.auth.Subject;
-
-import org.jboss.security.AuthenticationManager;
-import org.jboss.security.RealmMapping;
-import org.jboss.security.SimplePrincipal;
-import org.jboss.jms.server.SecurityStore;
-import org.jboss.jms.server.security.CheckType;
-import org.jboss.jms.server.security.SecurityMetadata;
-import org.w3c.dom.Element;
-
-
-/**
- * An implementation of the messaging SecurityStore.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public class MemorySecurityStore
- implements SecurityStore, MemorySecurityStoreMBean
-{
- private Map<String, SecurityMetadata> queueSecurityConf
- = new ConcurrentHashMap<String, SecurityMetadata>();
- private Map<String, SecurityMetadata> topicSecurityConf
- = new ConcurrentHashMap<String, SecurityMetadata>();
- private SecurityMetadata defaultSecurityConfig;
- private String securityDomain;
- private String suckerPassword;
- private AuthenticationManager authenticationMgr;
- private RealmMapping authorizationMgr;
-
- public SecurityMetadata getDefaultSecurityConfig()
- {
- return defaultSecurityConfig;
- }
-
- public void setDefaultSecurityConfig(SecurityMetadata defaultSecurityConfig)
- {
- this.defaultSecurityConfig = defaultSecurityConfig;
- }
-
- public String getSecurityDomain()
- {
- return securityDomain;
- }
-
- public void setSecurityDomain(String securityDomain)
- {
- this.securityDomain = securityDomain;
- }
-
- public String getSuckerPassword()
- {
- return suckerPassword;
- }
-
- public void setSuckerPassword(String suckerPassword)
- {
- this.suckerPassword = suckerPassword;
- }
-
- public AuthenticationManager getAuthenticationMgr()
- {
- return authenticationMgr;
- }
-
- public void setAuthenticationMgr(AuthenticationManager authenticationMgr)
- {
- this.authenticationMgr = authenticationMgr;
- }
-
- public RealmMapping getAuthorizationMgr()
- {
- return authorizationMgr;
- }
- public void setAuthorizationMgr(RealmMapping authorizationMgr)
- {
- this.authorizationMgr = authorizationMgr;
- }
-
- public Subject authenticate(String user, String password)
- throws JMSSecurityException
- {
- Subject subject = new Subject();
- SimplePrincipal principal = new SimplePrincipal(user);
- if(authenticationMgr.isValid(principal, password, subject) == false)
- subject = null;
- return subject;
- }
-
- public boolean authorize(String user, Set rolePrincipals, CheckType checkType)
- {
- if (SecurityStore.SUCKER_USER.equals(user))
- {
- //The special user SUCKER_USER is used for creating internal connections that suck messages between nodes
- //It has automatic read/write access to all destinations
- return (checkType.equals(CheckType.READ) || checkType.equals(CheckType.WRITE));
- }
-
- Principal principal = user == null ? null : new SimplePrincipal(user);
-
- boolean hasRole = authorizationMgr.doesUserHaveRole(principal, rolePrincipals);
-
- return hasRole;
- }
-
- public void clearSecurityConfig(boolean isQueue, String destName)
- throws Exception
- {
- if(isQueue)
- queueSecurityConf.remove(destName);
- else
- topicSecurityConf.remove(destName);
- }
-
- public SecurityMetadata getSecurityMetadata(boolean isQueue, String destName)
- {
- SecurityMetadata smd = defaultSecurityConfig;
- if(isQueue)
- smd = queueSecurityConf.get(destName);
- else
- smd = topicSecurityConf.get(destName);
- return smd;
- }
-
- public void setSecurityConfig(boolean isQueue, String destName, Element conf)
- throws Exception
- {
- SecurityMetadata smd = new SecurityMetadata(conf);
- if(isQueue)
- queueSecurityConf.put(destName, smd);
- else
- topicSecurityConf.put(destName, smd);
- }
-
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.server.jbosssx;
+
+import java.security.Principal;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.jms.JMSSecurityException;
+import javax.security.auth.Subject;
+
+import org.jboss.security.AuthenticationManager;
+import org.jboss.security.RealmMapping;
+import org.jboss.security.SimplePrincipal;
+import org.jboss.jms.server.SecurityStore;
+import org.jboss.jms.server.security.CheckType;
+import org.jboss.jms.server.security.SecurityMetadata;
+import org.w3c.dom.Element;
+
+
+/**
+ * An implementation of the messaging SecurityStore.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class MemorySecurityStore
+ implements SecurityStore, MemorySecurityStoreMBean
+{
+ private Map<String, SecurityMetadata> queueSecurityConf
+ = new ConcurrentHashMap<String, SecurityMetadata>();
+ private Map<String, SecurityMetadata> topicSecurityConf
+ = new ConcurrentHashMap<String, SecurityMetadata>();
+ private SecurityMetadata defaultSecurityConfig;
+ private String securityDomain;
+ private String suckerPassword;
+ private AuthenticationManager authenticationMgr;
+ private RealmMapping authorizationMgr;
+
+ public SecurityMetadata getDefaultSecurityConfig()
+ {
+ return defaultSecurityConfig;
+ }
+
+ public void setDefaultSecurityConfig(SecurityMetadata defaultSecurityConfig)
+ {
+ this.defaultSecurityConfig = defaultSecurityConfig;
+ }
+
+ public String getSecurityDomain()
+ {
+ return securityDomain;
+ }
+
+ public void setSecurityDomain(String securityDomain)
+ {
+ this.securityDomain = securityDomain;
+ }
+
+ public String getSuckerPassword()
+ {
+ return suckerPassword;
+ }
+
+ public void setSuckerPassword(String suckerPassword)
+ {
+ this.suckerPassword = suckerPassword;
+ }
+
+ public AuthenticationManager getAuthenticationMgr()
+ {
+ return authenticationMgr;
+ }
+
+ public void setAuthenticationMgr(AuthenticationManager authenticationMgr)
+ {
+ this.authenticationMgr = authenticationMgr;
+ }
+
+ public RealmMapping getAuthorizationMgr()
+ {
+ return authorizationMgr;
+ }
+ public void setAuthorizationMgr(RealmMapping authorizationMgr)
+ {
+ this.authorizationMgr = authorizationMgr;
+ }
+
+ public Subject authenticate(String user, String password)
+ throws JMSSecurityException
+ {
+ Subject subject = new Subject();
+ SimplePrincipal principal = new SimplePrincipal(user);
+ if(authenticationMgr.isValid(principal, password, subject) == false)
+ subject = null;
+ return subject;
+ }
+
+ public boolean authorize(String user, Set rolePrincipals, CheckType checkType)
+ {
+ if (SecurityStore.SUCKER_USER.equals(user))
+ {
+ //The special user SUCKER_USER is used for creating internal connections that suck messages between nodes
+ //It has automatic read/write access to all destinations
+ return (checkType.equals(CheckType.READ) || checkType.equals(CheckType.WRITE));
+ }
+
+ Principal principal = user == null ? null : new SimplePrincipal(user);
+
+ boolean hasRole = authorizationMgr.doesUserHaveRole(principal, rolePrincipals);
+
+ return hasRole;
+ }
+
+ public void clearSecurityConfig(boolean isQueue, String destName)
+ throws Exception
+ {
+ if(isQueue)
+ queueSecurityConf.remove(destName);
+ else
+ topicSecurityConf.remove(destName);
+ }
+
+ public SecurityMetadata getSecurityMetadata(boolean isQueue, String destName)
+ {
+ SecurityMetadata smd = defaultSecurityConfig;
+ if(isQueue)
+ smd = queueSecurityConf.get(destName);
+ else
+ smd = topicSecurityConf.get(destName);
+ return smd;
+ }
+
+ public void setSecurityConfig(boolean isQueue, String destName, Element conf)
+ throws Exception
+ {
+ SecurityMetadata smd = new SecurityMetadata(conf);
+ if(isQueue)
+ queueSecurityConf.put(destName, smd);
+ else
+ topicSecurityConf.put(destName, smd);
+ }
+
+}
Property changes on: trunk/messaging/src/main/org/jboss/jms/server/jbosssx/MemorySecurityStore.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/jms/server/jbosssx/MemorySecurityStoreMBean.java
===================================================================
--- trunk/messaging/src/main/org/jboss/jms/server/jbosssx/MemorySecurityStoreMBean.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/jms/server/jbosssx/MemorySecurityStoreMBean.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,48 +1,48 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jms.server.jbosssx;
-
-import org.jboss.jms.server.security.SecurityMetadata;
-import org.jboss.security.AuthenticationManager;
-import org.jboss.security.RealmMapping;
-
-/**
- * The mbean interface for MemorySecurityStore
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public interface MemorySecurityStoreMBean
-{
- public SecurityMetadata getDefaultSecurityConfig();
- public void setDefaultSecurityConfig(SecurityMetadata defaultSecurityConfig);
-
- public String getSecurityDomain();
- public void setSecurityDomain(String securityDomain);
-
- public void setSuckerPassword(String suckerPassword);
-
- public AuthenticationManager getAuthenticationMgr();
- public void setAuthenticationMgr(AuthenticationManager authenticationMgr);
-
- public RealmMapping getAuthorizationMgr();
- public void setAuthorizationMgr(RealmMapping authorizationMgr);
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.server.jbosssx;
+
+import org.jboss.jms.server.security.SecurityMetadata;
+import org.jboss.security.AuthenticationManager;
+import org.jboss.security.RealmMapping;
+
+/**
+ * The mbean interface for MemorySecurityStore
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public interface MemorySecurityStoreMBean
+{
+ public SecurityMetadata getDefaultSecurityConfig();
+ public void setDefaultSecurityConfig(SecurityMetadata defaultSecurityConfig);
+
+ public String getSecurityDomain();
+ public void setSecurityDomain(String securityDomain);
+
+ public void setSuckerPassword(String suckerPassword);
+
+ public AuthenticationManager getAuthenticationMgr();
+ public void setAuthenticationMgr(AuthenticationManager authenticationMgr);
+
+ public RealmMapping getAuthorizationMgr();
+ public void setAuthorizationMgr(RealmMapping authorizationMgr);
+}
Property changes on: trunk/messaging/src/main/org/jboss/jms/server/jbosssx/MemorySecurityStoreMBean.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/jms/server/jbosssx/SecurityActions.java
===================================================================
--- trunk/messaging/src/main/org/jboss/jms/server/jbosssx/SecurityActions.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/jms/server/jbosssx/SecurityActions.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,124 +1,124 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jms.server.jbosssx;
-
-import java.security.AccessController;
-import java.security.Principal;
-import java.security.PrivilegedAction;
-
-import javax.security.auth.Subject;
-
-import org.jboss.security.SecurityContext;
-import org.jboss.security.SecurityContextFactory;
-import org.jboss.security.SecurityContextAssociation;
-
-
-/** A collection of privileged actions for this package
-* @author Scott.Stark at jboss.org
-* @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
-* @author <a her="mailto:tim.fox at jboss.com">Tim Fox</a>
-* @version $Revison: 1.0$
-*/
-class SecurityActions
-{
- interface PrincipalInfoAction
- {
- PrincipalInfoAction PRIVILEGED = new PrincipalInfoAction()
- {
- public void push(final Principal principal, final Object credential,
- final Subject subject, final String domain)
- {
- AccessController.doPrivileged(
- new PrivilegedAction<Object>()
- {
- public Object run()
- {
- try
- {
- SecurityContext sc = SecurityContextFactory.createSecurityContext(domain);
- SecurityContextAssociation.setSecurityContext(sc);
- sc.getUtil().createSubjectInfo(principal, credential, subject);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- return null;
- }
- }
- );
- }
- public void pop()
- {
- AccessController.doPrivileged(
- new PrivilegedAction<Object>()
- {
- public Object run()
- {
- SecurityContextAssociation.clearSecurityContext();
- return null;
- }
- }
- );
- }
- };
-
- PrincipalInfoAction NON_PRIVILEGED = new PrincipalInfoAction()
- {
- public void push(Principal principal, Object credential, Subject subject, String domain)
- {
- //ToDo: Get the correct security domain name
- try
- {
- SecurityContext sc = SecurityContextFactory.createSecurityContext(domain);
- SecurityContextAssociation.setSecurityContext(sc);
- sc.getUtil().createSubjectInfo(principal, credential, subject);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public void pop()
- {
- SecurityContextAssociation.clearSecurityContext();
- }
- };
-
- void push(Principal principal, Object credential, Subject subject, String domain);
- void pop();
- }
-
- static void pushSubjectContext(Principal principal, Object credential,
- Subject subject, String domain)
- {
- if(System.getSecurityManager() == null)
- {
- PrincipalInfoAction.NON_PRIVILEGED.push(principal, credential, subject, domain);
- }
- else
- {
- PrincipalInfoAction.PRIVILEGED.push(principal, credential, subject, domain);
- }
- }
- }
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.server.jbosssx;
+
+import java.security.AccessController;
+import java.security.Principal;
+import java.security.PrivilegedAction;
+
+import javax.security.auth.Subject;
+
+import org.jboss.security.SecurityContext;
+import org.jboss.security.SecurityContextFactory;
+import org.jboss.security.SecurityContextAssociation;
+
+
+/** A collection of privileged actions for this package
+* @author Scott.Stark at jboss.org
+* @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+* @author <a her="mailto:tim.fox at jboss.com">Tim Fox</a>
+* @version $Revison: 1.0$
+*/
+class SecurityActions
+{
+ interface PrincipalInfoAction
+ {
+ PrincipalInfoAction PRIVILEGED = new PrincipalInfoAction()
+ {
+ public void push(final Principal principal, final Object credential,
+ final Subject subject, final String domain)
+ {
+ AccessController.doPrivileged(
+ new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ try
+ {
+ SecurityContext sc = SecurityContextFactory.createSecurityContext(domain);
+ SecurityContextAssociation.setSecurityContext(sc);
+ sc.getUtil().createSubjectInfo(principal, credential, subject);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ return null;
+ }
+ }
+ );
+ }
+ public void pop()
+ {
+ AccessController.doPrivileged(
+ new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ SecurityContextAssociation.clearSecurityContext();
+ return null;
+ }
+ }
+ );
+ }
+ };
+
+ PrincipalInfoAction NON_PRIVILEGED = new PrincipalInfoAction()
+ {
+ public void push(Principal principal, Object credential, Subject subject, String domain)
+ {
+ //ToDo: Get the correct security domain name
+ try
+ {
+ SecurityContext sc = SecurityContextFactory.createSecurityContext(domain);
+ SecurityContextAssociation.setSecurityContext(sc);
+ sc.getUtil().createSubjectInfo(principal, credential, subject);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void pop()
+ {
+ SecurityContextAssociation.clearSecurityContext();
+ }
+ };
+
+ void push(Principal principal, Object credential, Subject subject, String domain);
+ void pop();
+ }
+
+ static void pushSubjectContext(Principal principal, Object credential,
+ Subject subject, String domain)
+ {
+ if(System.getSecurityManager() == null)
+ {
+ PrincipalInfoAction.NON_PRIVILEGED.push(principal, credential, subject, domain);
+ }
+ else
+ {
+ PrincipalInfoAction.PRIVILEGED.push(principal, credential, subject, domain);
+ }
+ }
+ }
Property changes on: trunk/messaging/src/main/org/jboss/jms/server/jbosssx/SecurityActions.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/mq/server/jmx/DummyDestMgr.java
===================================================================
--- trunk/messaging/src/main/org/jboss/mq/server/jmx/DummyDestMgr.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/mq/server/jmx/DummyDestMgr.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,27 +1,27 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.mq.server.jmx;
-
-public class DummyDestMgr implements DummyDestMgrMBean
-{
-
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mq.server.jmx;
+
+public class DummyDestMgr implements DummyDestMgrMBean
+{
+
+}
Property changes on: trunk/messaging/src/main/org/jboss/mq/server/jmx/DummyDestMgr.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/mq/server/jmx/DummyDestMgrMBean.java
===================================================================
--- trunk/messaging/src/main/org/jboss/mq/server/jmx/DummyDestMgrMBean.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/mq/server/jmx/DummyDestMgrMBean.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,31 +1,31 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.mq.server.jmx;
-
-/**
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public interface DummyDestMgrMBean
-{
-
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mq.server.jmx;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public interface DummyDestMgrMBean
+{
+
+}
Property changes on: trunk/messaging/src/main/org/jboss/mq/server/jmx/DummyDestMgrMBean.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/mq/server/jmx/DummySecurityMgr.java
===================================================================
--- trunk/messaging/src/main/org/jboss/mq/server/jmx/DummySecurityMgr.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/mq/server/jmx/DummySecurityMgr.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,27 +1,27 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.mq.server.jmx;
-
-public class DummySecurityMgr implements DummySecurityMgrMBean
-{
-
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mq.server.jmx;
+
+public class DummySecurityMgr implements DummySecurityMgrMBean
+{
+
+}
Property changes on: trunk/messaging/src/main/org/jboss/mq/server/jmx/DummySecurityMgr.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/mq/server/jmx/DummySecurityMgrMBean.java
===================================================================
--- trunk/messaging/src/main/org/jboss/mq/server/jmx/DummySecurityMgrMBean.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/mq/server/jmx/DummySecurityMgrMBean.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,31 +1,31 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.mq.server.jmx;
-
-/**
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public interface DummySecurityMgrMBean
-{
-
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mq.server.jmx;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public interface DummySecurityMgrMBean
+{
+
+}
Property changes on: trunk/messaging/src/main/org/jboss/mq/server/jmx/DummySecurityMgrMBean.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/mq/server/jmx/Queue.java
===================================================================
--- trunk/messaging/src/main/org/jboss/mq/server/jmx/Queue.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/mq/server/jmx/Queue.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,358 +1,358 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.mq.server.jmx;
-
-import java.util.List;
-
-import javax.management.MBeanRegistration;
-import javax.management.MBeanServer;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-
-import org.jboss.jms.server.destination.QueueService;
-import org.jboss.managed.api.ManagedOperation.Impact;
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementOperation;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ViewUse;
-import org.w3c.dom.Element;
-
-/**
- * Portability class that maps the mbean ops onto the
- * org.jboss.jms.server.destination.QueueService.
- *
- * @author Scott.Stark at jboss.org
- * @author Clebert.suconic at jboss.com
- * @version $Revision:$
- */
- at ManagementObject(componentType = @ManagementComponent(type = "JMSDestination", subtype = "Queue"), properties = ManagementProperties.EXPLICIT)
-public class Queue implements MBeanRegistration, QueueMBean {
- private QueueService delegate;
-
- public Queue() {
- delegate = new QueueService();
- }
-
- public Queue(boolean createProgramatically) {
- delegate = new QueueService(createProgramatically);
- }
-
- public void addNotificationListener(NotificationListener listener,
- NotificationFilter filter, Object handback) {
- delegate.addNotificationListener(listener, filter, handback);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#create()
- */
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void create() throws Exception {
- delegate.create();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#destroy()
- */
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void destroy() {
- delegate.destroy();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#getDownCacheSize()
- */
-
-
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The write-cache size, can only be set when queue is stopped")
- public int getDownCacheSize() {
- return delegate.getDownCacheSize();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#getFullSize()
- */
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The in-memory message limit, can only be set when queue is stopped")
- public int getFullSize() {
- return delegate.getFullSize();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#getJNDIName()
- */
-
- @ManagementProperty(use={ViewUse.RUNTIME})
- public String getJNDIName() {
- return delegate.getJNDIName();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#getMessageCount()
- */
- @ManagementProperty(use={ViewUse.STATISTIC})
- public int getMessageCount() throws Exception {
- return delegate.getMessageCount();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#getName()
- */
- @ManagementProperty(use={ViewUse.RUNTIME})
- public String getName() {
- return delegate.getName();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#getPageSize()
- */
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="he paging size, can only be set when queue is stopped")
- public int getPageSize() {
- return delegate.getPageSize();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#getServerPeer()
- */
- @ManagementProperty(use={ViewUse.RUNTIME})
- public ObjectName getServerPeer() {
- return delegate.getServerPeer();
- }
-
- public ObjectName getServiceName() {
- return delegate.getServiceName();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#isCreatedProgrammatically()
- */
- @ManagementProperty(use={ViewUse.STATISTIC})
- public boolean isCreatedProgrammatically() {
- return delegate.isCreatedProgrammatically();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#listMessages(java.lang.String)
- */
- @ManagementOperation(description = "List all mesages with the selector", impact = Impact.ReadOnly)
- public List listMessages(String arg0) throws Exception {
- return delegate.listAllMessages(arg0);
- }
-
- @ManagementOperation(description = "List all mesages", impact = Impact.ReadOnly)
- public List listAllMessages() throws Exception {
- return delegate.listAllMessages();
- }
-
- @ManagementOperation(description = "List all durable mesages", impact = Impact.ReadOnly)
- public List listDurableMessages() throws Exception
- {
- return delegate.listDurableMessages();
- }
-
- @ManagementOperation(description = "List all durable mesages using a selector", impact = Impact.ReadOnly)
- public List listDurableMessages(String selector) throws Exception
- {
- return delegate.listDurableMessages(selector);
- }
-
- @ManagementOperation(description = "List all non durable mesages", impact = Impact.ReadOnly)
- public List listNonDurableMessages() throws Exception
- {
- return delegate.listNonDurableMessages();
- }
-
- @ManagementOperation(description = "List all non durable mesages using a selector", impact = Impact.ReadOnly)
- public List listNonDurableMessages(String selector) throws Exception
- {
- return delegate.listNonDurableMessages(selector);
- }
-
- @ManagementOperation(description = "Reset the message counter", impact = Impact.WriteOnly)
- public void resetMessageCounter() throws Exception
- {
- delegate.resetMessageCounter();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#removeAllMessages()
- */
- @ManagementOperation(description = "Remove all messages in the queue", impact = Impact.WriteOnly)
- public void removeAllMessages() throws Exception {
- delegate.removeAllMessages();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#setDownCacheSize(int)
- */
- public void setDownCacheSize(int arg0) {
- delegate.setDownCacheSize(arg0);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#setFullSize(int)
- */
- public void setFullSize(int arg0) {
- delegate.setFullSize(arg0);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#setJNDIName(java.lang.String)
- */
- public void setJNDIName(String arg0) throws Exception {
- delegate.setJNDIName(arg0);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#setPageSize(int)
- */
- public void setPageSize(int arg0) {
- delegate.setPageSize(arg0);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#setSecurityConfig(org.w3c.dom.Element)
- */
- public void setSecurityConfig(Element arg0) throws Exception {
- delegate.setSecurityConfig(arg0);
- }
-
- public void setSecurityConf(Element arg0) throws Exception {
- delegate.setSecurityConfig(arg0);
- }
-
- public void setSecurityManager(ObjectName arg0) {
- // noop
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#setServerPeer(javax.management.ObjectName)
- */
- public void setServerPeer(ObjectName arg0) {
- delegate.setServerPeer(arg0);
- }
-
- public void setDestinationManager(ObjectName arg0) throws Exception {
- ObjectName peer = new ObjectName("jboss.messaging:service=ServerPeer");
- delegate.setServerPeer(peer);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#start()
- */
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void start() throws Exception {
- delegate.start();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.mq.server.jmx.QueueMBean#stop()
- */
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void stop() {
- delegate.stop();
- }
-
- public void setMessageCounterHistoryDayLimit(int arg0) {
- // noop
- }
-
- @ManagementProperty(use={ViewUse.CONFIGURATION})
- public ObjectName getExpiryDestination()
- {
- return delegate.getExpiryQueue();
- }
-
- public void setExpiryDestination(ObjectName destination)
- {
- try
- {
- delegate.setExpiryQueue(destination);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public String toString() {
- return delegate.toString();
- }
-
- public void postDeregister() {
- delegate.postDeregister();
- }
-
- public void postRegister(Boolean registrationDone) {
- delegate.postRegister(registrationDone);
- }
-
- public void preDeregister() throws Exception {
- delegate.preDeregister();
- }
-
- public ObjectName preRegister(MBeanServer server, ObjectName name)
- throws Exception {
- return delegate.preRegister(server, name);
- }
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mq.server.jmx;
+
+import java.util.List;
+
+import javax.management.MBeanRegistration;
+import javax.management.MBeanServer;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+
+import org.jboss.jms.server.destination.QueueService;
+import org.jboss.managed.api.ManagedOperation.Impact;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementOperation;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.managed.api.annotation.ViewUse;
+import org.w3c.dom.Element;
+
+/**
+ * Portability class that maps the mbean ops onto the
+ * org.jboss.jms.server.destination.QueueService.
+ *
+ * @author Scott.Stark at jboss.org
+ * @author Clebert.suconic at jboss.com
+ * @version $Revision:$
+ */
+ at ManagementObject(componentType = @ManagementComponent(type = "JMSDestination", subtype = "Queue"), properties = ManagementProperties.EXPLICIT)
+public class Queue implements MBeanRegistration, QueueMBean {
+ private QueueService delegate;
+
+ public Queue() {
+ delegate = new QueueService();
+ }
+
+ public Queue(boolean createProgramatically) {
+ delegate = new QueueService(createProgramatically);
+ }
+
+ public void addNotificationListener(NotificationListener listener,
+ NotificationFilter filter, Object handback) {
+ delegate.addNotificationListener(listener, filter, handback);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#create()
+ */
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void create() throws Exception {
+ delegate.create();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#destroy()
+ */
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void destroy() {
+ delegate.destroy();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#getDownCacheSize()
+ */
+
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The write-cache size, can only be set when queue is stopped")
+ public int getDownCacheSize() {
+ return delegate.getDownCacheSize();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#getFullSize()
+ */
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The in-memory message limit, can only be set when queue is stopped")
+ public int getFullSize() {
+ return delegate.getFullSize();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#getJNDIName()
+ */
+
+ @ManagementProperty(use={ViewUse.RUNTIME})
+ public String getJNDIName() {
+ return delegate.getJNDIName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#getMessageCount()
+ */
+ @ManagementProperty(use={ViewUse.STATISTIC})
+ public int getMessageCount() throws Exception {
+ return delegate.getMessageCount();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#getName()
+ */
+ @ManagementProperty(use={ViewUse.RUNTIME})
+ public String getName() {
+ return delegate.getName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#getPageSize()
+ */
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="he paging size, can only be set when queue is stopped")
+ public int getPageSize() {
+ return delegate.getPageSize();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#getServerPeer()
+ */
+ @ManagementProperty(use={ViewUse.RUNTIME})
+ public ObjectName getServerPeer() {
+ return delegate.getServerPeer();
+ }
+
+ public ObjectName getServiceName() {
+ return delegate.getServiceName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#isCreatedProgrammatically()
+ */
+ @ManagementProperty(use={ViewUse.STATISTIC})
+ public boolean isCreatedProgrammatically() {
+ return delegate.isCreatedProgrammatically();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#listMessages(java.lang.String)
+ */
+ @ManagementOperation(description = "List all mesages with the selector", impact = Impact.ReadOnly)
+ public List listMessages(String arg0) throws Exception {
+ return delegate.listAllMessages(arg0);
+ }
+
+ @ManagementOperation(description = "List all mesages", impact = Impact.ReadOnly)
+ public List listAllMessages() throws Exception {
+ return delegate.listAllMessages();
+ }
+
+ @ManagementOperation(description = "List all durable mesages", impact = Impact.ReadOnly)
+ public List listDurableMessages() throws Exception
+ {
+ return delegate.listDurableMessages();
+ }
+
+ @ManagementOperation(description = "List all durable mesages using a selector", impact = Impact.ReadOnly)
+ public List listDurableMessages(String selector) throws Exception
+ {
+ return delegate.listDurableMessages(selector);
+ }
+
+ @ManagementOperation(description = "List all non durable mesages", impact = Impact.ReadOnly)
+ public List listNonDurableMessages() throws Exception
+ {
+ return delegate.listNonDurableMessages();
+ }
+
+ @ManagementOperation(description = "List all non durable mesages using a selector", impact = Impact.ReadOnly)
+ public List listNonDurableMessages(String selector) throws Exception
+ {
+ return delegate.listNonDurableMessages(selector);
+ }
+
+ @ManagementOperation(description = "Reset the message counter", impact = Impact.WriteOnly)
+ public void resetMessageCounter() throws Exception
+ {
+ delegate.resetMessageCounter();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#removeAllMessages()
+ */
+ @ManagementOperation(description = "Remove all messages in the queue", impact = Impact.WriteOnly)
+ public void removeAllMessages() throws Exception {
+ delegate.removeAllMessages();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#setDownCacheSize(int)
+ */
+ public void setDownCacheSize(int arg0) {
+ delegate.setDownCacheSize(arg0);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#setFullSize(int)
+ */
+ public void setFullSize(int arg0) {
+ delegate.setFullSize(arg0);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#setJNDIName(java.lang.String)
+ */
+ public void setJNDIName(String arg0) throws Exception {
+ delegate.setJNDIName(arg0);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#setPageSize(int)
+ */
+ public void setPageSize(int arg0) {
+ delegate.setPageSize(arg0);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#setSecurityConfig(org.w3c.dom.Element)
+ */
+ public void setSecurityConfig(Element arg0) throws Exception {
+ delegate.setSecurityConfig(arg0);
+ }
+
+ public void setSecurityConf(Element arg0) throws Exception {
+ delegate.setSecurityConfig(arg0);
+ }
+
+ public void setSecurityManager(ObjectName arg0) {
+ // noop
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#setServerPeer(javax.management.ObjectName)
+ */
+ public void setServerPeer(ObjectName arg0) {
+ delegate.setServerPeer(arg0);
+ }
+
+ public void setDestinationManager(ObjectName arg0) throws Exception {
+ ObjectName peer = new ObjectName("jboss.messaging:service=ServerPeer");
+ delegate.setServerPeer(peer);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#start()
+ */
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void start() throws Exception {
+ delegate.start();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.mq.server.jmx.QueueMBean#stop()
+ */
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void stop() {
+ delegate.stop();
+ }
+
+ public void setMessageCounterHistoryDayLimit(int arg0) {
+ // noop
+ }
+
+ @ManagementProperty(use={ViewUse.CONFIGURATION})
+ public ObjectName getExpiryDestination()
+ {
+ return delegate.getExpiryQueue();
+ }
+
+ public void setExpiryDestination(ObjectName destination)
+ {
+ try
+ {
+ delegate.setExpiryQueue(destination);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public String toString() {
+ return delegate.toString();
+ }
+
+ public void postDeregister() {
+ delegate.postDeregister();
+ }
+
+ public void postRegister(Boolean registrationDone) {
+ delegate.postRegister(registrationDone);
+ }
+
+ public void preDeregister() throws Exception {
+ delegate.preDeregister();
+ }
+
+ public ObjectName preRegister(MBeanServer server, ObjectName name)
+ throws Exception {
+ return delegate.preRegister(server, name);
+ }
+}
Property changes on: trunk/messaging/src/main/org/jboss/mq/server/jmx/Queue.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/mq/server/jmx/QueueMBean.java
===================================================================
--- trunk/messaging/src/main/org/jboss/mq/server/jmx/QueueMBean.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/mq/server/jmx/QueueMBean.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,88 +1,88 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.mq.server.jmx;
-
-import java.util.List;
-
-import javax.management.ObjectName;
-
-import org.w3c.dom.Element;
-
-public interface QueueMBean
-{
-
- public void create() throws Exception;
-
- public void destroy();
-
- public int getDownCacheSize();
-
- public int getFullSize();
-
- public String getJNDIName();
-
- public int getMessageCount() throws Exception;
-
- public String getName();
-
- public int getPageSize();
-
- public ObjectName getServerPeer();
-
- public boolean isCreatedProgrammatically();
-
- public List listMessages(String arg0) throws Exception;
-
- public void removeAllMessages() throws Exception;
-
- public void setDownCacheSize(int arg0);
-
- public void setFullSize(int arg0);
-
- public void setJNDIName(String arg0) throws Exception;
-
- public void setPageSize(int arg0);
-
- public void setSecurityConfig(Element arg0) throws Exception;
- public void setSecurityConf(Element arg0) throws Exception;
- public void setSecurityManager(ObjectName arg0);
-
- public void setServerPeer(ObjectName arg0);
- public void setDestinationManager(ObjectName arg0) throws Exception;
-
- /**
- * Returns the expiry destination.
- */
- public ObjectName getExpiryDestination();
-
- /**
- * Sets the expiry destination.
- */
- public void setExpiryDestination(ObjectName destination);
-
- public void setMessageCounterHistoryDayLimit(int arg0);
-
- public void start() throws Exception;
-
- public void stop();
-
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mq.server.jmx;
+
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.w3c.dom.Element;
+
+public interface QueueMBean
+{
+
+ public void create() throws Exception;
+
+ public void destroy();
+
+ public int getDownCacheSize();
+
+ public int getFullSize();
+
+ public String getJNDIName();
+
+ public int getMessageCount() throws Exception;
+
+ public String getName();
+
+ public int getPageSize();
+
+ public ObjectName getServerPeer();
+
+ public boolean isCreatedProgrammatically();
+
+ public List listMessages(String arg0) throws Exception;
+
+ public void removeAllMessages() throws Exception;
+
+ public void setDownCacheSize(int arg0);
+
+ public void setFullSize(int arg0);
+
+ public void setJNDIName(String arg0) throws Exception;
+
+ public void setPageSize(int arg0);
+
+ public void setSecurityConfig(Element arg0) throws Exception;
+ public void setSecurityConf(Element arg0) throws Exception;
+ public void setSecurityManager(ObjectName arg0);
+
+ public void setServerPeer(ObjectName arg0);
+ public void setDestinationManager(ObjectName arg0) throws Exception;
+
+ /**
+ * Returns the expiry destination.
+ */
+ public ObjectName getExpiryDestination();
+
+ /**
+ * Sets the expiry destination.
+ */
+ public void setExpiryDestination(ObjectName destination);
+
+ public void setMessageCounterHistoryDayLimit(int arg0);
+
+ public void start() throws Exception;
+
+ public void stop();
+
}
\ No newline at end of file
Property changes on: trunk/messaging/src/main/org/jboss/mq/server/jmx/QueueMBean.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/mq/server/jmx/Topic.java
===================================================================
--- trunk/messaging/src/main/org/jboss/mq/server/jmx/Topic.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/mq/server/jmx/Topic.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,336 +1,336 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.mq.server.jmx;
-
-import java.util.List;
-
-import javax.management.MBeanRegistration;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.w3c.dom.Element;
-import org.jboss.jms.server.destination.TopicService;
-import org.jboss.managed.api.ManagedOperation.Impact;
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementOperation;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ViewUse;
-
-/**
- * Portability class that maps the mbean ops onto the org.jboss.jms.server.destination.TopicService.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
- at ManagementObject(componentType = @ManagementComponent(type = "JMSDestination", subtype = "Topic"), properties = ManagementProperties.EXPLICIT)
-public class Topic
- implements MBeanRegistration, TopicMBean
-{
- private TopicService delegate;
-
- public Topic()
- {
- delegate = new TopicService();
- }
- public Topic(boolean createProgramatically)
- {
- delegate = new TopicService(createProgramatically);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#create()
- */
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void create() throws Exception
- {
- delegate.create();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#destroy()
- */
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void destroy()
- {
- delegate.destroy();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#getDownCacheSize()
- */
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The write-cache size, can only be set when queue is stopped")
- public int getDownCacheSize()
- {
- return delegate.getDownCacheSize();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#getFullSize()
- */
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The in-memory message limit, can only be set when queue is stopped")
- public int getFullSize()
- {
- return delegate.getFullSize();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#getJNDIName()
- */
- @ManagementProperty(use={ViewUse.RUNTIME})
- public String getJNDIName()
- {
- return delegate.getJNDIName();
- }
-
- @ManagementOperation(description = "List all non durable mesages", impact = Impact.ReadOnly)
- public List listNonDurableMessages(String subscriptionId) throws Exception
- {
- return delegate.listNonDurableMessages(subscriptionId);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#getName()
- */
- @ManagementProperty(use={ViewUse.RUNTIME})
- public String getName()
- {
- return delegate.getName();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#getPageSize()
- */
- @ManagementProperty(use={ViewUse.CONFIGURATION}, description="he paging size, can only be set when queue is stopped")
- public int getPageSize()
- {
- return delegate.getPageSize();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#getServer()
- */
- public MBeanServer getServer()
- {
- return delegate.getServer();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#getServerPeer()
- */
- public ObjectName getServerPeer()
- {
- return delegate.getServerPeer();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#isCreatedProgrammatically()
- */
- @ManagementProperty(use={ViewUse.STATISTIC})
- public boolean isCreatedProgrammatically()
- {
- return delegate.isCreatedProgrammatically();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#listMessagesDurableSub(java.lang.String, java.lang.String, java.lang.String)
- */
- @ManagementOperation(description = "List all durable mesages", impact = Impact.ReadOnly)
- public List listMessagesDurableSub(String arg0, String arg1, String arg2) throws Exception
- {
- return delegate.listDurableMessages(arg0, arg1);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#listMessagesNonDurableSub(long, java.lang.String)
- */
- @ManagementOperation(description = "List all non durable mesages", impact = Impact.ReadOnly)
- public List listMessagesNonDurableSub(long arg0, String arg1) throws Exception
- {
- return delegate.listNonDurableMessages(arg1);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#listSubscriptionsAsText()
- */
- @ManagementOperation(description = "List subscriptions on text", impact = Impact.ReadOnly)
- public String listSubscriptionsAsText() throws Exception
- {
- return delegate.listAllSubscriptionsAsHTML();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#listSubscriptionsAsText(boolean)
- */
- @ManagementOperation(description = "List subscriptions on text", impact = Impact.ReadOnly)
- public String listSubscriptionsAsText(boolean arg0) throws Exception
- {
- return delegate.listAllSubscriptionsAsHTML();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#removeAllMessages()
- */
- @ManagementOperation(description = "Remove all the messages on the queue DB", impact = Impact.WriteOnly)
- public void removeAllMessages() throws Exception
- {
- delegate.removeAllMessages();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#setDownCacheSize(int)
- */
- public void setDownCacheSize(int arg0)
- {
- delegate.setDownCacheSize(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#setFullSize(int)
- */
- public void setFullSize(int arg0)
- {
- delegate.setFullSize(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#setJNDIName(java.lang.String)
- */
- public void setJNDIName(String arg0) throws Exception
- {
- delegate.setJNDIName(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#setPageSize(int)
- */
- public void setPageSize(int arg0)
- {
- delegate.setPageSize(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#setSecurityConfig(org.w3c.dom.Element)
- */
- public void setSecurityConfig(Element arg0) throws Exception
- {
- delegate.setSecurityConfig(arg0);
- }
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#setSecurityConf(org.w3c.dom.Element)
- */
- public void setSecurityConf(Element arg0) throws Exception
- {
- delegate.setSecurityConfig(arg0);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#setSecurityManager(javax.management.ObjectName)
- */
- public void setSecurityManager(ObjectName arg0)
- {
- // noop
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#setServerPeer(javax.management.ObjectName)
- */
- public void setServerPeer(ObjectName arg0)
- {
- delegate.setServerPeer(arg0);
- }
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#setDestinationManager(javax.management.ObjectName)
- */
- public void setDestinationManager(ObjectName arg0) throws Exception
- {
- ObjectName peer = new ObjectName("jboss.messaging:service=ServerPeer");
- delegate.setServerPeer(peer);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#start()
- */
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void start() throws Exception
- {
- delegate.start();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#stop()
- */
- @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
- public void stop()
- {
- delegate.stop();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#subscriptionCount()
- */
- public int subscriptionCount() throws Exception
- {
- return delegate.getAllSubscriptionsCount();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.mq.server.jmx.TopicMBean#subscriptionCount(boolean)
- */
- public int subscriptionCount(boolean arg0) throws Exception
- {
- return arg0 ? delegate.getDurableSubscriptionsCount() : delegate.getNonDurableSubscriptionsCount();
- }
-
- public ObjectName getExpiryDestination()
- {
- return null;
- }
- public void setExpiryDestination(ObjectName destination)
- {
- System.err.println("There is no ExpiryDestination currently");
- }
-
- public String toString()
- {
- return delegate.toString();
- }
-
- public void postDeregister()
- {
- delegate.postDeregister();
- }
- public void postRegister(Boolean registrationDone)
- {
- delegate.postRegister(registrationDone);
- }
- public void preDeregister() throws Exception
- {
- delegate.preDeregister();
- }
- public ObjectName preRegister(MBeanServer server, ObjectName name)
- throws Exception
- {
- return delegate.preRegister(server, name);
- }
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mq.server.jmx;
+
+import java.util.List;
+
+import javax.management.MBeanRegistration;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.w3c.dom.Element;
+import org.jboss.jms.server.destination.TopicService;
+import org.jboss.managed.api.ManagedOperation.Impact;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementOperation;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.managed.api.annotation.ViewUse;
+
+/**
+ * Portability class that maps the mbean ops onto the org.jboss.jms.server.destination.TopicService.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+ at ManagementObject(componentType = @ManagementComponent(type = "JMSDestination", subtype = "Topic"), properties = ManagementProperties.EXPLICIT)
+public class Topic
+ implements MBeanRegistration, TopicMBean
+{
+ private TopicService delegate;
+
+ public Topic()
+ {
+ delegate = new TopicService();
+ }
+ public Topic(boolean createProgramatically)
+ {
+ delegate = new TopicService(createProgramatically);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#create()
+ */
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void create() throws Exception
+ {
+ delegate.create();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#destroy()
+ */
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void destroy()
+ {
+ delegate.destroy();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#getDownCacheSize()
+ */
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The write-cache size, can only be set when queue is stopped")
+ public int getDownCacheSize()
+ {
+ return delegate.getDownCacheSize();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#getFullSize()
+ */
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="The in-memory message limit, can only be set when queue is stopped")
+ public int getFullSize()
+ {
+ return delegate.getFullSize();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#getJNDIName()
+ */
+ @ManagementProperty(use={ViewUse.RUNTIME})
+ public String getJNDIName()
+ {
+ return delegate.getJNDIName();
+ }
+
+ @ManagementOperation(description = "List all non durable mesages", impact = Impact.ReadOnly)
+ public List listNonDurableMessages(String subscriptionId) throws Exception
+ {
+ return delegate.listNonDurableMessages(subscriptionId);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#getName()
+ */
+ @ManagementProperty(use={ViewUse.RUNTIME})
+ public String getName()
+ {
+ return delegate.getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#getPageSize()
+ */
+ @ManagementProperty(use={ViewUse.CONFIGURATION}, description="he paging size, can only be set when queue is stopped")
+ public int getPageSize()
+ {
+ return delegate.getPageSize();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#getServer()
+ */
+ public MBeanServer getServer()
+ {
+ return delegate.getServer();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#getServerPeer()
+ */
+ public ObjectName getServerPeer()
+ {
+ return delegate.getServerPeer();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#isCreatedProgrammatically()
+ */
+ @ManagementProperty(use={ViewUse.STATISTIC})
+ public boolean isCreatedProgrammatically()
+ {
+ return delegate.isCreatedProgrammatically();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#listMessagesDurableSub(java.lang.String, java.lang.String, java.lang.String)
+ */
+ @ManagementOperation(description = "List all durable mesages", impact = Impact.ReadOnly)
+ public List listMessagesDurableSub(String arg0, String arg1, String arg2) throws Exception
+ {
+ return delegate.listDurableMessages(arg0, arg1);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#listMessagesNonDurableSub(long, java.lang.String)
+ */
+ @ManagementOperation(description = "List all non durable mesages", impact = Impact.ReadOnly)
+ public List listMessagesNonDurableSub(long arg0, String arg1) throws Exception
+ {
+ return delegate.listNonDurableMessages(arg1);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#listSubscriptionsAsText()
+ */
+ @ManagementOperation(description = "List subscriptions on text", impact = Impact.ReadOnly)
+ public String listSubscriptionsAsText() throws Exception
+ {
+ return delegate.listAllSubscriptionsAsHTML();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#listSubscriptionsAsText(boolean)
+ */
+ @ManagementOperation(description = "List subscriptions on text", impact = Impact.ReadOnly)
+ public String listSubscriptionsAsText(boolean arg0) throws Exception
+ {
+ return delegate.listAllSubscriptionsAsHTML();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#removeAllMessages()
+ */
+ @ManagementOperation(description = "Remove all the messages on the queue DB", impact = Impact.WriteOnly)
+ public void removeAllMessages() throws Exception
+ {
+ delegate.removeAllMessages();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#setDownCacheSize(int)
+ */
+ public void setDownCacheSize(int arg0)
+ {
+ delegate.setDownCacheSize(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#setFullSize(int)
+ */
+ public void setFullSize(int arg0)
+ {
+ delegate.setFullSize(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#setJNDIName(java.lang.String)
+ */
+ public void setJNDIName(String arg0) throws Exception
+ {
+ delegate.setJNDIName(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#setPageSize(int)
+ */
+ public void setPageSize(int arg0)
+ {
+ delegate.setPageSize(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#setSecurityConfig(org.w3c.dom.Element)
+ */
+ public void setSecurityConfig(Element arg0) throws Exception
+ {
+ delegate.setSecurityConfig(arg0);
+ }
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#setSecurityConf(org.w3c.dom.Element)
+ */
+ public void setSecurityConf(Element arg0) throws Exception
+ {
+ delegate.setSecurityConfig(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#setSecurityManager(javax.management.ObjectName)
+ */
+ public void setSecurityManager(ObjectName arg0)
+ {
+ // noop
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#setServerPeer(javax.management.ObjectName)
+ */
+ public void setServerPeer(ObjectName arg0)
+ {
+ delegate.setServerPeer(arg0);
+ }
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#setDestinationManager(javax.management.ObjectName)
+ */
+ public void setDestinationManager(ObjectName arg0) throws Exception
+ {
+ ObjectName peer = new ObjectName("jboss.messaging:service=ServerPeer");
+ delegate.setServerPeer(peer);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#start()
+ */
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void start() throws Exception
+ {
+ delegate.start();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#stop()
+ */
+ @ManagementOperation(description = "Service lifecycle operation", impact = Impact.WriteOnly)
+ public void stop()
+ {
+ delegate.stop();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#subscriptionCount()
+ */
+ public int subscriptionCount() throws Exception
+ {
+ return delegate.getAllSubscriptionsCount();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.mq.server.jmx.TopicMBean#subscriptionCount(boolean)
+ */
+ public int subscriptionCount(boolean arg0) throws Exception
+ {
+ return arg0 ? delegate.getDurableSubscriptionsCount() : delegate.getNonDurableSubscriptionsCount();
+ }
+
+ public ObjectName getExpiryDestination()
+ {
+ return null;
+ }
+ public void setExpiryDestination(ObjectName destination)
+ {
+ System.err.println("There is no ExpiryDestination currently");
+ }
+
+ public String toString()
+ {
+ return delegate.toString();
+ }
+
+ public void postDeregister()
+ {
+ delegate.postDeregister();
+ }
+ public void postRegister(Boolean registrationDone)
+ {
+ delegate.postRegister(registrationDone);
+ }
+ public void preDeregister() throws Exception
+ {
+ delegate.preDeregister();
+ }
+ public ObjectName preRegister(MBeanServer server, ObjectName name)
+ throws Exception
+ {
+ return delegate.preRegister(server, name);
+ }
+}
Property changes on: trunk/messaging/src/main/org/jboss/mq/server/jmx/Topic.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/messaging/src/main/org/jboss/mq/server/jmx/TopicMBean.java
===================================================================
--- trunk/messaging/src/main/org/jboss/mq/server/jmx/TopicMBean.java 2008-11-14 15:08:30 UTC (rev 81064)
+++ trunk/messaging/src/main/org/jboss/mq/server/jmx/TopicMBean.java 2008-11-14 15:09:16 UTC (rev 81065)
@@ -1,85 +1,85 @@
-package org.jboss.mq.server.jmx;
-
-import java.util.List;
-
-import javax.jms.InvalidSelectorException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.w3c.dom.Element;
-
-public interface TopicMBean
-{
-
- public abstract void create() throws Exception;
-
- public abstract void destroy();
-
- public abstract int getDownCacheSize();
-
- public abstract int getFullSize();
-
- public abstract String getJNDIName();
-
- public List listNonDurableMessages(String subscriptionId) throws Exception;
-
- public abstract String getName();
-
- public abstract int getPageSize();
-
- public abstract MBeanServer getServer();
-
- public abstract ObjectName getServerPeer();
-
- public abstract boolean isCreatedProgrammatically();
-
- public abstract List listMessagesDurableSub(String arg0, String arg1,
- String arg2) throws Exception;
-
- public abstract List listMessagesNonDurableSub(long arg0, String arg1)
- throws Exception;
-
- public abstract String listSubscriptionsAsText() throws Exception;
-
- public abstract String listSubscriptionsAsText(boolean arg0)
- throws Exception;
-
- public abstract void removeAllMessages() throws Exception;
-
- public abstract void setDownCacheSize(int arg0);
-
- public abstract void setFullSize(int arg0);
-
- public abstract void setJNDIName(String arg0) throws Exception;
-
- public abstract void setPageSize(int arg0);
-
- public abstract void setSecurityConfig(Element arg0) throws Exception;
-
- public abstract void setSecurityConf(Element arg0) throws Exception;
-
- public abstract void setSecurityManager(ObjectName arg0);
-
- public abstract void setServerPeer(ObjectName arg0);
-
- public abstract void setDestinationManager(ObjectName arg0) throws Exception;
-
- /**
- * Returns the expiry destination.
- */
- public ObjectName getExpiryDestination();
-
- /**
- * Sets the expiry destination.
- */
- public void setExpiryDestination(ObjectName destination);
-
- public abstract void start() throws Exception;
-
- public abstract void stop();
-
- public abstract int subscriptionCount() throws Exception;
-
- public abstract int subscriptionCount(boolean arg0) throws Exception;
-
+package org.jboss.mq.server.jmx;
+
+import java.util.List;
+
+import javax.jms.InvalidSelectorException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.w3c.dom.Element;
+
+public interface TopicMBean
+{
+
+ public abstract void create() throws Exception;
+
+ public abstract void destroy();
+
+ public abstract int getDownCacheSize();
+
+ public abstract int getFullSize();
+
+ public abstract String getJNDIName();
+
+ public List listNonDurableMessages(String subscriptionId) throws Exception;
+
+ public abstract String getName();
+
+ public abstract int getPageSize();
+
+ public abstract MBeanServer getServer();
+
+ public abstract ObjectName getServerPeer();
+
+ public abstract boolean isCreatedProgrammatically();
+
+ public abstract List listMessagesDurableSub(String arg0, String arg1,
+ String arg2) throws Exception;
+
+ public abstract List listMessagesNonDurableSub(long arg0, String arg1)
+ throws Exception;
+
+ public abstract String listSubscriptionsAsText() throws Exception;
+
+ public abstract String listSubscriptionsAsText(boolean arg0)
+ throws Exception;
+
+ public abstract void removeAllMessages() throws Exception;
+
+ public abstract void setDownCacheSize(int arg0);
+
+ public abstract void setFullSize(int arg0);
+
+ public abstract void setJNDIName(String arg0) throws Exception;
+
+ public abstract void setPageSize(int arg0);
+
+ public abstract void setSecurityConfig(Element arg0) throws Exception;
+
+ public abstract void setSecurityConf(Element arg0) throws Exception;
+
+ public abstract void setSecurityManager(ObjectName arg0);
+
+ public abstract void setServerPeer(ObjectName arg0);
+
+ public abstract void setDestinationManager(ObjectName arg0) throws Exception;
+
+ /**
+ * Returns the expiry destination.
+ */
+ public ObjectName getExpiryDestination();
+
+ /**
+ * Sets the expiry destination.
+ */
+ public void setExpiryDestination(ObjectName destination);
+
+ public abstract void start() throws Exception;
+
+ public abstract void stop();
+
+ public abstract int subscriptionCount() throws Exception;
+
+ public abstract int subscriptionCount(boolean arg0) throws Exception;
+
}
\ No newline at end of file
Property changes on: trunk/messaging/src/main/org/jboss/mq/server/jmx/TopicMBean.java
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the jboss-cvs-commits
mailing list