geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r578527 - in /geronimo/sandbox/gshell/trunk: gshell-assembly/src/main/underlay/etc/ gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/ gshell-remote/gshell-remote-common/src/main/java/org/apache/gero...
Date Sat, 22 Sep 2007 23:35:09 GMT
Author: jdillon
Date: Sat Sep 22 16:35:08 2007
New Revision: 578527

URL: http://svn.apache.org/viewvc?rev=578527&view=rev
Log:
Moved NamedThreadFactory and Duration to gshell-common

Added:
    geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Duration.java
  (contents, props changed)
      - copied, changed from r578526, geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/Duration.java
    geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/NamedThreadFactory.java
  (contents, props changed)
      - copied, changed from r578526, geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/NamedThreadFactory.java
Removed:
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/
Modified:
    geronimo/sandbox/gshell/trunk/gshell-assembly/src/main/underlay/etc/gsh-log4j.properties
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/Request.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/RequestManager.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/Requestor.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/session/ThreadPoolModel.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/Transport.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/base/BaseTransport.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerHandler.java

Modified: geronimo/sandbox/gshell/trunk/gshell-assembly/src/main/underlay/etc/gsh-log4j.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assembly/src/main/underlay/etc/gsh-log4j.properties?rev=578527&r1=578526&r2=578527&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assembly/src/main/underlay/etc/gsh-log4j.properties
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-assembly/src/main/underlay/etc/gsh-log4j.properties
Sat Sep 22 16:35:08 2007
@@ -44,7 +44,7 @@
 
 log4j.logger.org.apache.geronimo.gshell.plugin=INFO
 log4j.logger.org.apache.geronimo.gshell.console=INFO
-log4j.logger.org.apache.geronimo.gshell.remote.util.NamedThreadFactory=INFO
+log4j.logger.org.apache.geronimo.gshell.common.NamedThreadFactory=INFO
 log4j.logger.org.apache.geronimo.gshell.remote.session.ThreadPoolModel=INFO
 log4j.logger.org.apache.geronimo.gshell.remote.stream=INFO
 

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/Request.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/Request.java?rev=578527&r1=578526&r2=578527&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/Request.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/Request.java
Sat Sep 22 16:35:08 2007
@@ -31,8 +31,8 @@
 
 import org.apache.geronimo.gshell.common.tostring.ToStringBuilder;
 import org.apache.geronimo.gshell.common.tostring.ToStringStyle;
+import org.apache.geronimo.gshell.common.Duration;
 import org.apache.geronimo.gshell.remote.message.Message;
-import org.apache.geronimo.gshell.remote.util.Duration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/RequestManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/RequestManager.java?rev=578527&r1=578526&r2=578527&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/RequestManager.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/RequestManager.java
Sat Sep 22 16:35:08 2007
@@ -30,10 +30,10 @@
 
 import org.apache.geronimo.gshell.common.tostring.ToStringBuilder;
 import org.apache.geronimo.gshell.common.tostring.ToStringStyle;
+import org.apache.geronimo.gshell.common.Duration;
+import org.apache.geronimo.gshell.common.NamedThreadFactory;
 import org.apache.geronimo.gshell.remote.message.Message;
 import org.apache.geronimo.gshell.remote.session.SessionAttributeBinder;
-import org.apache.geronimo.gshell.remote.util.NamedThreadFactory;
-import org.apache.geronimo.gshell.remote.util.Duration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/Requestor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/Requestor.java?rev=578527&r1=578526&r2=578527&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/Requestor.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/request/Requestor.java
Sat Sep 22 16:35:08 2007
@@ -23,7 +23,7 @@
 
 import org.apache.geronimo.gshell.remote.message.Message;
 import org.apache.geronimo.gshell.remote.transport.Transport;
-import org.apache.geronimo.gshell.remote.util.Duration;
+import org.apache.geronimo.gshell.common.Duration;
 import org.apache.mina.common.IoFutureListener;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.WriteFuture;

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/session/ThreadPoolModel.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/session/ThreadPoolModel.java?rev=578527&r1=578526&r2=578527&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/session/ThreadPoolModel.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/session/ThreadPoolModel.java
Sat Sep 22 16:35:08 2007
@@ -24,7 +24,7 @@
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.geronimo.gshell.remote.util.NamedThreadFactory;
+import org.apache.geronimo.gshell.common.NamedThreadFactory;
 import org.apache.mina.common.IoFilterChain;
 import org.apache.mina.common.ThreadModel;
 import org.apache.mina.filter.executor.ExecutorFilter;

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/Transport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/Transport.java?rev=578527&r1=578526&r2=578527&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/Transport.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/Transport.java
Sat Sep 22 16:35:08 2007
@@ -25,7 +25,7 @@
 import java.util.concurrent.TimeUnit;
 
 import org.apache.geronimo.gshell.remote.message.Message;
-import org.apache.geronimo.gshell.remote.util.Duration;
+import org.apache.geronimo.gshell.common.Duration;
 import org.apache.mina.common.IoService;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.WriteFuture;

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/base/BaseTransport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/base/BaseTransport.java?rev=578527&r1=578526&r2=578527&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/base/BaseTransport.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/base/BaseTransport.java
Sat Sep 22 16:35:08 2007
@@ -34,7 +34,7 @@
 import org.apache.geronimo.gshell.remote.stream.SessionInputStream;
 import org.apache.geronimo.gshell.remote.stream.SessionOutputStream;
 import org.apache.geronimo.gshell.remote.transport.Transport;
-import org.apache.geronimo.gshell.remote.util.Duration;
+import org.apache.geronimo.gshell.common.Duration;
 import org.apache.mina.common.CloseFuture;
 import org.apache.mina.common.ConnectFuture;
 import org.apache.mina.common.IoConnector;

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerHandler.java?rev=578527&r1=578526&r2=578527&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerHandler.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerHandler.java
Sat Sep 22 16:35:08 2007
@@ -48,7 +48,7 @@
 import org.apache.geronimo.gshell.remote.session.SessionAttributeBinder;
 import org.apache.geronimo.gshell.remote.stream.SessionInputStream;
 import org.apache.geronimo.gshell.remote.stream.SessionOutputStream;
-import org.apache.geronimo.gshell.remote.util.NamedThreadFactory;
+import org.apache.geronimo.gshell.common.NamedThreadFactory;
 import org.apache.geronimo.gshell.shell.Environment;
 import org.apache.mina.common.IoSession;
 import org.codehaus.plexus.ContainerConfiguration;

Copied: geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Duration.java
(from r578526, geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/Duration.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Duration.java?p2=geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Duration.java&p1=geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/Duration.java&r1=578526&r2=578527&rev=578527&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/Duration.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Duration.java
Sat Sep 22 16:35:08 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.remote.util;
+package org.apache.geronimo.gshell.common;
 
 import java.io.Serializable;
 import java.util.concurrent.TimeUnit;

Propchange: geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Duration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Duration.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/Duration.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/NamedThreadFactory.java
(from r578526, geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/NamedThreadFactory.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/NamedThreadFactory.java?p2=geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/NamedThreadFactory.java&p1=geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/NamedThreadFactory.java&r1=578526&r2=578527&rev=578527&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/NamedThreadFactory.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/NamedThreadFactory.java
Sat Sep 22 16:35:08 2007
@@ -17,14 +17,11 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.remote.util;
+package org.apache.geronimo.gshell.common;
 
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 /**
  * A {@link ThreadFactory} which automatically generates thread names based off of a
  * pre-configured basename passed in during construction and a unique index.
@@ -34,25 +31,22 @@
 public class NamedThreadFactory
     implements ThreadFactory
 {
-    private final Logger log = LoggerFactory.getLogger(getClass());
-
-    private final String name;
+    private final String baseName;
 
     private final ThreadGroup group;
 
     private final AtomicLong counter = new AtomicLong(0);
 
-    public NamedThreadFactory(final String name, final ThreadGroup group) {
-        assert name != null;
+    public NamedThreadFactory(final String baseName, final ThreadGroup group) {
+        assert baseName != null;
         assert group != null;
 
-        this.name = name;
-
+        this.baseName = baseName;
         this.group = group;
     }
 
-    public NamedThreadFactory(final String name) {
-        this(name, Thread.currentThread().getThreadGroup());
+    public NamedThreadFactory(final String baseName) {
+        this(baseName, Thread.currentThread().getThreadGroup());
     }
 
     public NamedThreadFactory(final Class type) {
@@ -62,19 +56,35 @@
     public NamedThreadFactory(final Class type, final String suffix) {
         this(type.getSimpleName() + "-" + suffix);
     }
-    
+
+    public String getBaseName() {
+        return baseName;
+    }
+
+    public ThreadGroup getGroup() {
+        return group;
+    }
+
+    public long current() {
+        return counter.get();
+    }
+
+    //
+    // ThreadFactory
+    //
+
     public Thread newThread(final Runnable task) {
         assert task != null;
 
-        String id = name + "-" + counter.getAndIncrement();
-
-        Thread t = new Thread(group, task, id);
+        Thread t = new Thread(group, task, createName());
         
         configure(t);
 
-        log.debug("Created thread: {}", t);
-
         return t;
+    }
+
+    protected String createName() {
+        return baseName + "-" + counter.getAndIncrement();
     }
 
     protected void configure(final Thread t) {

Propchange: geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/NamedThreadFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/NamedThreadFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/main/java/org/apache/geronimo/gshell/common/NamedThreadFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message