[jboss-cvs] JBossAS SVN: r76125 - in projects/demos/trunk/ioc/src: main/org/jboss/demos/ioc/callback and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jul 23 06:08:06 EDT 2008


Author: alesj
Date: 2008-07-23 06:08:06 -0400 (Wed, 23 Jul 2008)
New Revision: 76125

Added:
   projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/
   projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/ILazyPojo.java
   projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/LazyImpl.java
   projects/demos/trunk/ioc/src/resources/META-INF/lazy-beans.xml
Modified:
   projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/callback/Checker.java
Log:
Lazy example.

Modified: projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/callback/Checker.java
===================================================================
--- projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/callback/Checker.java	2008-07-23 08:42:10 UTC (rev 76124)
+++ projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/callback/Checker.java	2008-07-23 10:08:06 UTC (rev 76125)
@@ -42,7 +42,7 @@
    {
       Set<Object> expected = new HashSet<Object>();
       expected.add(Long.parseLong("42"));
-      expected.add(3.14);
+      expected.add(Double.parseDouble("3.14"));
       expected.add(new URL("http://www.jboss.org"));
       expected.add(new Locale("SI"));
       if (expected.equals(elements) == false)

Added: projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/ILazyPojo.java
===================================================================
--- projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/ILazyPojo.java	                        (rev 0)
+++ projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/ILazyPojo.java	2008-07-23 10:08:06 UTC (rev 76125)
@@ -0,0 +1,30 @@
+/*
+* 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.demos.ioc.lazy;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ILazyPojo
+{
+   ILazyPojo getOther();
+}

Added: projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/LazyImpl.java
===================================================================
--- projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/LazyImpl.java	                        (rev 0)
+++ projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/LazyImpl.java	2008-07-23 10:08:06 UTC (rev 76125)
@@ -0,0 +1,45 @@
+/*
+* 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.demos.ioc.lazy;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class LazyImpl implements ILazyPojo
+{
+   private ILazyPojo other;
+
+   public LazyImpl(ILazyPojo other)
+   {
+      this.other = other;
+   }
+
+   public ILazyPojo getOther()
+   {
+      return other;
+   }
+
+   public void setOther(ILazyPojo other)
+   {
+      this.other = other;
+   }
+}

Copied: projects/demos/trunk/ioc/src/resources/META-INF/lazy-beans.xml (from rev 76109, projects/demos/trunk/ioc/src/resources/META-INF/callback-beans.xml)
===================================================================
--- projects/demos/trunk/ioc/src/resources/META-INF/lazy-beans.xml	                        (rev 0)
+++ projects/demos/trunk/ioc/src/resources/META-INF/lazy-beans.xml	2008-07-23 10:08:06 UTC (rev 76125)
@@ -0,0 +1,23 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="lazyA" class="org.jboss.demos.ioc.lazy.LazyImpl">
+    <constructor>
+      <parameter>
+        <lazy bean="lazyB">
+          <interface>org.jboss.demos.ioc.lazy.ILazyPojo</interface>
+        </lazy>
+      </parameter>
+    </constructor>
+  </bean>
+
+  <bean name="lazyB" class="org.jboss.demos.ioc.lazy.LazyImpl">
+    <constructor>
+      <parameter>
+        <lazy bean="lazyA">
+          <interface>org.jboss.demos.ioc.lazy.ILazyPojo</interface>
+        </lazy>
+      </parameter>
+    </constructor>
+  </bean>
+
+</deployment>




More information about the jboss-cvs-commits mailing list