[jboss-cvs] JBossAS SVN: r75429 - in projects/microcontainer/trunk: dependency/src/main/org/jboss/dependency/spi and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jul 7 04:58:41 EDT 2008
Author: alesj
Date: 2008-07-07 04:58:41 -0400 (Mon, 07 Jul 2008)
New Revision: 75429
Removed:
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/AutowireTypeValueAdapter.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/FromContextValueAdapter.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/InjectionOptionValueAdapter.java
projects/microcontainer/trunk/spring-int/src/main/org/jboss/kernel/plugins/deployment/xml/InjectionHandler.java
Modified:
projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/metadata/package-info.java
projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/ControllerMode.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/AutowireType.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/FromContext.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/InjectOption.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/policy/package-info.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/deployment/package-info.java
projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/inject/test/PropertyContextualInjection.xml
Log:
[JBMICROCONT-264]; remove obsolete enum adapters.
Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/metadata/package-info.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/metadata/package-info.java 2008-07-07 08:53:07 UTC (rev 75428)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/metadata/package-info.java 2008-07-07 08:58:41 UTC (rev 75429)
@@ -23,22 +23,13 @@
({
@JBossXmlAdaptedType(type=Cardinality.class, valueAdapter=CardinalityValueAdapter.class),
@JBossXmlAdaptedType(type=ControllerMode.class, valueAdapter= ControllerModeValueAdapter.class),
- @JBossXmlAdaptedType(type=ControllerState.class, valueAdapter=ControllerStateValueAdapter.class),
- @JBossXmlAdaptedType(type=FromContext.class, valueAdapter=FromContextValueAdapter.class),
- @JBossXmlAdaptedType(type= InjectOption.class, valueAdapter=InjectionOptionValueAdapter.class),
- @JBossXmlAdaptedType(type=AutowireType.class, valueAdapter= AutowireTypeValueAdapter.class)
+ @JBossXmlAdaptedType(type=ControllerState.class, valueAdapter=ControllerStateValueAdapter.class)
})
package org.jboss.aop.microcontainer.beans.metadata;
-import org.jboss.beans.metadata.api.model.AutowireTypeValueAdapter;
import org.jboss.beans.metadata.plugins.CardinalityValueAdapter;
import org.jboss.beans.metadata.plugins.ControllerModeValueAdapter;
import org.jboss.beans.metadata.plugins.ControllerStateValueAdapter;
-import org.jboss.beans.metadata.api.model.FromContext;
-import org.jboss.beans.metadata.api.model.FromContextValueAdapter;
-import org.jboss.beans.metadata.api.model.InjectOption;
-import org.jboss.beans.metadata.api.model.InjectionOptionValueAdapter;
-import org.jboss.beans.metadata.api.model.AutowireType;
import org.jboss.dependency.spi.Cardinality;
import org.jboss.dependency.spi.ControllerMode;
import org.jboss.dependency.spi.ControllerState;
Modified: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/ControllerMode.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/ControllerMode.java 2008-07-07 08:53:07 UTC (rev 75428)
+++ projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/ControllerMode.java 2008-07-07 08:58:41 UTC (rev 75429)
@@ -56,7 +56,12 @@
this.modeString = modeString;
}
- // TODO - remove this once JBMICROCONT-219 is done
+ /**
+ * Get the right enum instance from mode string.
+ *
+ * @param modeString the mode string param
+ * @return matching enum or exception if no match
+ */
public static ControllerMode getInstance(String modeString)
{
if (modeString == null)
@@ -73,7 +78,7 @@
/**
* Get the mode string
*
- * @return the mdoe string
+ * @return the mode string
*/
public String getModeString()
{
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/AutowireType.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/AutowireType.java 2008-07-07 08:53:07 UTC (rev 75428)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/AutowireType.java 2008-07-07 08:58:41 UTC (rev 75429)
@@ -22,6 +22,7 @@
package org.jboss.beans.metadata.api.model;
import org.jboss.util.JBossStringBuilder;
+import org.jboss.xb.annotations.JBossXmlEnum;
/**
* Autowire type:
@@ -33,6 +34,7 @@
*
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
+ at JBossXmlEnum(ignoreCase=true)
public enum AutowireType
{
NONE(MicrocontainerConstants.NONE),
@@ -63,7 +65,6 @@
* @param typeString type
* @return AutowireType instance
*/
- // TODO - remove this once JBMICROCONT-219 is done
public static AutowireType getInstance(String typeString)
{
if (typeString == null)
Deleted: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/AutowireTypeValueAdapter.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/AutowireTypeValueAdapter.java 2008-07-07 08:53:07 UTC (rev 75428)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/AutowireTypeValueAdapter.java 2008-07-07 08:58:41 UTC (rev 75429)
@@ -1,39 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.beans.metadata.api.model;
-
-import org.jboss.xb.binding.sunday.unmarshalling.ValueAdapter;
-
-/**
- * AutowireTypeValueAdapter.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- * @version $Revision: 1.1 $
- */
-public class AutowireTypeValueAdapter implements ValueAdapter
-{
- @SuppressWarnings("unchecked")
- public Object cast(Object o, Class c)
- {
- return AutowireType.getInstance((String)o);
- }
-}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/FromContext.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/FromContext.java 2008-07-07 08:53:07 UTC (rev 75428)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/FromContext.java 2008-07-07 08:58:41 UTC (rev 75429)
@@ -21,8 +21,11 @@
*/
package org.jboss.beans.metadata.api.model;
+import java.util.Arrays;
+
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ControllerState;
+import org.jboss.xb.annotations.JBossXmlEnum;
/**
* Inject from controller context:
@@ -37,6 +40,7 @@
*
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
+ at JBossXmlEnum(ignoreCase=true)
public enum FromContext
{
NOOP(FromContextDelegate.NOOP),
@@ -92,7 +96,6 @@
* @param fromString the type string
* @return from context enum instance
*/
- // TODO - remove this once JBMICROCONT-219 is done
public static FromContext getInstance(String fromString)
{
if (fromString == null)
@@ -103,6 +106,6 @@
if (fromString.equalsIgnoreCase(fromContext.delegate.getFromString()))
return fromContext;
}
- throw new IllegalArgumentException("No such FromContext for from string: " + fromString);
+ throw new IllegalArgumentException("No such FromContext for from string: " + fromString + ", available: " + Arrays.toString(values()));
}
}
Deleted: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/FromContextValueAdapter.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/FromContextValueAdapter.java 2008-07-07 08:53:07 UTC (rev 75428)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/FromContextValueAdapter.java 2008-07-07 08:58:41 UTC (rev 75429)
@@ -1,39 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.beans.metadata.api.model;
-
-import org.jboss.xb.binding.sunday.unmarshalling.ValueAdapter;
-
-/**
- * FromContextValueAdapter.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- * @version $Revision: 1.1 $
- */
-public class FromContextValueAdapter implements ValueAdapter
-{
- @SuppressWarnings("unchecked")
- public Object cast(Object o, Class c)
- {
- return FromContext.getInstance((String)o);
- }
-}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/InjectOption.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/InjectOption.java 2008-07-07 08:53:07 UTC (rev 75428)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/InjectOption.java 2008-07-07 08:58:41 UTC (rev 75429)
@@ -21,11 +21,14 @@
*/
package org.jboss.beans.metadata.api.model;
+import org.jboss.xb.annotations.JBossXmlEnum;
+
/**
* Injection option - strict or optional / callback.
*
* @author <a href="mailto:ales.justin at gmail.com">Ales Justin</a>
*/
+ at JBossXmlEnum(ignoreCase=true)
public enum InjectOption
{
STRICT(MicrocontainerConstants.STRICT),
@@ -42,24 +45,4 @@
{
return optionString;
}
-
- /**
- * Get the option enum.
- *
- * @param optionString the option string
- * @return the inject option enum instance
- */
- // TODO - remove this once JBMICROCONT-219 is done
- public static InjectOption getInstance(String optionString)
- {
- if (optionString == null)
- throw new IllegalArgumentException("Null option string.");
-
- for (InjectOption io : values())
- {
- if (optionString.equalsIgnoreCase(io.optionString))
- return io;
- }
- throw new IllegalArgumentException("No such option string: " + optionString);
- }
}
Deleted: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/InjectionOptionValueAdapter.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/InjectionOptionValueAdapter.java 2008-07-07 08:53:07 UTC (rev 75428)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/api/model/InjectionOptionValueAdapter.java 2008-07-07 08:58:41 UTC (rev 75429)
@@ -1,39 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.beans.metadata.api.model;
-
-import org.jboss.xb.binding.sunday.unmarshalling.ValueAdapter;
-
-/**
- * InjectionOptionValueAdapter.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- * @version $Revision: 1.1 $
- */
-public class InjectionOptionValueAdapter implements ValueAdapter
-{
- @SuppressWarnings("unchecked")
- public Object cast(Object o, Class c)
- {
- return InjectOption.getInstance((String)o);
- }
-}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/policy/package-info.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/policy/package-info.java 2008-07-07 08:53:07 UTC (rev 75428)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/policy/package-info.java 2008-07-07 08:58:41 UTC (rev 75429)
@@ -23,22 +23,13 @@
({
@JBossXmlAdaptedType(type=Cardinality.class, valueAdapter=CardinalityValueAdapter.class),
@JBossXmlAdaptedType(type=ControllerMode.class, valueAdapter= ControllerModeValueAdapter.class),
- @JBossXmlAdaptedType(type=ControllerState.class, valueAdapter=ControllerStateValueAdapter.class),
- @JBossXmlAdaptedType(type= FromContext.class, valueAdapter=FromContextValueAdapter.class),
- @JBossXmlAdaptedType(type= InjectOption.class, valueAdapter=InjectionOptionValueAdapter.class),
- @JBossXmlAdaptedType(type= AutowireType.class, valueAdapter= AutowireTypeValueAdapter.class)
+ @JBossXmlAdaptedType(type=ControllerState.class, valueAdapter=ControllerStateValueAdapter.class)
})
package org.jboss.beans.metadata.plugins.policy;
-import org.jboss.beans.metadata.api.model.AutowireTypeValueAdapter;
import org.jboss.beans.metadata.plugins.CardinalityValueAdapter;
import org.jboss.beans.metadata.plugins.ControllerModeValueAdapter;
import org.jboss.beans.metadata.plugins.ControllerStateValueAdapter;
-import org.jboss.beans.metadata.api.model.FromContext;
-import org.jboss.beans.metadata.api.model.FromContextValueAdapter;
-import org.jboss.beans.metadata.api.model.InjectOption;
-import org.jboss.beans.metadata.api.model.InjectionOptionValueAdapter;
-import org.jboss.beans.metadata.api.model.AutowireType;
import org.jboss.dependency.spi.Cardinality;
import org.jboss.dependency.spi.ControllerMode;
import org.jboss.dependency.spi.ControllerState;
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/deployment/package-info.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/deployment/package-info.java 2008-07-07 08:53:07 UTC (rev 75428)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/deployment/package-info.java 2008-07-07 08:58:41 UTC (rev 75429)
@@ -23,22 +23,13 @@
({
@JBossXmlAdaptedType(type=Cardinality.class, valueAdapter=CardinalityValueAdapter.class),
@JBossXmlAdaptedType(type=ControllerMode.class, valueAdapter= ControllerModeValueAdapter.class),
- @JBossXmlAdaptedType(type=ControllerState.class, valueAdapter=ControllerStateValueAdapter.class),
- @JBossXmlAdaptedType(type= FromContext.class, valueAdapter=FromContextValueAdapter.class),
- @JBossXmlAdaptedType(type= InjectOption.class, valueAdapter=InjectionOptionValueAdapter.class),
- @JBossXmlAdaptedType(type= AutowireType.class, valueAdapter= AutowireTypeValueAdapter.class)
+ @JBossXmlAdaptedType(type=ControllerState.class, valueAdapter=ControllerStateValueAdapter.class)
})
package org.jboss.kernel.plugins.deployment;
-import org.jboss.beans.metadata.api.model.AutowireTypeValueAdapter;
import org.jboss.beans.metadata.plugins.CardinalityValueAdapter;
import org.jboss.beans.metadata.plugins.ControllerModeValueAdapter;
import org.jboss.beans.metadata.plugins.ControllerStateValueAdapter;
-import org.jboss.beans.metadata.api.model.FromContext;
-import org.jboss.beans.metadata.api.model.FromContextValueAdapter;
-import org.jboss.beans.metadata.api.model.InjectOption;
-import org.jboss.beans.metadata.api.model.InjectionOptionValueAdapter;
-import org.jboss.beans.metadata.api.model.AutowireType;
import org.jboss.dependency.spi.Cardinality;
import org.jboss.dependency.spi.ControllerMode;
import org.jboss.dependency.spi.ControllerState;
Modified: projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/inject/test/PropertyContextualInjection.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/inject/test/PropertyContextualInjection.xml 2008-07-07 08:53:07 UTC (rev 75428)
+++ projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/inject/test/PropertyContextualInjection.xml 2008-07-07 08:58:41 UTC (rev 75429)
@@ -9,7 +9,7 @@
</bean>
<bean name="testObject2" class="org.jboss.test.kernel.inject.support.PropertyInjectTestObject">
- <property name="duplicateTester"><inject type="ByName"/></property>
+ <property name="duplicateTester"><inject type="By_Name"/></property>
</bean>
<bean name="testObject3" class="org.jboss.test.kernel.inject.support.PropertyInjectTestObject">
Deleted: projects/microcontainer/trunk/spring-int/src/main/org/jboss/kernel/plugins/deployment/xml/InjectionHandler.java
===================================================================
--- projects/microcontainer/trunk/spring-int/src/main/org/jboss/kernel/plugins/deployment/xml/InjectionHandler.java 2008-07-07 08:53:07 UTC (rev 75428)
+++ projects/microcontainer/trunk/spring-int/src/main/org/jboss/kernel/plugins/deployment/xml/InjectionHandler.java 2008-07-07 08:58:41 UTC (rev 75429)
@@ -1,64 +0,0 @@
-/*
- *
- */
-
-package org.jboss.kernel.plugins.deployment.xml;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-
-import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData;
-import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
-import org.jboss.beans.metadata.api.model.InjectOption;
-import org.jboss.beans.metadata.api.model.FromContext;
-import org.jboss.beans.metadata.api.model.AutowireType;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler;
-import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
-import org.xml.sax.Attributes;
-
-/**
- * DependencyHandler.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 43106 $
- */
-public class InjectionHandler extends DefaultElementHandler
-{
- /** The handler */
- public static final InjectionHandler HANDLER = new InjectionHandler();
-
- public Object startElement(Object parent, QName name, ElementBinding element)
- {
- AbstractInjectionValueMetaData vmd = new AbstractInjectionValueMetaData();
- if (parent instanceof AbstractPropertyMetaData)
- {
- AbstractPropertyMetaData x = (AbstractPropertyMetaData) parent;
- vmd.setPropertyMetaData(x);
- }
- return vmd;
- }
-
- public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
- {
- AbstractInjectionValueMetaData injection = (AbstractInjectionValueMetaData) o;
- for (int i = 0; i < attrs.getLength(); ++i)
- {
- String localName = attrs.getLocalName(i);
- if ("bean".equals(localName))
- injection.setValue(attrs.getValue(i));
- else if ("property".equals(localName))
- injection.setProperty(attrs.getValue(i));
- else if ("state".equals(localName))
- injection.setDependentState(new ControllerState(attrs.getValue(i)));
- else if ("whenRequired".equals(localName))
- injection.setWhenRequiredState(new ControllerState(attrs.getValue(i)));
- else if ("type".equals(localName))
- injection.setInjectionType(AutowireType.getInstance(attrs.getValue(i)));
- else if ("option".equals(localName))
- injection.setInjectionOption(InjectOption.getInstance(attrs.getValue(i)));
- else if ("fromContext".equals(localName))
- injection.setFromContext(FromContext.getInstance(attrs.getValue(i)));
- }
- }
-}
More information about the jboss-cvs-commits
mailing list