[jboss-cvs] JBossAS SVN: r80104 - in projects/demos/microcontainer/trunk: bootstrap/src/main/java/org/jboss/demos/bootstrap and 11 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 27 09:27:28 EDT 2008
Author: alesj
Date: 2008-10-27 09:27:27 -0400 (Mon, 27 Oct 2008)
New Revision: 80104
Added:
projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/bootstrap/
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/access/FieldsBean.java
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/Circle.java
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/Shape.java
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/ShapeHolder.java
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/ShapeUser.java
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/ShapesChecker.java
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/Square.java
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/ManualService.java
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/ManualServiceUser.java
Removed:
projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/boostrap/
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/alias/
Modified:
projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/bootstrap/HDScanner.java
projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/bootstrap/Main.java
projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/bootstrap/MainDeployerHelper.java
projects/demos/microcontainer/trunk/bootstrap/src/main/resources/META-INF/bootstrap-beans-bak.xml
projects/demos/microcontainer/trunk/bootstrap/src/main/resources/META-INF/bootstrap-beans.xml
projects/demos/microcontainer/trunk/classloading/src/main/java/org/jboss/demos/bootstrap/cl/ClassLoadingMain.java
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/annotations/SimpleExecutor.java
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/builder/BuilderUtil.java
projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/OptionalServiceUser.java
projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/access-mode-beans.xml
projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/aliases-beans.xml
projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/autowire-beans.xml
projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/classloader-beans.xml
projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/controller-mode-beans.xml
projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/lifecycle-beans.xml
projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/value-factory-beans.xml
projects/demos/microcontainer/trunk/jmx/src/main/java/org/jboss/demos/bootstrap/jmx/JMXMain.java
projects/demos/microcontainer/trunk/osgi/boot/bootstrap-beans.xml
Log:
Remove alias javabean - CL issue.
Fix package name typo.
TODO on classloading + scope.
Add manual controller mode, autowiring and bean access mode.
Copied: projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/bootstrap (from rev 78584, projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/boostrap)
Modified: projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/bootstrap/HDScanner.java
===================================================================
--- projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/boostrap/HDScanner.java 2008-09-16 12:47:28 UTC (rev 78584)
+++ projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/bootstrap/HDScanner.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -19,7 +19,7 @@
* 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.boostrap;
+package org.jboss.demos.bootstrap;
import java.io.File;
import java.io.IOException;
Modified: projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/bootstrap/Main.java
===================================================================
--- projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/boostrap/Main.java 2008-09-16 12:47:28 UTC (rev 78584)
+++ projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/bootstrap/Main.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -19,7 +19,7 @@
* 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.boostrap;
+package org.jboss.demos.bootstrap;
import java.io.File;
import java.net.URL;
Modified: projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/bootstrap/MainDeployerHelper.java
===================================================================
--- projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/boostrap/MainDeployerHelper.java 2008-09-16 12:47:28 UTC (rev 78584)
+++ projects/demos/microcontainer/trunk/bootstrap/src/main/java/org/jboss/demos/bootstrap/MainDeployerHelper.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -19,7 +19,7 @@
* 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.boostrap;
+package org.jboss.demos.bootstrap;
import java.util.Map;
import java.util.HashMap;
Modified: projects/demos/microcontainer/trunk/bootstrap/src/main/resources/META-INF/bootstrap-beans-bak.xml
===================================================================
--- projects/demos/microcontainer/trunk/bootstrap/src/main/resources/META-INF/bootstrap-beans-bak.xml 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/bootstrap/src/main/resources/META-INF/bootstrap-beans-bak.xml 2008-10-27 13:27:27 UTC (rev 80104)
@@ -136,13 +136,13 @@
<!-- Hotdeployment of applications -->
- <bean name="MainDeployerHelper" class="org.jboss.demos.boostrap.MainDeployerHelper">
+ <bean name="MainDeployerHelper" class="org.jboss.demos.bootstrap.MainDeployerHelper">
<constructor>
<parameter><inject bean="MainDeployer"/></parameter>
</constructor>
</bean>
- <bean name="HDScanner" class="org.jboss.demos.boostrap.HDScanner">
+ <bean name="HDScanner" class="org.jboss.demos.bootstrap.HDScanner">
<constructor>
<parameter><inject bean="MainDeployerHelper"/></parameter>
<parameter>C:\\projects\\demos\\osgi\\boot\\work</parameter>
Modified: projects/demos/microcontainer/trunk/bootstrap/src/main/resources/META-INF/bootstrap-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/bootstrap/src/main/resources/META-INF/bootstrap-beans.xml 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/bootstrap/src/main/resources/META-INF/bootstrap-beans.xml 2008-10-27 13:27:27 UTC (rev 80104)
@@ -105,13 +105,13 @@
<!-- HD scanner -->
- <bean name="MainDeployerHelper" class="org.jboss.demos.boostrap.MainDeployerHelper">
+ <bean name="MainDeployerHelper" class="org.jboss.demos.bootstrap.MainDeployerHelper">
<constructor>
<parameter><inject bean="MainDeployer"/></parameter>
</constructor>
</bean>
- <bean name="HDScanner" class="org.jboss.demos.boostrap.HDScanner">
+ <bean name="HDScanner" class="org.jboss.demos.bootstrap.HDScanner">
<constructor>
<parameter><inject bean="MainDeployerHelper"/></parameter>
<parameter>${demos.home}/sandbox</parameter>
Modified: projects/demos/microcontainer/trunk/classloading/src/main/java/org/jboss/demos/bootstrap/cl/ClassLoadingMain.java
===================================================================
--- projects/demos/microcontainer/trunk/classloading/src/main/java/org/jboss/demos/bootstrap/cl/ClassLoadingMain.java 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/classloading/src/main/java/org/jboss/demos/bootstrap/cl/ClassLoadingMain.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -21,7 +21,7 @@
*/
package org.jboss.demos.bootstrap.cl;
-import org.jboss.demos.boostrap.Main;
+import org.jboss.demos.bootstrap.Main;
/**
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
Added: projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/access/FieldsBean.java
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/access/FieldsBean.java (rev 0)
+++ projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/access/FieldsBean.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -0,0 +1,36 @@
+/*
+* 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.access;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class FieldsBean
+{
+ private String string;
+
+ public void start()
+ {
+ if (string == null)
+ throw new IllegalArgumentException("Strings should be set!");
+ }
+}
Modified: projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/annotations/SimpleExecutor.java
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/annotations/SimpleExecutor.java 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/annotations/SimpleExecutor.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -31,6 +31,6 @@
public void execute() throws Exception
{
Random random = new Random();
- Thread.sleep(random.nextLong() % 1000l);
+ Thread.sleep(Math.abs(random.nextLong() % 1000l));
}
}
\ No newline at end of file
Added: projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/Circle.java
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/Circle.java (rev 0)
+++ projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/Circle.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -0,0 +1,33 @@
+/*
+* 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.autowire;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class Circle implements Shape
+{
+ public String name()
+ {
+ return "circle";
+ }
+}
\ No newline at end of file
Added: projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/Shape.java
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/Shape.java (rev 0)
+++ projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/Shape.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -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.autowire;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface Shape
+{
+ String name();
+}
Added: projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/ShapeHolder.java
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/ShapeHolder.java (rev 0)
+++ projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/ShapeHolder.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -0,0 +1,54 @@
+/*
+* 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.autowire;
+
+import java.util.Set;
+
+import org.jboss.util.collection.CollectionsFactory;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ShapeHolder
+{
+ private Set<Shape> shapes;
+
+ public synchronized void addShape(Shape shape)
+ {
+ if (shapes == null)
+ shapes = CollectionsFactory.createLazySet();
+
+ shapes.add(shape);
+ }
+
+ public void check(int size)
+ {
+ if (shapes == null || size != shapes.size())
+ throw new IllegalArgumentException("Illegal shapes size: " + shapes + " != " + size);
+ }
+
+ public void removeShape(Shape shape)
+ {
+ if (shapes != null)
+ shapes.remove(shape);
+ }
+}
\ No newline at end of file
Added: projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/ShapeUser.java
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/ShapeUser.java (rev 0)
+++ projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/ShapeUser.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -0,0 +1,41 @@
+/*
+* 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.autowire;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ShapeUser
+{
+ private Shape shape;
+
+ public ShapeUser(Shape shape)
+ {
+ this.shape = shape;
+ }
+
+ public Shape getShape()
+ {
+ return shape;
+ }
+}
+
Added: projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/ShapesChecker.java
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/ShapesChecker.java (rev 0)
+++ projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/ShapesChecker.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -0,0 +1,46 @@
+/*
+* 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.autowire;
+
+import org.jboss.beans.metadata.api.annotations.Constructor;
+import org.jboss.beans.metadata.api.annotations.Depends;
+import org.jboss.beans.metadata.api.annotations.Inject;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Depends({"Square", "Circle"})
+public class ShapesChecker
+{
+ private ShapeHolder holder;
+
+ @Constructor
+ public ShapesChecker(@Inject(dependentState = "Installed") ShapeHolder holder)
+ {
+ this.holder = holder;
+ }
+
+ public void start()
+ {
+ holder.check(1);
+ }
+}
Added: projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/Square.java
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/Square.java (rev 0)
+++ projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/autowire/Square.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -0,0 +1,33 @@
+/*
+* 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.autowire;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class Square implements Shape
+{
+ public String name()
+ {
+ return "square";
+ }
+}
\ No newline at end of file
Modified: projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/builder/BuilderUtil.java
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/builder/BuilderUtil.java 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/builder/BuilderUtil.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -44,7 +44,7 @@
public void create() throws Throwable
{
BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("BUExample", BuilderExample.class.getName());
- builder.addStartParameter(Kernel.class.getName(), KernelConstants.KERNEL_NAME);
+ builder.addStartParameter(Kernel.class.getName(), builder.createInject(KernelConstants.KERNEL_NAME));
controller.install(builder.getBeanMetaData());
}
Copied: projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/ManualService.java (from rev 80076, projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/OptionalService.java)
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/ManualService.java (rev 0)
+++ projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/ManualService.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -0,0 +1,29 @@
+/*
+* 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.mode;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ManualService
+{
+}
\ No newline at end of file
Added: projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/ManualServiceUser.java
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/ManualServiceUser.java (rev 0)
+++ projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/ManualServiceUser.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -0,0 +1,63 @@
+/*
+* 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.mode;
+
+import org.jboss.beans.metadata.api.annotations.Constructor;
+import org.jboss.beans.metadata.api.annotations.Inject;
+import org.jboss.dependency.spi.Controller;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ManualServiceUser
+{
+ private static final String MS_NAME = "ManualService";
+ private Controller controller;
+
+ @Constructor
+ public ManualServiceUser(@Inject(bean = KernelConstants.KERNEL_CONTROLLER_NAME) Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void start(ControllerContext mc) throws Throwable
+ {
+ if (ControllerState.NOT_INSTALLED.equals(mc.getState()) == false)
+ throw new IllegalArgumentException(MS_NAME + " should be NOT installed.");
+
+ // get un-wrapped ControllerContext
+ mc = controller.getContext(mc.getName(), null);
+ controller.change(mc, ControllerState.INSTALLED);
+
+ if (ControllerState.INSTALLED.equals(mc.getState()) == false)
+ throw new IllegalArgumentException(MS_NAME + " should BE installed.");
+ }
+
+ public void stop() throws Throwable
+ {
+ ControllerContext mc = controller.getInstalledContext(MS_NAME);
+ controller.change(mc, ControllerState.NOT_INSTALLED);
+ }
+}
\ No newline at end of file
Modified: projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/OptionalServiceUser.java
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/OptionalServiceUser.java 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/ioc/src/main/java/org/jboss/demos/ioc/mode/OptionalServiceUser.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -36,6 +36,7 @@
*/
public class OptionalServiceUser
{
+ private static final String OS_NAME = "OptionalService";
private KernelController controller;
@Constructor
@@ -46,23 +47,23 @@
public void create() throws Throwable
{
- ControllerContext os = controller.getInstalledContext("OptionalService");
+ ControllerContext os = controller.getInstalledContext(OS_NAME);
if (os != null && os.getState().equals(ControllerState.INSTALLED))
throw new IllegalArgumentException("Optional service should NOT be installed.");
// add dependency, so that we wait till OSCaller is instantiated - hence invoking OptionalService
- ControllerContext thisContext = controller.getContext("OptionalServiceUser", null);
+ ControllerContext thisContext = controller.getContext(OS_NAME + "User", null);
DependencyInfo di = thisContext.getDependencyInfo();
di.addIDependOn(new AbstractDependencyItem(thisContext.getName(), "OSCaller", ControllerState.START, ControllerState.INSTANTIATED));
BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("OSCaller", OptionalServiceCaller.class.getName());
- builder.addConstructorParameter(OptionalService.class.getName(), builder.createInject("OptionalService"));
+ builder.addConstructorParameter(OptionalService.class.getName(), builder.createInject(OS_NAME));
controller.install(builder.getBeanMetaData());
}
public void start()
{
- ControllerContext os = controller.getInstalledContext("OptionalService");
+ ControllerContext os = controller.getInstalledContext(OS_NAME);
if (os == null || os.getState().equals(ControllerState.INSTALLED) == false)
throw new IllegalArgumentException("Optional service should BE installed.");
}
Modified: projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/access-mode-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/access-mode-beans.xml 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/access-mode-beans.xml 2008-10-27 13:27:27 UTC (rev 80104)
@@ -1,5 +1,7 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
-<!-- TODO -->
+ <bean name="FieldsBean" class="org.jboss.demos.ioc.access.FieldsBean" access-mode="ALL">
+ <property name="string">InternalString</property>
+ </bean>
</deployment>
Modified: projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/aliases-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/aliases-beans.xml 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/aliases-beans.xml 2008-10-27 13:27:27 UTC (rev 80104)
@@ -4,7 +4,7 @@
<alias>SimpleAlias</alias>
<alias replace="true">${some.system.property}</alias>
<alias class="java.lang.Integer">12345</alias>
- <alias><javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.demos.ioc.alias.AliasJavaBean"/></alias>
+ <alias><javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.demos.bootstrap.Main"/></alias>
</bean>
</deployment>
Modified: projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/autowire-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/autowire-beans.xml 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/autowire-beans.xml 2008-10-27 13:27:27 UTC (rev 80104)
@@ -1,5 +1,19 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
-<!-- TODO -->
+ <bean name="Square" class="org.jboss.demos.ioc.autowire.Square" autowire-candidate="false"/>
+ <bean name="Circle" class="org.jboss.demos.ioc.autowire.Circle"/>
+ <bean name="ShapeUser" class="org.jboss.demos.ioc.autowire.ShapeUser">
+ <constructor>
+ <parameter><inject/></parameter>
+ </constructor>
+ </bean>
+
+ <bean name="ShapeHolder" class="org.jboss.demos.ioc.autowire.ShapeHolder">
+ <incallback method="addShape"/>
+ <uncallback method="removeShape"/>
+ </bean>
+
+ <bean name="ShapeChecker" class="org.jboss.demos.ioc.autowire.ShapesChecker"/>
+
</deployment>
Modified: projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/classloader-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/classloader-beans.xml 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/classloader-beans.xml 2008-10-27 13:27:27 UTC (rev 80104)
@@ -1,19 +1,25 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <classloader><inject bean="custom-classloader:0.0.0"/></classloader>
+ <!-- TODO - fix me -->
+ <!--<classloader><inject bean="custom-classloader:0.0.0"/></classloader>-->
+
<classloader name="custom-classloader" xmlns="urn:jboss:classloader:1.0" export-all="NON_EMPTY" import-all="true"/>
+<!--
<bean name="CustomCL" class="org.jboss.demos.ioc.classloader.CustomClassLoader">
<constructor>
<parameter><inject bean="custom-classloader:0.0.0"/></parameter>
</constructor>
</bean>
+-->
<bean name="CB1" class="org.jboss.demos.ioc.classloader.CustomBean"/>
+<!--
<bean name="CB2" class="org.jboss.demos.ioc.classloader.CustomBean">
<classloader><inject bean="CustomCL"/></classloader>
</bean>
+-->
</deployment>
Modified: projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/controller-mode-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/controller-mode-beans.xml 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/controller-mode-beans.xml 2008-10-27 13:27:27 UTC (rev 80104)
@@ -4,4 +4,12 @@
<bean name="OptionalServiceUser" class="org.jboss.demos.ioc.mode.OptionalServiceUser"/>
+ <bean name="ManualService" class="org.jboss.demos.ioc.mode.ManualService" mode="Manual"/>
+
+ <bean name="ManualServiceUser" class="org.jboss.demos.ioc.mode.ManualServiceUser">
+ <start>
+ <parameter><inject bean="ManualService" fromContext="context" state="Not Installed"/></parameter>
+ </start>
+ </bean>
+
</deployment>
Modified: projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/lifecycle-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/lifecycle-beans.xml 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/lifecycle-beans.xml 2008-10-27 13:27:27 UTC (rev 80104)
@@ -3,11 +3,11 @@
<bean name="FullLifecycleBean-3" class="org.jboss.demos.ioc.lifecycle.FullLifecycleBean"/>
<bean name="FullLifecycleBean-2" class="org.jboss.demos.ioc.lifecycle.FullLifecycleBean">
- <create ignore="true"/>
+ <create ignored="true"/>
</bean>
<bean name="FullLifecycleBean-1" class="org.jboss.demos.ioc.lifecycle.FullLifecycleBean">
- <start ignore="true"/>
+ <start ignored="true"/>
</bean>
<bean name="LifecycleChecker" class="org.jboss.demos.ioc.lifecycle.LifecycleChecker"/>
Modified: projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/value-factory-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/value-factory-beans.xml 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/ioc/src/main/resources/META-INF/value-factory-beans.xml 2008-10-27 13:27:27 UTC (rev 80104)
@@ -18,16 +18,16 @@
</bean>
<bean name="PortsConfig" class="org.jboss.demos.ioc.vf.PortsConfig">
- <property name="http"><value-factory bean="Binding" parameter="http"/></property>
- <property name="ssh"><value-factory bean="Binding" parameter="ssh"/></property>
+ <property name="http"><value-factory bean="Binding" method="getPort" parameter="http"/></property>
+ <property name="ssh"><value-factory bean="Binding" method="getPort" parameter="ssh"/></property>
<property name="ftp">
- <value-factory bean="Binding">
+ <value-factory bean="Binding" method="getPort">
<parameter>ftp</parameter>
<parameter>21</parameter>
</value-factory>
</property>
<property name="mail">
- <value-factory bean="Binding">
+ <value-factory bean="Binding" method="getPort">
<parameter>mail</parameter>
<parameter>25</parameter>
</value-factory>
Modified: projects/demos/microcontainer/trunk/jmx/src/main/java/org/jboss/demos/bootstrap/jmx/JMXMain.java
===================================================================
--- projects/demos/microcontainer/trunk/jmx/src/main/java/org/jboss/demos/bootstrap/jmx/JMXMain.java 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/jmx/src/main/java/org/jboss/demos/bootstrap/jmx/JMXMain.java 2008-10-27 13:27:27 UTC (rev 80104)
@@ -21,7 +21,7 @@
*/
package org.jboss.demos.bootstrap.jmx;
-import org.jboss.demos.boostrap.Main;
+import org.jboss.demos.bootstrap.Main;
/**
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
Modified: projects/demos/microcontainer/trunk/osgi/boot/bootstrap-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/osgi/boot/bootstrap-beans.xml 2008-10-27 12:54:42 UTC (rev 80103)
+++ projects/demos/microcontainer/trunk/osgi/boot/bootstrap-beans.xml 2008-10-27 13:27:27 UTC (rev 80104)
@@ -176,13 +176,13 @@
</bean>
<!-- Hotdeployment of applications -->
- <bean name="MainDeployerHelper" class="org.jboss.demos.boostrap.MainDeployerHelper">
+ <bean name="MainDeployerHelper" class="org.jboss.demos.bootstrap.MainDeployerHelper">
<constructor>
<parameter><inject bean="MainDeployer"/></parameter>
</constructor>
</bean>
- <bean name="HDScanner" class="org.jboss.demos.boostrap.HDScanner">
+ <bean name="HDScanner" class="org.jboss.demos.bootstrap.HDScanner">
<constructor>
<parameter><inject bean="MainDeployerHelper"/></parameter>
<parameter>C:\\projects\\demos\\osgi\\boot\\work</parameter>
More information about the jboss-cvs-commits
mailing list