[jboss-cvs] JBossAS SVN: r98997 - in projects/jboss-man/branches/Branch_2_1/metatype/src: test/java/org/jboss/test/metatype/types/factory/support and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jan 4 13:09:38 EST 2010


Author: emuckenhuber
Date: 2010-01-04 13:09:38 -0500 (Mon, 04 Jan 2010)
New Revision: 98997

Added:
   projects/jboss-man/branches/Branch_2_1/metatype/src/main/java/org/jboss/metatype/plugins/types/JBossLoggerTypeBuilder.java
   projects/jboss-man/branches/Branch_2_1/metatype/src/test/java/org/jboss/test/metatype/types/factory/support/TestCompositeLogger.java
Modified:
   projects/jboss-man/branches/Branch_2_1/metatype/src/main/java/org/jboss/metatype/plugins/types/DefaultMetaTypeFactory.java
Log:
[JBMAN-94]

Modified: projects/jboss-man/branches/Branch_2_1/metatype/src/main/java/org/jboss/metatype/plugins/types/DefaultMetaTypeFactory.java
===================================================================
--- projects/jboss-man/branches/Branch_2_1/metatype/src/main/java/org/jboss/metatype/plugins/types/DefaultMetaTypeFactory.java	2010-01-04 18:09:09 UTC (rev 98996)
+++ projects/jboss-man/branches/Branch_2_1/metatype/src/main/java/org/jboss/metatype/plugins/types/DefaultMetaTypeFactory.java	2010-01-04 18:09:38 UTC (rev 98997)
@@ -39,6 +39,7 @@
 import org.jboss.beans.info.spi.PropertyInfo;
 import org.jboss.config.plugins.property.PropertyConfiguration;
 import org.jboss.config.spi.Configuration;
+import org.jboss.logging.Logger;
 import org.jboss.metatype.api.annotations.CompositeKey;
 import org.jboss.metatype.api.annotations.CompositeValue;
 import org.jboss.metatype.api.annotations.Generic;
@@ -113,6 +114,7 @@
       // Special types
       setBuilder(Class.class, ClassMetaTypeBuilder.INSTANCE);
       setBuilder(ObjectName.class, ObjectNameTypeBuilder.INSTANCE);
+      setBuilder(Logger.class, JBossLoggerTypeBuilder.INSTANCE);
    }
    
    @Override

Added: projects/jboss-man/branches/Branch_2_1/metatype/src/main/java/org/jboss/metatype/plugins/types/JBossLoggerTypeBuilder.java
===================================================================
--- projects/jboss-man/branches/Branch_2_1/metatype/src/main/java/org/jboss/metatype/plugins/types/JBossLoggerTypeBuilder.java	                        (rev 0)
+++ projects/jboss-man/branches/Branch_2_1/metatype/src/main/java/org/jboss/metatype/plugins/types/JBossLoggerTypeBuilder.java	2010-01-04 18:09:38 UTC (rev 98997)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.metatype.plugins.types;
+
+import org.jboss.logging.Logger;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.spi.types.MetaTypeBuilder;
+
+/**
+ * Don't try to create a metaType for Logger.
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossLoggerTypeBuilder implements MetaTypeBuilder
+{
+
+   /** The instance. */
+   public static final JBossLoggerTypeBuilder INSTANCE = new JBossLoggerTypeBuilder();
+   
+   /** The logger meta type. */
+   public static final MutableCompositeMetaType LOGGER_META_TYPE;
+   
+   static
+   {
+      LOGGER_META_TYPE = new MutableCompositeMetaType(
+            Logger.class.getName(), Logger.class.getName());
+      LOGGER_META_TYPE.freeze();
+   }
+   
+   public MetaType buildMetaType()
+   {
+      return LOGGER_META_TYPE;
+   }
+
+}
+

Added: projects/jboss-man/branches/Branch_2_1/metatype/src/test/java/org/jboss/test/metatype/types/factory/support/TestCompositeLogger.java
===================================================================
--- projects/jboss-man/branches/Branch_2_1/metatype/src/test/java/org/jboss/test/metatype/types/factory/support/TestCompositeLogger.java	                        (rev 0)
+++ projects/jboss-man/branches/Branch_2_1/metatype/src/test/java/org/jboss/test/metatype/types/factory/support/TestCompositeLogger.java	2010-01-04 18:09:38 UTC (rev 98997)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.test.metatype.types.factory.support;
+
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class TestCompositeLogger
+{
+
+   /** The logger. */
+   private Logger log;
+   
+   public Logger getLog()
+   {
+      return log;
+   }
+   
+}
+




More information about the jboss-cvs-commits mailing list