[jboss-cvs] JBossAS SVN: r110875 - in projects/jboss-jca/trunk/rhq/src: main/resources/META-INF and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Mar 10 04:26:32 EST 2011
Author: jeff.zhang
Date: 2011-03-10 04:26:32 -0500 (Thu, 10 Mar 2011)
New Revision: 110875
Added:
projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AoResourceComponent.java
projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AoResourceDiscoveryComponent.java
projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/McfResourceComponent.java
projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/McfResourceDiscoveryComponent.java
projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/RarResourceComponent.java
projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/RarResourceDiscoveryComponent.java
Removed:
projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceComponent.java
projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceDiscoveryComponent.java
projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceComponent.java
projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceDiscoveryComponent.java
projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceComponent.java
projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceDiscoveryComponent.java
Modified:
projects/jboss-jca/trunk/rhq/src/main/resources/META-INF/rhq-plugin.xml
projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/PluginDescriptorTestCase.java
Log:
[JBJCA-500] shorten class name and change config in the plugin desc file
Deleted: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceComponent.java 2011-03-10 06:22:46 UTC (rev 110874)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceComponent.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.jca.rhq.ra;
-
-import org.jboss.jca.core.api.management.AdminObject;
-import org.jboss.jca.core.api.management.ConfigProperty;
-import org.jboss.jca.core.api.management.Connector;
-import org.jboss.jca.core.api.management.ManagementRepository;
-import org.jboss.jca.rhq.core.AbstractResourceComponent;
-import org.jboss.jca.rhq.core.ManagementRepositoryManager;
-import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
-
-import java.util.List;
-
-import org.jboss.logging.Logger;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertyList;
-
-/**
- * Represent Admin Object in JCA container.
- *
- * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
- * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
- */
-public class AdminObjectResourceComponent extends AbstractResourceComponent
-{
- /** log */
- private static final Logger logger = Logger.getLogger(AdminObjectResourceComponent.class);
-
- /**
- * loadResourceConfiguration
- *
- * @return Configuration configuration
- * @throws Exception exception
- */
- @Override
- public Configuration loadResourceConfiguration() throws Exception
- {
-
- Configuration config = new Configuration();
-
- ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
- Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, getRarUniqueId());
- String jcaClsName = getJCAClassName();
-
- for (AdminObject ao : connector.getAdminObjects())
- {
- Object obj = ao.getAdminObject();
- Class<?> aoCls = obj.getClass();
- if (aoCls.getName().equals(jcaClsName))
- {
- logger.debug("Class Name is: " + jcaClsName);
- List<ConfigProperty> aoConfigProps = ao.getConfigProperties();
- PropertyList configList = getConfigPropertiesList(obj, aoConfigProps);
- config.put(configList);
- break;
- }
- }
- return config;
- }
-}
Deleted: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceDiscoveryComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceDiscoveryComponent.java 2011-03-10 06:22:46 UTC (rev 110874)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceDiscoveryComponent.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.jca.rhq.ra;
-
-import org.jboss.jca.core.api.management.AdminObject;
-import org.jboss.jca.core.api.management.Connector;
-import org.jboss.jca.core.api.management.ManagementRepository;
-import org.jboss.jca.rhq.core.ManagementRepositoryManager;
-import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-
-/**
- * Discovery AdminObjectResourceComponent from JCA container.
- *
- * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
- * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
- */
-public class AdminObjectResourceDiscoveryComponent implements ResourceDiscoveryComponent<AdminObjectResourceComponent>
-{
- /**
- * discoverResources
- *
- * @param context ResourceDiscoveryContext<AdminObjectResourceComponent>
- * @return Set<DiscoveredResourceDetails> set of DiscoveredResourceDetails
- * @throws InvalidPluginConfigurationException invalidPluginConfigurationException
- * @throws Exception exception
- */
- @Override
- public Set<DiscoveredResourceDetails> discoverResources(
- ResourceDiscoveryContext<AdminObjectResourceComponent> context)
- throws InvalidPluginConfigurationException, Exception
- {
-
- Set<DiscoveredResourceDetails> result = new HashSet<DiscoveredResourceDetails>();
- // the uniqueId is the key of parent component.
-
- String rarUniqueId = context.getParentResourceContext().getResourceKey();
-
- ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
- Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, rarUniqueId);
-
- for (AdminObject ao : connector.getAdminObjects())
- {
- Object aoObj = ao.getAdminObject();
- Class<?> aoCls = aoObj.getClass();
- String key = rarUniqueId + "#" + aoCls.getName();
- String name = aoCls.getSimpleName();
- DiscoveredResourceDetails mcfRes = new DiscoveredResourceDetails(context.getResourceType(), key, name, null,
- "Admin Objects", context.getDefaultPluginConfiguration(), null);
- result.add(mcfRes);
- }
- return result;
- }
-
-}
Copied: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AoResourceComponent.java (from rev 110872, projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceComponent.java)
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AoResourceComponent.java (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AoResourceComponent.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.jca.rhq.ra;
+
+import org.jboss.jca.core.api.management.AdminObject;
+import org.jboss.jca.core.api.management.ConfigProperty;
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagementRepository;
+import org.jboss.jca.rhq.core.AbstractResourceComponent;
+import org.jboss.jca.rhq.core.ManagementRepositoryManager;
+import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
+
+import java.util.List;
+
+import org.jboss.logging.Logger;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+
+/**
+ * Represent Admin Object in JCA container.
+ *
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ */
+public class AoResourceComponent extends AbstractResourceComponent
+{
+ /** log */
+ private static final Logger logger = Logger.getLogger(AoResourceComponent.class);
+
+ /**
+ * loadResourceConfiguration
+ *
+ * @return Configuration configuration
+ * @throws Exception exception
+ */
+ @Override
+ public Configuration loadResourceConfiguration() throws Exception
+ {
+
+ Configuration config = new Configuration();
+
+ ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
+ Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, getRarUniqueId());
+ String jcaClsName = getJCAClassName();
+
+ for (AdminObject ao : connector.getAdminObjects())
+ {
+ Object obj = ao.getAdminObject();
+ Class<?> aoCls = obj.getClass();
+ if (aoCls.getName().equals(jcaClsName))
+ {
+ logger.debug("Class Name is: " + jcaClsName);
+ List<ConfigProperty> aoConfigProps = ao.getConfigProperties();
+ PropertyList configList = getConfigPropertiesList(obj, aoConfigProps);
+ config.put(configList);
+ break;
+ }
+ }
+ return config;
+ }
+}
Copied: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AoResourceDiscoveryComponent.java (from rev 110872, projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceDiscoveryComponent.java)
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AoResourceDiscoveryComponent.java (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AoResourceDiscoveryComponent.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.jca.rhq.ra;
+
+import org.jboss.jca.core.api.management.AdminObject;
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagementRepository;
+import org.jboss.jca.rhq.core.ManagementRepositoryManager;
+import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+/**
+ * Discovery AdminObjectResourceComponent from JCA container.
+ *
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ */
+public class AoResourceDiscoveryComponent implements ResourceDiscoveryComponent<AoResourceComponent>
+{
+ /**
+ * discoverResources
+ *
+ * @param context ResourceDiscoveryContext<AdminObjectResourceComponent>
+ * @return Set<DiscoveredResourceDetails> set of DiscoveredResourceDetails
+ * @throws InvalidPluginConfigurationException invalidPluginConfigurationException
+ * @throws Exception exception
+ */
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(
+ ResourceDiscoveryContext<AoResourceComponent> context)
+ throws InvalidPluginConfigurationException, Exception
+ {
+
+ Set<DiscoveredResourceDetails> result = new HashSet<DiscoveredResourceDetails>();
+ // the uniqueId is the key of parent component.
+
+ String rarUniqueId = context.getParentResourceContext().getResourceKey();
+
+ ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
+ Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, rarUniqueId);
+
+ for (AdminObject ao : connector.getAdminObjects())
+ {
+ Object aoObj = ao.getAdminObject();
+ Class<?> aoCls = aoObj.getClass();
+ String key = rarUniqueId + "#" + aoCls.getName();
+ String name = aoCls.getSimpleName();
+ DiscoveredResourceDetails mcfRes = new DiscoveredResourceDetails(context.getResourceType(), key, name, null,
+ "Admin Objects", context.getDefaultPluginConfiguration(), null);
+ result.add(mcfRes);
+ }
+ return result;
+ }
+
+}
Deleted: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceComponent.java 2011-03-10 06:22:46 UTC (rev 110874)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceComponent.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.jca.rhq.ra;
-
-import org.jboss.jca.core.api.management.ConfigProperty;
-import org.jboss.jca.core.api.management.Connector;
-import org.jboss.jca.core.api.management.ManagedConnectionFactory;
-import org.jboss.jca.core.api.management.ManagementRepository;
-import org.jboss.jca.rhq.core.AbstractResourceComponent;
-
-import org.jboss.jca.rhq.core.ManagementRepositoryManager;
-import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
-
-import java.util.List;
-
-import org.jboss.logging.Logger;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertyList;
-
-/**
- * ManagedConnectionFactoryResourceComponent represent the ManagedConnectionFactory in JCA container.
- *
- * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
- * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
- */
-public class ManagedConnectionFactoryResourceComponent extends AbstractResourceComponent
-{
- /** log */
- private static final Logger logger = Logger.getLogger(ManagedConnectionFactoryResourceComponent.class);
-
- /**
- * loadResourceConfiguration
- *
- * @return Configuration Configuration
- * @throws Exception exception
- */
- @Override
- public Configuration loadResourceConfiguration() throws Exception
- {
- Configuration config = new Configuration();
-
- ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
- Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, getRarUniqueId());
-
- String jcaClsName = getJCAClassName();
-
- for (ManagedConnectionFactory mcf : connector.getManagedConnectionFactories())
- {
- javax.resource.spi.ManagedConnectionFactory jcaMcf = mcf.getManagedConnectionFactory();
- Class<?> mcfCls = jcaMcf.getClass();
- if (mcfCls.getName().equals(jcaClsName))
- {
- logger.debug("Class Name is: " + jcaClsName);
- List<ConfigProperty> mcfConfProps = mcf.getConfigProperties();
- PropertyList configList = getConfigPropertiesList(jcaMcf, mcfConfProps);
- config.put(configList);
- break;
- }
- }
- return config;
- }
-}
Deleted: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceDiscoveryComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceDiscoveryComponent.java 2011-03-10 06:22:46 UTC (rev 110874)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceDiscoveryComponent.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.jca.rhq.ra;
-
-import org.jboss.jca.core.api.management.Connector;
-import org.jboss.jca.core.api.management.ManagedConnectionFactory;
-import org.jboss.jca.core.api.management.ManagementRepository;
-
-import org.jboss.jca.rhq.core.ManagementRepositoryManager;
-import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-
-/**
- * Discovery ManagedConnectionFactoryResourceComponent resources from JCA container.
- *
- * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
- * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
- */
-public class ManagedConnectionFactoryResourceDiscoveryComponent
- implements ResourceDiscoveryComponent<ManagedConnectionFactoryResourceComponent>
-{
- /**
- * discoverResources
- *
- * @param context ResourceDiscoveryContext<AdminObjectResourceComponent>
- * @return Set<DiscoveredResourceDetails> set of DiscoveredResourceDetails
- * @throws InvalidPluginConfigurationException invalidPluginConfigurationException
- * @throws Exception exception
- */
- @Override
- public Set<DiscoveredResourceDetails> discoverResources(
- ResourceDiscoveryContext<ManagedConnectionFactoryResourceComponent> context)
- throws InvalidPluginConfigurationException, Exception
- {
- Set<DiscoveredResourceDetails> result = new HashSet<DiscoveredResourceDetails>();
-
- // the uniqueId is the key of parent component.
- String rarUniqueId = context.getParentResourceContext().getResourceKey();
-
- ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
- Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, rarUniqueId);
-
- for (ManagedConnectionFactory mcf : connector.getManagedConnectionFactories())
- {
- javax.resource.spi.ManagedConnectionFactory jcaMcf = mcf.getManagedConnectionFactory();
- // FIXME: jcaMcf is null due to weakreference.
-
- Class<?> mcfCls = jcaMcf.getClass();
- String key = rarUniqueId + "#" + mcfCls.getName(); //IMPORTANT: make the key uniqueId#class name
- String name = mcfCls.getSimpleName();
- DiscoveredResourceDetails mcfRes = new DiscoveredResourceDetails(context.getResourceType(), key, name, null,
- "Managed Connection Factories", context.getDefaultPluginConfiguration(), null);
- result.add(mcfRes);
- }
- return result;
- }
-
-}
Copied: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/McfResourceComponent.java (from rev 110872, projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceComponent.java)
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/McfResourceComponent.java (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/McfResourceComponent.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.jca.rhq.ra;
+
+import org.jboss.jca.core.api.management.ConfigProperty;
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagedConnectionFactory;
+import org.jboss.jca.core.api.management.ManagementRepository;
+import org.jboss.jca.rhq.core.AbstractResourceComponent;
+
+import org.jboss.jca.rhq.core.ManagementRepositoryManager;
+import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
+
+import java.util.List;
+
+import org.jboss.logging.Logger;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+
+/**
+ * McfResourceComponent represent the ManagedConnectionFactory in JCA container.
+ *
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ */
+public class McfResourceComponent extends AbstractResourceComponent
+{
+ /** log */
+ private static final Logger logger = Logger.getLogger(McfResourceComponent.class);
+
+ /**
+ * loadResourceConfiguration
+ *
+ *
+ * @return Configuration Configuration
+ * @throws Exception exception
+ */
+ @Override
+ public Configuration loadResourceConfiguration() throws Exception
+ {
+ Configuration config = new Configuration();
+
+ ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
+ Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, getRarUniqueId());
+
+ String jcaClsName = getJCAClassName();
+
+ for (ManagedConnectionFactory mcf : connector.getManagedConnectionFactories())
+ {
+ javax.resource.spi.ManagedConnectionFactory jcaMcf = mcf.getManagedConnectionFactory();
+ Class<?> mcfCls = jcaMcf.getClass();
+ if (mcfCls.getName().equals(jcaClsName))
+ {
+ logger.debug("Class Name is: " + jcaClsName);
+ List<ConfigProperty> mcfConfProps = mcf.getConfigProperties();
+ PropertyList configList = getConfigPropertiesList(jcaMcf, mcfConfProps);
+ config.put(configList);
+ break;
+ }
+ }
+ return config;
+ }
+}
Copied: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/McfResourceDiscoveryComponent.java (from rev 110872, projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceDiscoveryComponent.java)
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/McfResourceDiscoveryComponent.java (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/McfResourceDiscoveryComponent.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.jca.rhq.ra;
+
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagedConnectionFactory;
+import org.jboss.jca.core.api.management.ManagementRepository;
+
+import org.jboss.jca.rhq.core.ManagementRepositoryManager;
+import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+/**
+ * Discovery McfResourceDiscoveryComponent resources from JCA container.
+ *
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ */
+public class McfResourceDiscoveryComponent
+ implements ResourceDiscoveryComponent<McfResourceComponent>
+{
+ /**
+ * discoverResources
+ *
+ * @param context ResourceDiscoveryContext<AdminObjectResourceComponent>
+ * @return Set<DiscoveredResourceDetails> set of DiscoveredResourceDetails
+ * @throws InvalidPluginConfigurationException invalidPluginConfigurationException
+ * @throws Exception exception
+ */
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(
+ ResourceDiscoveryContext<McfResourceComponent> context)
+ throws InvalidPluginConfigurationException, Exception
+ {
+ Set<DiscoveredResourceDetails> result = new HashSet<DiscoveredResourceDetails>();
+
+ // the uniqueId is the key of parent component.
+ String rarUniqueId = context.getParentResourceContext().getResourceKey();
+
+ ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
+ Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, rarUniqueId);
+
+ for (ManagedConnectionFactory mcf : connector.getManagedConnectionFactories())
+ {
+ javax.resource.spi.ManagedConnectionFactory jcaMcf = mcf.getManagedConnectionFactory();
+ // FIXME: jcaMcf is null due to weakreference.
+
+ Class<?> mcfCls = jcaMcf.getClass();
+ String key = rarUniqueId + "#" + mcfCls.getName(); //IMPORTANT: make the key uniqueId#class name
+ String name = mcfCls.getSimpleName();
+ DiscoveredResourceDetails mcfRes = new DiscoveredResourceDetails(context.getResourceType(), key, name, null,
+ "Managed Connection Factories", context.getDefaultPluginConfiguration(), null);
+ result.add(mcfRes);
+ }
+ return result;
+ }
+
+}
Copied: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/RarResourceComponent.java (from rev 110872, projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceComponent.java)
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/RarResourceComponent.java (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/RarResourceComponent.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.jca.rhq.ra;
+
+import org.jboss.jca.core.api.management.ConfigProperty;
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagementRepository;
+import org.jboss.jca.core.api.management.ResourceAdapter;
+import org.jboss.jca.rhq.core.AbstractResourceComponent;
+import org.jboss.jca.rhq.core.ManagementRepositoryManager;
+import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
+
+import java.io.InputStream;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.content.PackageType;
+import org.rhq.core.domain.content.transfer.DeployPackageStep;
+import org.rhq.core.domain.content.transfer.DeployPackagesResponse;
+import org.rhq.core.domain.content.transfer.RemovePackagesResponse;
+import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
+import org.rhq.core.pluginapi.content.ContentFacet;
+import org.rhq.core.pluginapi.content.ContentServices;
+
+/**
+ * RarResourceComponent
+ *
+ * @author <a href="mailto:yyang at gmail.com">Young Yang</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ */
+public class RarResourceComponent extends AbstractResourceComponent implements ContentFacet
+{
+ /**
+ * loadResourceConfiguration
+ *
+ * @return Configuration Configuration
+ * @throws Exception exception
+ */
+ @Override
+ public Configuration loadResourceConfiguration() throws Exception
+ {
+ Configuration config = new Configuration();
+
+ ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
+ Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, getRarUniqueId());
+
+ ResourceAdapter manResAdapter = connector.getResourceAdapter();
+ List<ConfigProperty> manResConfigProps = manResAdapter.getConfigProperties();
+ PropertyList configList = getConfigPropertiesList(manResAdapter.getResourceAdapter(), manResConfigProps);
+ config.put(configList);
+ return config;
+ }
+
+ @Override
+ public DeployPackagesResponse deployPackages(Set<ResourcePackageDetails> arg0, ContentServices arg1)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Set<ResourcePackageDetails> discoverDeployedPackages(PackageType arg0)
+ {
+ Set<ResourcePackageDetails> details = new HashSet<ResourcePackageDetails>();
+ // TODO Auto-generated method stub
+ return details;
+ }
+
+ @Override
+ public List<DeployPackageStep> generateInstallationSteps(ResourcePackageDetails arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public RemovePackagesResponse removePackages(Set<ResourcePackageDetails> arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public InputStream retrievePackageBits(ResourcePackageDetails arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
Copied: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/RarResourceDiscoveryComponent.java (from rev 110872, projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceDiscoveryComponent.java)
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/RarResourceDiscoveryComponent.java (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/RarResourceDiscoveryComponent.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.jca.rhq.ra;
+
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagementRepository;
+import org.jboss.jca.rhq.core.ManagementRepositoryManager;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.logging.Logger;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+/**
+ * RarResourceDiscoveryComponent
+ *
+ * @author <a href="mailto:yyang at gmail.com">Young Yang</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ */
+public class RarResourceDiscoveryComponent
+ implements ResourceDiscoveryComponent<RarResourceComponent>
+{
+ /** log */
+ private static final Logger logger = Logger.getLogger(RarResourceDiscoveryComponent.class);
+
+ /**
+ * discoverResources
+ *
+ * @param jcaRarResourceComponentResourceDiscoveryContext ResourceDiscoveryContext<JCARarResourceComponent>
+ * @return Set<DiscoveredResourceDetails> set of DiscoveredResourceDetails
+ * @throws InvalidPluginConfigurationException invalidPluginConfigurationException
+ * @throws Exception exception
+ */
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(
+ ResourceDiscoveryContext<RarResourceComponent> jcaRarResourceComponentResourceDiscoveryContext)
+ throws InvalidPluginConfigurationException, Exception
+ {
+ Set<DiscoveredResourceDetails> result = new HashSet<DiscoveredResourceDetails>();
+
+ ManagementRepository manRepo = ManagementRepositoryManager.getManagementRepository();
+
+ for (Connector connector : manRepo.getConnectors())
+ {
+ // make the uniqueId of the connector the key of this resource component
+ String key = connector.getUniqueId();
+ String name = key;
+ DiscoveredResourceDetails resConnector = new DiscoveredResourceDetails(
+ jcaRarResourceComponentResourceDiscoveryContext.getResourceType(), key, name, "1.0.0",
+ "Resource Adapters", jcaRarResourceComponentResourceDiscoveryContext.getDefaultPluginConfiguration(),
+ null);
+ result.add(resConnector);
+ }
+ return result;
+ }
+}
Deleted: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceComponent.java 2011-03-10 06:22:46 UTC (rev 110874)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceComponent.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -1,111 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.jca.rhq.ra;
-
-import org.jboss.jca.core.api.management.ConfigProperty;
-import org.jboss.jca.core.api.management.Connector;
-import org.jboss.jca.core.api.management.ManagementRepository;
-import org.jboss.jca.core.api.management.ResourceAdapter;
-import org.jboss.jca.rhq.core.AbstractResourceComponent;
-import org.jboss.jca.rhq.core.ManagementRepositoryManager;
-import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
-
-import java.io.InputStream;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertyList;
-import org.rhq.core.domain.content.PackageType;
-import org.rhq.core.domain.content.transfer.DeployPackageStep;
-import org.rhq.core.domain.content.transfer.DeployPackagesResponse;
-import org.rhq.core.domain.content.transfer.RemovePackagesResponse;
-import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
-import org.rhq.core.pluginapi.content.ContentFacet;
-import org.rhq.core.pluginapi.content.ContentServices;
-
-/**
- * ResourceAdapterResourceComponent
- *
- * @author <a href="mailto:yyang at gmail.com">Young Yang</a>
- * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
- */
-public class ResourceAdapterResourceComponent extends AbstractResourceComponent implements ContentFacet
-{
- /**
- * loadResourceConfiguration
- *
- * @return Configuration Configuration
- * @throws Exception exception
- */
- @Override
- public Configuration loadResourceConfiguration() throws Exception
- {
- Configuration config = new Configuration();
-
- ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
- Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, getRarUniqueId());
-
- ResourceAdapter manResAdapter = connector.getResourceAdapter();
- List<ConfigProperty> manResConfigProps = manResAdapter.getConfigProperties();
- PropertyList configList = getConfigPropertiesList(manResAdapter.getResourceAdapter(), manResConfigProps);
- config.put(configList);
- return config;
- }
-
- @Override
- public DeployPackagesResponse deployPackages(Set<ResourcePackageDetails> arg0, ContentServices arg1)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Set<ResourcePackageDetails> discoverDeployedPackages(PackageType arg0)
- {
- Set<ResourcePackageDetails> details = new HashSet<ResourcePackageDetails>();
- // TODO Auto-generated method stub
- return details;
- }
-
- @Override
- public List<DeployPackageStep> generateInstallationSteps(ResourcePackageDetails arg0)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public RemovePackagesResponse removePackages(Set<ResourcePackageDetails> arg0)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public InputStream retrievePackageBits(ResourcePackageDetails arg0)
- {
- // TODO Auto-generated method stub
- return null;
- }
-}
Deleted: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceDiscoveryComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceDiscoveryComponent.java 2011-03-10 06:22:46 UTC (rev 110874)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceDiscoveryComponent.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.jca.rhq.ra;
-
-import org.jboss.jca.core.api.management.Connector;
-import org.jboss.jca.core.api.management.ManagementRepository;
-import org.jboss.jca.rhq.core.ManagementRepositoryManager;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.jboss.logging.Logger;
-
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-
-/**
- * ResourceAdapterResourceDiscoveryComponent
- *
- * @author <a href="mailto:yyang at gmail.com">Young Yang</a>
- * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
- */
-public class ResourceAdapterResourceDiscoveryComponent
- implements ResourceDiscoveryComponent<ResourceAdapterResourceComponent>
-{
- /** log */
- private static final Logger logger = Logger.getLogger(ResourceAdapterResourceDiscoveryComponent.class);
-
- /**
- * discoverResources
- *
- * @param jcaRarResourceComponentResourceDiscoveryContext ResourceDiscoveryContext<JCARarResourceComponent>
- * @return Set<DiscoveredResourceDetails> set of DiscoveredResourceDetails
- * @throws InvalidPluginConfigurationException invalidPluginConfigurationException
- * @throws Exception exception
- */
- @Override
- public Set<DiscoveredResourceDetails> discoverResources(
- ResourceDiscoveryContext<ResourceAdapterResourceComponent> jcaRarResourceComponentResourceDiscoveryContext)
- throws InvalidPluginConfigurationException, Exception
- {
- Set<DiscoveredResourceDetails> result = new HashSet<DiscoveredResourceDetails>();
-
- ManagementRepository manRepo = ManagementRepositoryManager.getManagementRepository();
-
- for (Connector connector : manRepo.getConnectors())
- {
- // make the uniqueId of the connector the key of this resource component
- String key = connector.getUniqueId();
- String name = key;
- DiscoveredResourceDetails resConnector = new DiscoveredResourceDetails(
- jcaRarResourceComponentResourceDiscoveryContext.getResourceType(), key, name, "1.0.0",
- "Resource Adapters", jcaRarResourceComponentResourceDiscoveryContext.getDefaultPluginConfiguration(),
- null);
- result.add(resConnector);
- }
- return result;
- }
-}
Modified: projects/jboss-jca/trunk/rhq/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/resources/META-INF/rhq-plugin.xml 2011-03-10 06:22:46 UTC (rev 110874)
+++ projects/jboss-jca/trunk/rhq/src/main/resources/META-INF/rhq-plugin.xml 2011-03-10 09:26:32 UTC (rev 110875)
@@ -338,8 +338,8 @@
</runs-inside> -->
<!-- Resource Adapter Archive (RAR) -->
- <service name="Resource Adapter Archive (RAR)" discovery="org.jboss.jca.rhq.ra.ResourceAdapterResourceDiscoveryComponent"
- class="org.jboss.jca.rhq.ra.ResourceAdapterResourceComponent" createDeletePolicy="both" creationDataType="content">
+ <service name="Resource Adapter Archive (RAR)" discovery="org.jboss.jca.rhq.ra.RarResourceDiscoveryComponent"
+ class="org.jboss.jca.rhq.ra.RarResourceComponent" createDeletePolicy="both" creationDataType="content">
<plugin-configuration>
<c:group name="general" displayName="General">
@@ -349,16 +349,16 @@
</plugin-configuration>
<operation name="start"
- description="starts this RAR"/>
+ description="start this RAR"/>
<operation name="stop"
- description="stops this RAR"/>
+ description="stop this RAR"/>
<operation name="restart"
- description="stops and then restarts this RAR"/>
+ description="stop and restart this RAR"/>
<operation name="suspend"
- description="suspends this RAR"/>
+ description="suspend this RAR"/>
<content name="file" displayName="RAR File" category="deployable" isCreationType="true">
@@ -366,15 +366,12 @@
<resource-configuration>
<c:group name="general" displayName="General">
- <c:simple-property name="jndi_name" displayName="JNDI Name"/>
- <c:simple-property name="deploy_name" displayName="Name" readOnly="true"/>
- <c:simple-property name="class_name" displayName="Class Name" description="Class name of ResourceAdapter" />
- <c:simple-property name="use_ra_association" displayName="Use ResourceAdapterAssociation" type="boolean" readOnly="true"/>
- <c:simple-property name="source_path" displayName="Source Path" description="RAR file path" readOnly="true"/>
- <c:simple-property name="native_lig_dir" displayName="Native Lib Dir" description="native library directory" />
- <c:simple-property name="access_out_app" displayName="Access outside of App Enabled" description="Can this resource adapter be accessed from outside of the application?" type="boolean" />
- <c:simple-property name="access_to_class" displayName="Global Access To Classes Enabled" description="Is access to resource adapter classes enabled?" type="boolean" />
-
+ <c:simple-property name="name" displayName="Display name" readOnly="true"/>
+ <c:simple-property name="jndi-name" displayName="JNDI name"/>
+ <c:simple-property name="class-name" displayName="Class name" required="false" description="Class name of ResourceAdapter" />
+ <c:simple-property name="use-ra-association" displayName="Use ResourceAdapterAssociation" type="boolean" readOnly="true" required="false"/>
+ <c:simple-property name="source-path" displayName="Source Path" description="RAR file path" readOnly="true"/>
+
</c:group>
<c:group name="ConfigProperties" displayName="All Config Properties">
@@ -386,16 +383,21 @@
<!-- here are some resource configurations on the connector -->
<!-- Managed Connection Factories. Includes No Tx / Tx connection factories -->
- <service name="Managed Connection Factories" discovery="org.jboss.jca.rhq.ra.ManagedConnectionFactoryResourceDiscoveryComponent"
- class="org.jboss.jca.rhq.ra.ManagedConnectionFactoryResourceComponent" supportsManualAdd="true">
+ <service name="Managed Connection Factories" discovery="org.jboss.jca.rhq.ra.McfResourceDiscoveryComponent"
+ class="org.jboss.jca.rhq.ra.McfResourceComponent" supportsManualAdd="true">
&datasourceAndConnectionFactoryOperations;
<resource-configuration>
<c:group name="general" displayName="General">
- <c:simple-property name="jndi_name" displayName="JNDI Name"/>
- <c:simple-property name="interface_class_name" displayName="interface class name" description="the interface class name of the managed connection factory" />
- <c:simple-property name="trans_support_type" displayName="Transaction support type" description="Transaction support type">
+ <c:simple-property name="jndi-name" displayName="JNDI Name"/>
+ <c:simple-property name="mcf-class-name" displayName="ManagedConnectionFactory class name"/>
+ <c:simple-property name="cf-interface-name" displayName="ConnectionFactory interface class name"/>
+ <c:simple-property name="cf-impl-name" displayName="ConnectionFactory implement class name"/>
+ <c:simple-property name="connection-interface-name" displayName="Connection interface class name"/>
+ <c:simple-property name="connection-impl-name" displayName="Connection implement class name"/>
+
+ <c:simple-property name="transaction-type" displayName="Transaction type" description="Transaction type">
<c:property-options>
<c:option name="No Transaction" value="no"/>
<c:option name="Local Transaction" value="local"/>
@@ -405,8 +407,8 @@
</c:group>
<c:group name="Authentication" displayName="Authentication">
- <c:simple-property name="re_auth_support" displayName="Reauthentication Support" type="boolean" description="Does this outbound connection support reauthentication?"></c:simple-property>
- <c:simple-property name="res_auth_src" displayName="Resource Authentication Source">
+ <c:simple-property name="re-auth_support" displayName="Reauthentication Support" type="boolean" description="Does this outbound connection support reauthentication?"></c:simple-property>
+ <c:simple-property name="res-auth-src" displayName="Resource Authentication Source">
<c:description>
Is reauthentication application-based or container-based?
</c:description>
@@ -432,8 +434,8 @@
</service>
<!-- Admin Objects -->
- <service name="Admin Object" discovery="org.jboss.jca.rhq.ra.AdminObjectResourceDiscoveryComponent"
- class="org.jboss.jca.rhq.ra.AdminObjectResourceComponent" supportsManualAdd="true">
+ <service name="Admin Object" discovery="org.jboss.jca.rhq.ra.AoResourceDiscoveryComponent"
+ class="org.jboss.jca.rhq.ra.AoResourceComponent" supportsManualAdd="true">
<resource-configuration>
<c:group name="general" displayName="General">
@@ -447,11 +449,12 @@
</service>
- <!-- Connection Factories -->
+ <!-- Connection Factories
<service name="Connection Factories" discovery="org.jboss.jca.rhq.ds.ConnectionFactoryResourceDiscoveryComponent"
class="org.jboss.jca.rhq.ds.ConnectionFactoryResourceComponent" supportsManualAdd="true">
- <!-- Not Implemented yet. -->
+
</service>
+ -->
<!-- XA Datasource
<service name="XA Datasources" subCategory="Datasources"
Modified: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/PluginDescriptorTestCase.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/PluginDescriptorTestCase.java 2011-03-10 06:22:46 UTC (rev 110874)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/PluginDescriptorTestCase.java 2011-03-10 09:26:32 UTC (rev 110875)
@@ -82,8 +82,8 @@
ServiceDescriptor rarServiceDesc = services.get(0);
assertEquals("Resource Adapter Archive (RAR)", rarServiceDesc.getName());
- assertEquals("org.jboss.jca.rhq.ra.ResourceAdapterResourceDiscoveryComponent", rarServiceDesc.getDiscovery());
- assertEquals("org.jboss.jca.rhq.ra.ResourceAdapterResourceComponent", rarServiceDesc.getClazz());
+ assertEquals("org.jboss.jca.rhq.ra.RarResourceDiscoveryComponent", rarServiceDesc.getDiscovery());
+ assertEquals("org.jboss.jca.rhq.ra.RarResourceComponent", rarServiceDesc.getClazz());
assertEquals(ResourceCreateDeletePolicy.BOTH, rarServiceDesc.getCreateDeletePolicy());
assertEquals(ResourceCreationData.CONTENT, rarServiceDesc.getCreationDataType());
@@ -99,9 +99,9 @@
ConfigurationDescriptor resConfDesc = rarServiceDesc.getResourceConfiguration();
assertNotNull(resConfDesc);
- // 3 sub services in RAR service
+ // 2 sub services in RAR service
List<ServiceDescriptor> subServiceDesc = rarServiceDesc.getServices();
- assertEquals(3, subServiceDesc.size());
+ assertEquals(2, subServiceDesc.size());
}
More information about the jboss-cvs-commits
mailing list