modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java | 42 ++++ modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 96 ---------- 2 files changed, 42 insertions(+), 96 deletions(-)
New commits: commit c52b96d87f9e504fbc594a08f08f76239c5435e4 Author: Heiko W. Rupp hwr@redhat.com Date: Tue May 29 21:59:59 2012 +0200
BZ 826228 . Suppress AS7-ISPN type if JDG is deployed. Also remove JDG types from AS7-descriptor
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java index d267bb5..deec7a3 100644 --- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java +++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java @@ -31,6 +31,7 @@ import org.codehaus.jackson.map.ObjectMapper;
import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; @@ -84,6 +85,11 @@ public class SubsystemDiscovery implements ResourceDiscoveryComponent<BaseCompon lookForChildren = true; }
+ if (isIspnForJDG(context, confPath)) { + log.debug("We have JDG as child, ignoring the {JBossAS7}Infinispan type"); + return details; + } + // Construct the full path including the parent String path; String parentPath = parentComponent.getPath(); @@ -184,4 +190,40 @@ public class SubsystemDiscovery implements ResourceDiscoveryComponent<BaseCompon return details; }
+ private boolean isIspnForJDG(ResourceDiscoveryContext<BaseComponent<?>> context, String confPath) { + + // Check if this is ISPN + if (!"subsystem=infinispan".equals(confPath)) + return false; + + ResourceType ourType = context.getResourceType(); + if (ourType.getPlugin().equals("JDG")) + return false; + + if (!ourType.getName().equals("Infinispan")) + return false; + + // So we are {JBossAS7}Infinispan + Set<ResourceType> parentTypes = ourType.getParentResourceTypes(); + ResourceType parent = null; + for (ResourceType type : parentTypes) { + if (type.getName().equals("JBossAS7 Standalone Server") && type.getPlugin().equals("JBossAS7")) { + parent = type; + break; + } + } + if (parent==null) + return false; + + // So we are as7/eap and need to check now if we have a JDG plugin's ISPN resource as child + boolean found = false; + for (ResourceType type: parent.getChildResourceTypes()) { + if (type.getPlugin().equals("JDG") && type.getName().equals("Infinispan")) { + found = true; + } + } + + return found; + } + } diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml index 7ce54e9..dd36061 100644 --- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml @@ -7928,102 +7928,6 @@
</service>
- - <service name="Datagrid Endpoints" - discovery="SubsystemDiscovery" - class="BaseComponent" - singleton="true"> - - <runs-inside> - <parent-resource-type name="JBossAS7 Standalone Server" plugin="&pluginName;"/> - </runs-inside> - - <plugin-configuration> - <c:simple-property name="path" readOnly="true" default="subsystem=endpoint"/> - </plugin-configuration> - - - <service name="Hotrod Connector" - discovery="SubsystemDiscovery" - class="BaseComponent" - createDeletePolicy="both" - creationDataType="configuration"> - - <plugin-configuration> - <c:simple-property name="path" readOnly="true" default="hotrod-connector"/> - </plugin-configuration> - - <resource-configuration> - <!--<c:simple-property name="name" required="false" type="string" readOnly="true" description="The name to give to this connector"/>--> - <c:simple-property name="cache-container" required="true" type="string" readOnly="true" description="The cache container to use"> - <c:option-source target="resource" expression="type='^Cache Container$'"/> - </c:simple-property> - <c:simple-property name="socket-binding" required="true" type="string" readOnly="true" description="The socket binding to use for this connector"> - <c:option-source target="configuration" expression="*/socket-binding=name:type=SocketBindingGroup"/> - </c:simple-property> - <c:simple-property name="worker-threads" required="false" type="integer" readOnly="true" description="The number of worker threads to use for this connector"/> - <c:simple-property name="idle-timeout" required="false" type="long" readOnly="true" description="The timeout for idle connections"/> - <c:simple-property name="tcp-nodelay" required="false" type="boolean" readOnly="true" description="Whether to use TCP NO_DELAY"/> - <c:simple-property name="receive-buffer-size" required="false" type="long" readOnly="true" description="Size of the receive buffer"/> - <c:simple-property name="send-buffer-size" required="false" type="long" readOnly="true" description="Size of the send buffer"/> - <!-- TODO add topology state transfer --> - </resource-configuration> - - </service> - - <service name="Memcached Connector" - discovery="SubsystemDiscovery" - class="BaseComponent" - createDeletePolicy="both" - creationDataType="configuration"> - - <plugin-configuration> - <c:simple-property name="path" readOnly="true" default="memcached-connector"/> - </plugin-configuration> - - <resource-configuration> - <!--<c:simple-property name="name" required="false" type="string" readOnly="true" description="The name to give to this connector"/>--> - <c:simple-property name="cache-container" required="true" type="string" readOnly="true" description="The cache container to use"> - <c:option-source target="resource" expression="type='^Cache Container$'"/> - </c:simple-property> - <c:simple-property name="socket-binding" required="true" type="string" readOnly="true" description="The socket binding to use for this connector"> - <c:option-source target="configuration" expression="*/socket-binding=name:type=SocketBindingGroup"/> - </c:simple-property> - <c:simple-property name="worker-threads" required="false" type="integer" readOnly="true" description="The number of worker threads to use for this connector"/> - <c:simple-property name="idle-timeout" required="false" type="long" readOnly="true" description="The timeout for idle connections"/> - <c:simple-property name="tcp-nodelay" required="false" type="boolean" readOnly="true" description="Whether to use TCP NO_DELAY"/> - <c:simple-property name="receive-buffer-size" required="false" type="long" readOnly="true" description="Size of the receive buffer"/> - <c:simple-property name="send-buffer-size" required="false" type="long" readOnly="true" description="Size of the send buffer"/> - <!-- TODO add topology state transfer --> - </resource-configuration> - - </service> - - <service name="REST Connector" - discovery="SubsystemDiscovery" - class="BaseComponent" - createDeletePolicy="both" - creationDataType="configuration"> - - <plugin-configuration> - <c:simple-property name="path" readOnly="true" default="rest-connector"/> - </plugin-configuration> - - <resource-configuration> - <!--<c:simple-property name="name" required="false" type="string" readOnly="true" description="The name to give to this connector"/>--> - <c:simple-property name="cache-container" required="true" type="string" readOnly="true" description="The cache container to use"> - <c:option-source target="resource" expression="type='^Cache Container'"/> - </c:simple-property> - <c:simple-property name="virtual-server" required="false" type="string" readOnly="true" description="The virtual server on which the REST connector should be published"> - <c:option-source target="resource" expression="type=VHost"/> - </c:simple-property> - <c:simple-property name="context-path" required="false" type="string" readOnly="true" description="The context path on which the REST connector should be published"/> - </resource-configuration> - </service> - - </service> - - <service name="Webservices" discovery="SubsystemDiscovery" class="WebservicesComponent"
rhq-commits@lists.fedorahosted.org