[jboss-cvs] JBossAS SVN: r102407 - in projects/demos/microcontainer/trunk: threads and 10 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Mar 15 10:43:16 EDT 2010


Author: alesj
Date: 2010-03-15 10:43:16 -0400 (Mon, 15 Mar 2010)
New Revision: 102407

Added:
   projects/demos/microcontainer/trunk/threads/
   projects/demos/microcontainer/trunk/threads/pom.xml
   projects/demos/microcontainer/trunk/threads/src/
   projects/demos/microcontainer/trunk/threads/src/main/
   projects/demos/microcontainer/trunk/threads/src/main/java/
   projects/demos/microcontainer/trunk/threads/src/main/java/org/
   projects/demos/microcontainer/trunk/threads/src/main/java/org/jboss/
   projects/demos/microcontainer/trunk/threads/src/main/java/org/jboss/demos/
   projects/demos/microcontainer/trunk/threads/src/main/java/org/jboss/demos/bootstrap/
   projects/demos/microcontainer/trunk/threads/src/main/java/org/jboss/demos/bootstrap/threads/
   projects/demos/microcontainer/trunk/threads/src/main/java/org/jboss/demos/bootstrap/threads/ThreadsMain.java
   projects/demos/microcontainer/trunk/threads/src/main/resources/
   projects/demos/microcontainer/trunk/threads/src/main/resources/META-INF/
   projects/demos/microcontainer/trunk/threads/src/main/resources/META-INF/threads-deployers-beans.xml
   projects/demos/microcontainer/trunk/threads/src/main/resources/META-INF/threads-pool-beans.xml
   projects/demos/microcontainer/trunk/threads/src/main/resources/log4j.properties
Modified:
   projects/demos/microcontainer/trunk/pom.xml
Log:
Add threads demo -- to find the bug.

Modified: projects/demos/microcontainer/trunk/pom.xml
===================================================================
--- projects/demos/microcontainer/trunk/pom.xml	2010-03-15 14:40:01 UTC (rev 102406)
+++ projects/demos/microcontainer/trunk/pom.xml	2010-03-15 14:43:16 UTC (rev 102407)
@@ -33,6 +33,7 @@
     <module>bundle_user</module -->
     <module>vfs</module>
     <module>policy</module>
+    <module>threads</module>
     <!-- <module>osgi</module> -->
     <module>build</module>
   </modules>
@@ -48,7 +49,8 @@
     <version.org.jboss.common.core>2.2.17.GA</version.org.jboss.common.core>
     <version.org.jboss.common.logging.spi>2.2.0.CR1</version.org.jboss.common.logging.spi>
     <version.org.jboss.common.logging.log4j>2.2.0.CR1</version.org.jboss.common.logging.log4j>
-    <version.jbossxb>2.0.2.Beta5</version.jbossxb>
+    <version.org.jboss.xb>2.0.2.Beta5</version.org.jboss.xb>
+    <version.org.jboss.threads>2.0.0.CR3</version.org.jboss.threads>
     <version.org.jboss.aop>2.0.1.GA</version.org.jboss.aop>
     <version.org.jboss.test>1.0.5.GA</version.org.jboss.test>
     <version.junit>4.4</version.junit>
@@ -364,9 +366,29 @@
       <dependency>
         <groupId>org.jboss</groupId>
         <artifactId>jbossxb</artifactId>
-        <version>${version.jbossxb}</version>
+        <version>${version.org.jboss.xb}</version>
       </dependency>
       <dependency>
+        <groupId>org.jboss.threads</groupId>
+        <artifactId>jboss-threads</artifactId>
+        <version>${version.org.jboss.threads}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.threads</groupId>
+        <artifactId>jboss-threads-metadata</artifactId>
+        <version>${version.org.jboss.threads}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.jboss.microcontainer</groupId>
+            <artifactId>jboss-kernel</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.jboss.microcontainer</groupId>
+            <artifactId>jboss-aop-mc-int</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>
+      <dependency>
         <groupId>org.jboss</groupId>
         <artifactId>jboss-vfs</artifactId>
         <version>${version.org.jboss.vfs}</version>

Added: projects/demos/microcontainer/trunk/threads/pom.xml
===================================================================
--- projects/demos/microcontainer/trunk/threads/pom.xml	                        (rev 0)
+++ projects/demos/microcontainer/trunk/threads/pom.xml	2010-03-15 14:43:16 UTC (rev 102407)
@@ -0,0 +1,31 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.jboss.demos</groupId>
+    <artifactId>jboss-demos</artifactId>
+    <version>2.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.demos</groupId>
+  <artifactId>jboss-demos-threads</artifactId>
+  <packaging>jar</packaging>
+  <name>JBoss MC Demos Threads</name>
+  <url>http://www.jboss.org/jbossmc</url>
+  <description>JBoss MC Demos</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.demos</groupId>
+      <artifactId>jboss-demos-bootstrap</artifactId>
+    </dependency>
+    <!-- Compile (global dependencies) -->
+    <dependency>
+      <groupId>org.jboss.threads</groupId>
+      <artifactId>jboss-threads</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.threads</groupId>
+      <artifactId>jboss-threads-metadata</artifactId>
+    </dependency>
+  </dependencies>
+  
+</project>

Added: projects/demos/microcontainer/trunk/threads/src/main/java/org/jboss/demos/bootstrap/threads/ThreadsMain.java
===================================================================
--- projects/demos/microcontainer/trunk/threads/src/main/java/org/jboss/demos/bootstrap/threads/ThreadsMain.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/threads/src/main/java/org/jboss/demos/bootstrap/threads/ThreadsMain.java	2010-03-15 14:43:16 UTC (rev 102407)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.demos.bootstrap.threads;
+
+import org.jboss.demos.bootstrap.Main;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class ThreadsMain
+{
+   public static void main(String[] args)
+   {
+      Main.main(args);
+
+      try
+      {
+         Main.deploy(
+               "${demos.home}/threads/src/main/resources/META-INF/threads-deployers-beans.xml",
+               "${demos.home}/threads/src/main/resources/META-INF/threads-pool-beans.xml"
+         );
+
+         Main.validate();
+      }
+      catch (Throwable t)
+      {
+         t.printStackTrace();
+      }
+   }
+
+}

Added: projects/demos/microcontainer/trunk/threads/src/main/resources/META-INF/threads-deployers-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/threads/src/main/resources/META-INF/threads-deployers-beans.xml	                        (rev 0)
+++ projects/demos/microcontainer/trunk/threads/src/main/resources/META-INF/threads-deployers-beans.xml	2010-03-15 14:43:16 UTC (rev 102407)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+    <bean name="JBossThreadsMetaDataFactoryDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryDeployer">
+        <constructor>
+            <parameter>org.jboss.threads.metadata.ThreadsMetaData</parameter>
+        </constructor>
+    </bean>
+
+    <bean name="JBossThreadsMetaDataSchemaResolverDeployer" class="org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer">
+        <constructor>
+            <parameter>org.jboss.threads.metadata.ThreadsMetaData</parameter>
+        </constructor>
+        <property name="name">jboss-threads.xml</property>
+        <property name="registerWithJBossXB">true</property>
+    </bean>
+
+</deployment>

Added: projects/demos/microcontainer/trunk/threads/src/main/resources/META-INF/threads-pool-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/threads/src/main/resources/META-INF/threads-pool-beans.xml	                        (rev 0)
+++ projects/demos/microcontainer/trunk/threads/src/main/resources/META-INF/threads-pool-beans.xml	2010-03-15 14:43:16 UTC (rev 102407)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ 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.
+  -->
+
+<!-- Basic system thread pool deployment -->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <threads xmlns="urn:jboss:threads:2.0">
+
+      <!-- The system thread group for all JBoss threads. -->
+      <thread-group name="SystemThreadGroup" group-name="System Threads" daemon="true"/>
+
+      <!-- A simple direct executor which is always available for use. -->
+      <direct-executor name="DirectExecutor"/>
+
+      <!--
+        ~ This thread pool is for SHORT-RUNNING tasks that block very little or not at all.  Long-running
+        ~ tasks submitted to this pool may cause starvation and extended blocking.
+        -->
+      <thread-group name="ShortTasksThreadGroup" group-name="Short Tasks Threads">
+         <parent-thread-group name="SystemThreadGroup"/>
+      </thread-group>
+
+      <thread-factory name="ShortTasksThreadFactory">
+         <thread-group name="ShortTasksThreadGroup"/>
+      </thread-factory>
+
+      <bounded-queue-thread-pool-executor name="ThreadPool" blocking="true">
+         <thread-factory name="ShortTasksThreadFactory"/>
+         <queue-length count="500" per-cpu="200"/>
+         <core-threads count="5" per-cpu="2"/>
+         <max-threads count="10" per-cpu="3"/>
+         <keepalive-time time="30" unit="seconds"/>
+         <task-filter>
+            <clear-context-classloader/>
+            <clear-tls/>
+         </task-filter>
+      </bounded-queue-thread-pool-executor>
+
+      <!--
+        ~ This thread pool is for LONG-RUNNING tasks that may block for extended periods, such as
+        ~ blocking I/O network connection threads.  Short-running tasks submitted to this pool may
+        ~ cause excessive lock contention and performance degradation.
+        -->
+      <thread-group name="LongTasksThreadGroup" group-name="Long Tasks Threads">
+         <parent-thread-group name="SystemThreadGroup"/>
+      </thread-group>
+
+      <thread-factory name="LongTasksThreadFactory">
+         <thread-group name="LongTasksThreadGroup"/>
+      </thread-factory>
+
+      <queueless-thread-pool-executor name="LongRunningTasksThreadPool" blocking="true">
+         <max-threads count="200" per-cpu="500"/>
+         <thread-factory name="LongTasksThreadFactory"/>
+         <task-filter>
+            <clear-context-classloader/>
+            <clear-tls/>
+         </task-filter>
+      </queueless-thread-pool-executor>
+   </threads>
+
+</deployment>
\ No newline at end of file

Added: projects/demos/microcontainer/trunk/threads/src/main/resources/log4j.properties
===================================================================
--- projects/demos/microcontainer/trunk/threads/src/main/resources/log4j.properties	                        (rev 0)
+++ projects/demos/microcontainer/trunk/threads/src/main/resources/log4j.properties	2010-03-15 14:43:16 UTC (rev 102407)
@@ -0,0 +1,6 @@
+log4j.rootLogger=DEBUG, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=JBoss-MC-Demo %5p [%d{dd-MM-yyyy HH:mm:ss}] %c{1} - %m%n




More information about the jboss-cvs-commits mailing list