[jboss-cvs] JBossAS SVN: r82037 - in trunk/connector/src: tests/org/jboss/tests/jca/managed/icf and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Dec 4 05:57:43 EST 2008
Author: emuckenhuber
Date: 2008-12-04 05:57:43 -0500 (Thu, 04 Dec 2008)
New Revision: 82037
Added:
trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractConnectionFactoryICF.java
trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractNonXADataSourceICF.java
Modified:
trunk/connector/src/main/org/jboss/resource/deployers/management/InstanceClassFactoryUtils.java
trunk/connector/src/main/org/jboss/resource/deployers/management/LocalDSInstanceClassFactory.java
trunk/connector/src/main/org/jboss/resource/deployers/management/NoTxCFInstanceClassFactory.java
trunk/connector/src/main/org/jboss/resource/deployers/management/NoTxInstanceClassFactory.java
trunk/connector/src/main/org/jboss/resource/deployers/management/TxInstanceClassFactory.java
trunk/connector/src/main/org/jboss/resource/deployers/management/XAConnectionFactoryProperty.java
trunk/connector/src/main/org/jboss/resource/deployers/management/XADSInstanceClassFactory.java
trunk/connector/src/tests/org/jboss/tests/jca/managed/icf/XADSInstanceClassFactory.java
Log:
[JBAS-6218] fix the setValue for security-domain and share handling for properties
Added: trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractConnectionFactoryICF.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractConnectionFactoryICF.java (rev 0)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractConnectionFactoryICF.java 2008-12-04 10:57:43 UTC (rev 82037)
@@ -0,0 +1,138 @@
+/*
+ * 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.resource.deployers.management;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.factory.ManagedObjectFactory;
+import org.jboss.managed.plugins.factory.AbstractInstanceClassFactory;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.MapCompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentMetaData;
+import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryPropertyMetaData;
+
+/**
+ * Common operations for the ManagedConnectionFactoryDeploymentMetaData.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public abstract class AbstractConnectionFactoryICF<T extends ManagedConnectionFactoryDeploymentMetaData>
+ extends AbstractInstanceClassFactory<T>
+{
+
+ public AbstractConnectionFactoryICF()
+ {
+ super();
+ }
+
+ public AbstractConnectionFactoryICF(ManagedObjectFactory mof)
+ {
+ super(mof);
+ }
+
+ @Override
+ public MetaValue getValue(BeanInfo beanInfo, ManagedProperty property,
+ MetaData metaData,
+ T attachment)
+ {
+ MetaValue value = null;
+ if("config-property".equals(property.getName()))
+ {
+ MapCompositeValueSupport mapValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
+ List<ManagedConnectionFactoryPropertyMetaData> list = attachment.getManagedConnectionFactoryProperties();
+ if(list != null)
+ {
+ for(ManagedConnectionFactoryPropertyMetaData prop : list)
+ {
+ String name = prop.getName();
+ MetaValue svalue = SimpleValueSupport.wrap(prop.getValue());
+ mapValue.put(name, svalue);
+ MetaValue stype = SimpleValueSupport.wrap(prop.getValue());
+ mapValue.put(name+".type", stype);
+ }
+ }
+ value = mapValue;
+ }
+ else
+ {
+ value = super.getValue(beanInfo, property, metaData, attachment);
+ }
+ return value;
+ }
+
+ @Override
+ protected void setManagedObject(BeanInfo beanInfo,
+ PropertyInfo propertyInfo, T object,
+ ManagedObject mo)
+ {
+ if(propertyInfo.getName().equals("security-domain"))
+ InstanceClassFactoryUtils.setValue(object, mo);
+ }
+
+ @Override
+ protected Object unwrapValue(BeanInfo beanInfo, ManagedProperty property,
+ MetaValue value)
+ {
+ Object unwrapValue = null;
+ if("config-property".equals(property.getName()))
+ {
+ if((value instanceof MapCompositeValueSupport) == false)
+ {
+ return super.unwrapValue(beanInfo, property, value);
+ }
+
+ MapCompositeValueSupport mapValue = (MapCompositeValueSupport) value;
+
+ List<ManagedConnectionFactoryPropertyMetaData> list = new ArrayList<ManagedConnectionFactoryPropertyMetaData>();
+ for(String name : mapValue.getMetaType().keySet())
+ {
+ ManagedConnectionFactoryPropertyMetaData prop = new ManagedConnectionFactoryPropertyMetaData();
+ prop.setName(name);
+ String svalue = (String) getMetaValueFactory().unwrap(mapValue.get(name));
+ prop.setValue(svalue);
+ String nameType = name+".type";
+ MetaValue typeValue = mapValue.get(nameType);
+ if(typeValue != null)
+ {
+ String type = (String) getMetaValueFactory().unwrap(typeValue);
+ prop.setType(type);
+ }
+ list.add(prop);
+ }
+ unwrapValue = list;
+ }
+ else
+ {
+ unwrapValue = super.unwrapValue(beanInfo, property, value);
+ }
+ return unwrapValue;
+ }
+}
Added: trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractNonXADataSourceICF.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractNonXADataSourceICF.java (rev 0)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractNonXADataSourceICF.java 2008-12-04 10:57:43 UTC (rev 82037)
@@ -0,0 +1,117 @@
+/*
+ * 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.resource.deployers.management;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.factory.ManagedObjectFactory;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.MapCompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.resource.metadata.mcf.DataSourceConnectionPropertyMetaData;
+import org.jboss.resource.metadata.mcf.NonXADataSourceDeploymentMetaData;
+
+/**
+ * Common operations for the NonXADataSourceDeploymentMetaData.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public abstract class AbstractNonXADataSourceICF<T extends NonXADataSourceDeploymentMetaData>
+ extends AbstractConnectionFactoryICF<T>
+{
+
+ public AbstractNonXADataSourceICF()
+ {
+ super();
+ }
+
+ public AbstractNonXADataSourceICF(ManagedObjectFactory mof)
+ {
+ super(mof);
+ }
+
+ @Override
+ public MetaValue getValue(BeanInfo beanInfo, ManagedProperty property,
+ MetaData metaData,
+ T attachment)
+ {
+ MetaValue value = null;
+ if("connection-properties".equals(property.getName()))
+ {
+ MapCompositeValueSupport mapValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
+ List<DataSourceConnectionPropertyMetaData> list = attachment.getDataSourceConnectionProperties();
+ if(list != null)
+ {
+ for(DataSourceConnectionPropertyMetaData prop : list)
+ {
+ MetaValue wrapped = SimpleValueSupport.wrap(prop.getValue());
+ mapValue.put(prop.getName(), wrapped);
+ }
+ }
+ value = mapValue;
+ }
+ else
+ {
+ value = super.getValue(beanInfo, property, metaData, attachment);
+ }
+ return value;
+ }
+
+ @Override
+ protected Object unwrapValue(BeanInfo beanInfo, ManagedProperty property,
+ MetaValue value)
+ {
+ Object unwrapValue = null;
+ if("connection-properties".equals(property.getName()))
+ {
+ if((value instanceof MapCompositeValueSupport) == false)
+ {
+ return super.unwrapValue(beanInfo, property, value);
+ }
+
+ MapCompositeValueSupport mapValue = (MapCompositeValueSupport) value;
+
+ List<DataSourceConnectionPropertyMetaData> list = new ArrayList<DataSourceConnectionPropertyMetaData>();
+ for(String name : mapValue.getMetaType().keySet())
+ {
+ DataSourceConnectionPropertyMetaData prop = new DataSourceConnectionPropertyMetaData();
+ prop.setName(name);
+ String svalue = (String) getMetaValueFactory().unwrap(mapValue.get(name));
+ prop.setValue(svalue);
+ list.add(prop);
+ }
+ unwrapValue = list;
+ }
+ else
+ {
+ unwrapValue = super.unwrapValue(beanInfo, property, value);
+ }
+ return unwrapValue;
+ }
+
+}
Modified: trunk/connector/src/main/org/jboss/resource/deployers/management/InstanceClassFactoryUtils.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/InstanceClassFactoryUtils.java 2008-12-04 09:38:45 UTC (rev 82036)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/InstanceClassFactoryUtils.java 2008-12-04 10:57:43 UTC (rev 82037)
@@ -29,7 +29,6 @@
import org.jboss.managed.api.ManagedProperty;
import org.jboss.metatype.api.types.SimpleMetaType;
import org.jboss.metatype.api.values.EnumValue;
-import org.jboss.metatype.api.values.GenericValue;
import org.jboss.metatype.api.values.MapCompositeValueSupport;
import org.jboss.metatype.api.values.MetaValue;
import org.jboss.metatype.api.values.MetaValueFactory;
@@ -42,7 +41,6 @@
import org.jboss.resource.metadata.mcf.SecurityDomainApplicationManagedMetaData;
import org.jboss.resource.metadata.mcf.SecurityDomainMetaData;
import org.jboss.resource.metadata.mcf.SecurityMetaData;
-import org.jboss.resource.metadata.mcf.XADataSourceDeploymentMetaData;
/**
* property to meta value conversion for common properties
Modified: trunk/connector/src/main/org/jboss/resource/deployers/management/LocalDSInstanceClassFactory.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/LocalDSInstanceClassFactory.java 2008-12-04 09:38:45 UTC (rev 82036)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/LocalDSInstanceClassFactory.java 2008-12-04 10:57:43 UTC (rev 82037)
@@ -21,24 +21,8 @@
*/
package org.jboss.resource.deployers.management;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.beans.info.spi.PropertyInfo;
-import org.jboss.managed.api.ManagedObject;
-import org.jboss.managed.api.ManagedProperty;
import org.jboss.managed.api.factory.ManagedObjectFactory;
-import org.jboss.managed.plugins.factory.AbstractInstanceClassFactory;
-import org.jboss.metadata.spi.MetaData;
-import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.MapCompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.jboss.resource.metadata.mcf.DataSourceConnectionPropertyMetaData;
import org.jboss.resource.metadata.mcf.LocalDataSourceDeploymentMetaData;
-import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryPropertyMetaData;
/**
* An InstanceClassFactory for LocalDataSourceDeploymentMetaData that handles
@@ -48,12 +32,14 @@
* @version $Revision$
*/
public class LocalDSInstanceClassFactory
- extends AbstractInstanceClassFactory<LocalDataSourceDeploymentMetaData>
+ extends AbstractNonXADataSourceICF<LocalDataSourceDeploymentMetaData>
{
+
public LocalDSInstanceClassFactory()
{
super();
}
+
public LocalDSInstanceClassFactory(ManagedObjectFactory mof)
{
super(mof);
@@ -63,102 +49,5 @@
{
return LocalDataSourceDeploymentMetaData.class;
}
-
- public Class<? extends Serializable> getManagedObjectClass(
- LocalDataSourceDeploymentMetaData attachment)
- throws ClassNotFoundException
- {
- return attachment.getClass();
- }
-
- public MetaValue getValue(BeanInfo beanInfo, ManagedProperty property,
- MetaData metaData,
- LocalDataSourceDeploymentMetaData attachment)
- {
- MetaValue value = null;
- if("connection-properties".equals(property.getName()))
- {
- MapCompositeValueSupport mapValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
- List<DataSourceConnectionPropertyMetaData> list = attachment.getDataSourceConnectionProperties();
- if(list != null)
- {
- for(DataSourceConnectionPropertyMetaData prop : list)
- {
- MetaValue wrapped = SimpleValueSupport.wrap(prop.getValue());
- mapValue.put(prop.getName(), wrapped);
- }
- }
- value = mapValue;
- }
- else if("config-property".equals(property.getName()))
- {
- MapCompositeValueSupport mapValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
- List<ManagedConnectionFactoryPropertyMetaData> list = attachment.getManagedConnectionFactoryProperties();
- if(list != null)
- {
- for(ManagedConnectionFactoryPropertyMetaData prop : list)
- {
- mapValue.put("name", SimpleValueSupport.wrap(prop.getName()));
- mapValue.put("value", SimpleValueSupport.wrap(prop.getValue()));
- mapValue.put("type", SimpleValueSupport.wrap("java.lang.String"));
- }
- }
- value = mapValue;
- }
- else
- {
- value = super.getValue(beanInfo, property, metaData, attachment);
- }
- return value;
- }
-
- @Override
- protected void setManagedObject(BeanInfo beanInfo,
- PropertyInfo propertyInfo, LocalDataSourceDeploymentMetaData object,
- ManagedObject mo)
- {
- if(propertyInfo.getName().equals("security-domain"))
- InstanceClassFactoryUtils.setValue(object, mo);
- }
-
- @Override
- protected Object unwrapValue(BeanInfo beanInfo, ManagedProperty property,
- MetaValue value)
- {
- if((value instanceof MapCompositeValueSupport) == false)
- {
- return super.unwrapValue(beanInfo, property, value);
- }
-
- MapCompositeValueSupport mapValue = (MapCompositeValueSupport) value;
- Object unwrapValue = null;
- if("connection-properties".equals(property.getName()))
- {
- List<DataSourceConnectionPropertyMetaData> list = new ArrayList<DataSourceConnectionPropertyMetaData>();
- for(String name : mapValue.getMetaType().keySet())
- {
- DataSourceConnectionPropertyMetaData prop = new DataSourceConnectionPropertyMetaData();
- prop.setName(name);
- String svalue = (String) getMetaValueFactory().unwrap(mapValue.get(name));
- prop.setValue(svalue);
- list.add(prop);
- }
- unwrapValue = list;
- }
- else if("config-property".equals(property.getName()))
- {
- List<ManagedConnectionFactoryPropertyMetaData> list = new ArrayList<ManagedConnectionFactoryPropertyMetaData>();
- for(String name : mapValue.getMetaType().keySet())
- {
- ManagedConnectionFactoryPropertyMetaData prop = new ManagedConnectionFactoryPropertyMetaData();
- prop.setName(name);
- String svalue = (String) getMetaValueFactory().unwrap(mapValue.get(name));
- prop.setValue(svalue);
- prop.setType("java.lang.String");
- list.add(prop);
- }
- unwrapValue = list;
- }
- return unwrapValue;
- }
+
}
Modified: trunk/connector/src/main/org/jboss/resource/deployers/management/NoTxCFInstanceClassFactory.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/NoTxCFInstanceClassFactory.java 2008-12-04 09:38:45 UTC (rev 82036)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/NoTxCFInstanceClassFactory.java 2008-12-04 10:57:43 UTC (rev 82037)
@@ -21,13 +21,7 @@
*/
package org.jboss.resource.deployers.management;
-import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.managed.api.ManagedProperty;
import org.jboss.managed.api.factory.ManagedObjectFactory;
-import org.jboss.managed.plugins.factory.AbstractInstanceClassFactory;
-import org.jboss.metadata.spi.MetaData;
-import org.jboss.metatype.api.values.MapCompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
import org.jboss.resource.metadata.mcf.NoTxConnectionFactoryDeploymentMetaData;
/**
@@ -38,12 +32,14 @@
* @version $Revision$
*/
public class NoTxCFInstanceClassFactory
- extends AbstractInstanceClassFactory<NoTxConnectionFactoryDeploymentMetaData>
+ extends AbstractConnectionFactoryICF<NoTxConnectionFactoryDeploymentMetaData>
{
+
public NoTxCFInstanceClassFactory()
{
super();
}
+
public NoTxCFInstanceClassFactory(ManagedObjectFactory mof)
{
super(mof);
@@ -53,38 +49,5 @@
{
return NoTxConnectionFactoryDeploymentMetaData.class;
}
-
- public MetaValue getValue(BeanInfo beanInfo, ManagedProperty property,
- MetaData metaData,
- NoTxConnectionFactoryDeploymentMetaData attachment)
- {
- MetaValue value = null;
- if("config-property".equals(property.getName()))
- {
- value = InstanceClassFactoryUtils.getConfigPropertyValue(beanInfo, property, attachment);
- }
- else
- {
- value = super.getValue(beanInfo, property, metaData, attachment);
- }
- return value;
- }
-
- @Override
- protected Object unwrapValue(BeanInfo beanInfo, ManagedProperty property,
- MetaValue value)
- {
- if((value instanceof MapCompositeValueSupport) == false)
- {
- return super.unwrapValue(beanInfo, property, value);
- }
-
- Object unwrapValue = null;
- if("config-property".equals(property.getName()))
- {
- unwrapValue = InstanceClassFactoryUtils.unwrapConfigPropertyValue(beanInfo,
- property, value, getMetaValueFactory());
- }
- return unwrapValue;
- }
+
}
Modified: trunk/connector/src/main/org/jboss/resource/deployers/management/NoTxInstanceClassFactory.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/NoTxInstanceClassFactory.java 2008-12-04 09:38:45 UTC (rev 82036)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/NoTxInstanceClassFactory.java 2008-12-04 10:57:43 UTC (rev 82037)
@@ -21,13 +21,7 @@
*/
package org.jboss.resource.deployers.management;
-import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.managed.api.ManagedProperty;
import org.jboss.managed.api.factory.ManagedObjectFactory;
-import org.jboss.managed.plugins.factory.AbstractInstanceClassFactory;
-import org.jboss.metadata.spi.MetaData;
-import org.jboss.metatype.api.values.MapCompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
import org.jboss.resource.metadata.mcf.NoTxDataSourceDeploymentMetaData;
/**
@@ -37,12 +31,14 @@
* @version $Revision$
*/
public class NoTxInstanceClassFactory
- extends AbstractInstanceClassFactory<NoTxDataSourceDeploymentMetaData>
+ extends AbstractNonXADataSourceICF<NoTxDataSourceDeploymentMetaData>
{
+
public NoTxInstanceClassFactory()
{
super();
}
+
public NoTxInstanceClassFactory(ManagedObjectFactory mof)
{
super(mof);
@@ -52,38 +48,5 @@
{
return NoTxDataSourceDeploymentMetaData.class;
}
-
- public MetaValue getValue(BeanInfo beanInfo, ManagedProperty property,
- MetaData metaData,
- NoTxDataSourceDeploymentMetaData attachment)
- {
- MetaValue value = null;
- if("config-property".equals(property.getName()))
- {
- value = InstanceClassFactoryUtils.getConfigPropertyValue(beanInfo, property, attachment);
- }
- else
- {
- value = super.getValue(beanInfo, property, metaData, attachment);
- }
- return value;
- }
-
- @Override
- protected Object unwrapValue(BeanInfo beanInfo, ManagedProperty property,
- MetaValue value)
- {
- if((value instanceof MapCompositeValueSupport) == false)
- {
- return super.unwrapValue(beanInfo, property, value);
- }
-
- Object unwrapValue = null;
- if("config-property".equals(property.getName()))
- {
- unwrapValue = InstanceClassFactoryUtils.unwrapConfigPropertyValue(beanInfo,
- property, value, getMetaValueFactory());
- }
- return unwrapValue;
- }
+
}
Modified: trunk/connector/src/main/org/jboss/resource/deployers/management/TxInstanceClassFactory.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/TxInstanceClassFactory.java 2008-12-04 09:38:45 UTC (rev 82036)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/TxInstanceClassFactory.java 2008-12-04 10:57:43 UTC (rev 82037)
@@ -21,13 +21,7 @@
*/
package org.jboss.resource.deployers.management;
-import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.managed.api.ManagedProperty;
import org.jboss.managed.api.factory.ManagedObjectFactory;
-import org.jboss.managed.plugins.factory.AbstractInstanceClassFactory;
-import org.jboss.metadata.spi.MetaData;
-import org.jboss.metatype.api.values.MapCompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
import org.jboss.resource.metadata.mcf.TxConnectionFactoryDeploymentMetaData;
/**
@@ -38,13 +32,14 @@
* @version $Revision$
*/
public class TxInstanceClassFactory
- extends AbstractInstanceClassFactory<TxConnectionFactoryDeploymentMetaData>
+ extends AbstractConnectionFactoryICF<TxConnectionFactoryDeploymentMetaData>
{
public TxInstanceClassFactory()
{
super();
}
+
public TxInstanceClassFactory(ManagedObjectFactory mof)
{
super(mof);
@@ -54,38 +49,5 @@
{
return TxConnectionFactoryDeploymentMetaData.class;
}
-
- public MetaValue getValue(BeanInfo beanInfo, ManagedProperty property,
- MetaData metaData,
- TxConnectionFactoryDeploymentMetaData attachment)
- {
- MetaValue value = null;
- if("config-property".equals(property.getName()))
- {
- value = InstanceClassFactoryUtils.getConfigPropertyValue(beanInfo, property, attachment);
- }
- else
- {
- value = super.getValue(beanInfo, property, metaData, attachment);
- }
- return value;
- }
-
- @Override
- protected Object unwrapValue(BeanInfo beanInfo, ManagedProperty property,
- MetaValue value)
- {
- if((value instanceof MapCompositeValueSupport) == false)
- {
- return super.unwrapValue(beanInfo, property, value);
- }
-
- Object unwrapValue = null;
- if("config-property".equals(property.getName()))
- {
- unwrapValue = InstanceClassFactoryUtils.unwrapConfigPropertyValue(beanInfo,
- property, value, getMetaValueFactory());
- }
- return unwrapValue;
- }
+
}
Modified: trunk/connector/src/main/org/jboss/resource/deployers/management/XAConnectionFactoryProperty.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/XAConnectionFactoryProperty.java 2008-12-04 09:38:45 UTC (rev 82036)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/XAConnectionFactoryProperty.java 2008-12-04 10:57:43 UTC (rev 82037)
@@ -21,29 +21,22 @@
*/
package org.jboss.resource.deployers.management;
-import java.lang.reflect.Type;
-import java.util.Map;
-import java.util.List;
-import java.util.ArrayList;
-import java.io.Serializable;
import java.io.ObjectStreamException;
-import org.jboss.managed.plugins.WritethroughManagedPropertyImpl;
-import org.jboss.managed.plugins.ManagedPropertyImpl;
-import org.jboss.managed.plugins.factory.ManagedObjectFactoryBuilder;
+import java.io.Serializable;
+
+import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.beans.info.spi.PropertyInfo;
import org.jboss.managed.api.Fields;
import org.jboss.managed.api.ManagedObject;
import org.jboss.managed.api.factory.ManagedObjectFactory;
+import org.jboss.managed.plugins.ManagedPropertyImpl;
+import org.jboss.managed.plugins.factory.ManagedObjectFactoryBuilder;
import org.jboss.managed.spi.factory.InstanceClassFactory;
import org.jboss.metatype.api.types.MapCompositeMetaType;
import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.types.MetaTypeFactory;
import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.MetaValueFactory;
import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.beans.info.spi.PropertyInfo;
-import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryPropertyMetaData;
-import org.jboss.resource.metadata.mcf.XAConnectionPropertyMetaData;
+import org.jboss.metatype.api.values.MetaValueFactory;
/**
* @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
Modified: trunk/connector/src/main/org/jboss/resource/deployers/management/XADSInstanceClassFactory.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/XADSInstanceClassFactory.java 2008-12-04 09:38:45 UTC (rev 82036)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/XADSInstanceClassFactory.java 2008-12-04 10:57:43 UTC (rev 82037)
@@ -25,10 +25,8 @@
import java.util.List;
import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.logging.Logger;
import org.jboss.managed.api.ManagedProperty;
import org.jboss.managed.api.factory.ManagedObjectFactory;
-import org.jboss.managed.plugins.factory.AbstractInstanceClassFactory;
import org.jboss.metadata.spi.MetaData;
import org.jboss.metatype.api.types.SimpleMetaType;
import org.jboss.metatype.api.values.MapCompositeValueSupport;
@@ -45,9 +43,8 @@
* @version $Revision$
*/
public class XADSInstanceClassFactory
- extends AbstractInstanceClassFactory<XADataSourceDeploymentMetaData>
+ extends AbstractConnectionFactoryICF<XADataSourceDeploymentMetaData>
{
- private static final Logger log = Logger.getLogger(XADSInstanceClassFactory.class);
public XADSInstanceClassFactory()
{
@@ -63,6 +60,7 @@
return XADataSourceDeploymentMetaData.class;
}
+ @Override
public MetaValue getValue(BeanInfo beanInfo, ManagedProperty property,
MetaData metaData,
XADataSourceDeploymentMetaData attachment)
@@ -82,11 +80,6 @@
metaValue = map;
}
}
- else if("config-property".equals(property.getName()))
- {
- metaValue = InstanceClassFactoryUtils.getConfigPropertyValue(beanInfo, property, attachment);
- return metaValue;
- }
else
{
metaValue = super.getValue(beanInfo, property, metaData, attachment);
@@ -98,15 +91,17 @@
protected Object unwrapValue(BeanInfo beanInfo, ManagedProperty property,
MetaValue value)
{
- if((value instanceof MapCompositeValueSupport) == false)
- {
- return super.unwrapValue(beanInfo, property, value);
- }
- MapCompositeValueSupport mapValue = (MapCompositeValueSupport) value;
Object unwrapValue = null;
if("xa-datasource-properties".equals(property.getName()))
{
+ if((value instanceof MapCompositeValueSupport) == false)
+ {
+ return super.unwrapValue(beanInfo, property, value);
+ }
+
+ MapCompositeValueSupport mapValue = (MapCompositeValueSupport) value;
+
List<XAConnectionPropertyMetaData> list = new ArrayList<XAConnectionPropertyMetaData>();
for(String name : mapValue.getMetaType().keySet())
{
@@ -118,10 +113,9 @@
}
unwrapValue = list;
}
- else if("config-property".equals(property.getName()))
+ else
{
- unwrapValue = InstanceClassFactoryUtils.unwrapConfigPropertyValue(beanInfo,
- property, value, getMetaValueFactory());
+ unwrapValue = super.unwrapValue(beanInfo, property, value);
}
return unwrapValue;
Modified: trunk/connector/src/tests/org/jboss/tests/jca/managed/icf/XADSInstanceClassFactory.java
===================================================================
--- trunk/connector/src/tests/org/jboss/tests/jca/managed/icf/XADSInstanceClassFactory.java 2008-12-04 09:38:45 UTC (rev 82036)
+++ trunk/connector/src/tests/org/jboss/tests/jca/managed/icf/XADSInstanceClassFactory.java 2008-12-04 10:57:43 UTC (rev 82037)
@@ -23,12 +23,7 @@
import java.io.Serializable;
-import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.logging.Logger;
-import org.jboss.managed.api.ManagedProperty;
-import org.jboss.managed.plugins.factory.AbstractInstanceClassFactory;
-import org.jboss.metadata.spi.MetaData;
-import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.resource.deployers.management.AbstractConnectionFactoryICF;
import org.jboss.resource.metadata.mcf.XADataSourceDeploymentMetaData;
/**
@@ -37,16 +32,14 @@
* @version $Revision$
*/
public class XADSInstanceClassFactory
- extends AbstractInstanceClassFactory<XADataSourceDeploymentMetaData>
+ extends AbstractConnectionFactoryICF<XADataSourceDeploymentMetaData>
{
- private static final Logger log = Logger.getLogger(XADSInstanceClassFactory.class);
public Class<? extends Serializable> getManagedObjectClass(
XADataSourceDeploymentMetaData attachment)
throws ClassNotFoundException
{
- // TODO Auto-generated method stub
- return null;
+ return attachment.getClass();
}
public Class<XADataSourceDeploymentMetaData> getType()
@@ -54,12 +47,4 @@
return XADataSourceDeploymentMetaData.class;
}
- public MetaValue getValue(BeanInfo beanInfo, ManagedProperty property,
- MetaData metaData,
- XADataSourceDeploymentMetaData attachment)
- {
- log.info("getValue, "+property);
- return null;
- }
-
}
More information about the jboss-cvs-commits
mailing list