Return-Path: Delivered-To: apmail-jakarta-jcs-dev-archive@www.apache.org Received: (qmail 48185 invoked from network); 3 Aug 2005 03:53:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Aug 2005 03:53:37 -0000 Received: (qmail 53180 invoked by uid 500); 3 Aug 2005 03:53:37 -0000 Delivered-To: apmail-jakarta-jcs-dev-archive@jakarta.apache.org Received: (qmail 53150 invoked by uid 500); 3 Aug 2005 03:53:36 -0000 Mailing-List: contact jcs-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JCS Developers List" Delivered-To: mailing list jcs-dev@jakarta.apache.org Received: (qmail 53137 invoked by uid 500); 3 Aug 2005 03:53:36 -0000 Delivered-To: apmail-jakarta-jcs-commits@jakarta.apache.org Received: (qmail 53134 invoked by uid 500); 3 Aug 2005 03:53:36 -0000 Delivered-To: apmail-jakarta-jcs-cvs@jakarta.apache.org Received: (qmail 53131 invoked by uid 99); 3 Aug 2005 03:53:36 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 02 Aug 2005 20:53:25 -0700 Received: (qmail 47860 invoked by uid 65534); 3 Aug 2005 03:53:23 -0000 Message-ID: <20050803035323.47832.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r227155 - in /jakarta/jcs/trunk/src: java/org/apache/jcs/auxiliary/lateral/ java/org/apache/jcs/auxiliary/lateral/socket/tcp/ java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/ java/org/apache/jcs/engine/control/ test/org/apache/jc... Date: Wed, 03 Aug 2005 03:53:21 -0000 To: jcs-cvs@jakarta.apache.org From: asmuts@apache.org X-Mailer: svnmailer-1.0.3 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: asmuts Date: Tue Aug 2 20:53:04 2005 New Revision: 227155 URL: http://svn.apache.org/viewcvs?rev=227155&view=rev Log: Added more logging. Prevented manager from initializing with a null props file. Added better error when config file can't be found. Trying to figure out a way to kill the UDP recevier thread. It is a daemon, but it seems to be blocking on a wait for message call. Made tester class exit with the vm, to help manually detect these kinds of issues. Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheFactory.java jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryReceiver.java jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryService.java jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheManager.java jakarta/jcs/trunk/src/test/org/apache/jcs/access/TestCacheAccess.java Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheFactory.java URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheFactory.java?rev=227155&r1=227154&r2=227155&view=diff ============================================================================== --- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheFactory.java (original) +++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheFactory.java Tue Aug 2 20:53:04 2005 @@ -16,7 +16,6 @@ * limitations under the License. */ -import java.io.IOException; import java.util.ArrayList; import java.util.StringTokenizer; Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java?rev=227155&r1=227154&r2=227155&view=diff ============================================================================== --- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java (original) +++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java Tue Aug 2 20:53:04 2005 @@ -259,9 +259,9 @@ public void handleDispose( String cacheName ) throws IOException { - if ( log.isDebugEnabled() ) + if ( log.isInfoEnabled() ) { - log.debug( "handleDispose> cacheName=" + cacheName ); + log.info( "handleDispose > cacheName=" + cacheName ); } CompositeCacheManager cm = cacheMgr; Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryReceiver.java URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryReceiver.java?rev=227155&r1=227154&r2=227155&view=diff ============================================================================== --- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryReceiver.java (original) +++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryReceiver.java Tue Aug 2 20:53:04 2005 @@ -35,6 +35,7 @@ import EDU.oswego.cs.dl.util.concurrent.BoundedBuffer; import EDU.oswego.cs.dl.util.concurrent.PooledExecutor; +import EDU.oswego.cs.dl.util.concurrent.ThreadFactory; /** * Receives UDP Discovery messages. @@ -88,6 +89,7 @@ pooledExecutor = new PooledExecutor( new BoundedBuffer( 100 ), maxPoolSize ); pooledExecutor.discardOldestWhenBlocked(); //pooledExecutor.setMinimumPoolSize(1); + pooledExecutor.setThreadFactory( new MyThreadFactory() ); log.debug( "constructing listener, " + this.multicastAddressString + ":" + this.multicastPort ); @@ -206,7 +208,7 @@ } catch ( Exception e ) { - // nopt + log.error( "Unexpected exception in UDP receiver.", e ); } } @@ -347,5 +349,29 @@ } } + /** + * Allows us to set the daemon status on the executor threads + * + * @author aaronsm + * + */ + class MyThreadFactory + implements ThreadFactory + { + + /* + * (non-Javadoc) + * + * @see EDU.oswego.cs.dl.util.concurrent.ThreadFactory#newThread(java.lang.Runnable) + */ + public Thread newThread( Runnable runner ) + { + Thread t = new Thread( runner ); + t.setDaemon( true ); + t.setPriority( Thread.MIN_PRIORITY ); + return t; + } + + } } // end class Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryService.java URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryService.java?rev=227155&r1=227154&r2=227155&view=diff ============================================================================== --- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryService.java (original) +++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryService.java Tue Aug 2 20:53:04 2005 @@ -85,6 +85,7 @@ receiver = new UDPDiscoveryReceiver( this, lca.getUdpDiscoveryAddr(), lca.getUdpDiscoveryPort() ); Thread t = new Thread(receiver); t.setDaemon(true); + //t.setName( t.getName() + "--UDPReceiver" ); t.start(); } catch ( Exception e ) Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheManager.java URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheManager.java?rev=227155&r1=227154&r2=227155&view=diff ============================================================================== --- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheManager.java (original) +++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheManager.java Tue Aug 2 20:53:04 2005 @@ -157,36 +157,45 @@ */ public void configure( String propFile ) { - log.debug( "Creating cache manager from config file: " + propFile ); + log.info( "Creating cache manager from config file: " + propFile ); Properties props = new Properties(); InputStream is = getClass().getResourceAsStream( propFile ); - try + if ( is != null ) { - props.load( is ); - - if ( log.isDebugEnabled() ) + try { - log.debug( "File contained " + props.size() + " properties" ); + props.load( is ); + + if ( log.isDebugEnabled() ) + { + log.debug( "File [" + propFile + "] contained " + props.size() + " properties" ); + } } - } - catch ( IOException ex ) - { - log.error( "Failed to load properties", ex ); - throw new IllegalStateException( ex.getMessage() ); - } - finally - { - try + catch ( IOException ex ) { - is.close(); + log.error( "Failed to load properties for name [" + propFile + "]", ex ); + throw new IllegalStateException( ex.getMessage() ); } - catch ( Exception ignore ) + finally { - // Ignored + try + { + is.close(); + } + catch ( Exception ignore ) + { + // Ignored + } } + + } + else + { + log.error( "Failed to load properties for name [" + propFile + "]" ); + throw new IllegalStateException( "Failed to load properties for name [" + propFile + "]" ); } configure( props ); @@ -199,16 +208,23 @@ */ public void configure( Properties props ) { - // set the props value and then configure the ThreadPoolManager - ThreadPoolManager.setProps( props ); - ThreadPoolManager poolMgr = ThreadPoolManager.getInstance(); + if ( props != null ) + { + // set the props value and then configure the ThreadPoolManager + ThreadPoolManager.setProps( props ); + ThreadPoolManager poolMgr = ThreadPoolManager.getInstance(); - // configure the cache - CompositeCacheConfigurator configurator = new CompositeCacheConfigurator( this ); + // configure the cache + CompositeCacheConfigurator configurator = new CompositeCacheConfigurator( this ); - configurator.doConfigure( props ); + configurator.doConfigure( props ); - this.props = props; + this.props = props; + } + else + { + log.error( "No properties found. Please configure the cache correctly." ); + } } /** @@ -282,6 +298,7 @@ /** * If the cache is created the CacheAttributes and the element Attributes * will be ignored. Currently there is no overiding once it is set up. + *

* Overriding hte default elemental atributes will require cahnging the way * the atributes are assigned to elements. Get cache creates a cache with * defaults if none are specified. We might want to create separate method Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/access/TestCacheAccess.java URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/test/org/apache/jcs/access/TestCacheAccess.java?rev=227155&r1=227154&r2=227155&view=diff ============================================================================== --- jakarta/jcs/trunk/src/test/org/apache/jcs/access/TestCacheAccess.java (original) +++ jakarta/jcs/trunk/src/test/org/apache/jcs/access/TestCacheAccess.java Tue Aug 2 20:53:04 2005 @@ -66,7 +66,7 @@ } catch ( Exception e ) { - log.error( e ); + log.error( "Problem getting cache instance", e ); p( e.toString() ); } } @@ -129,7 +129,8 @@ CompositeCacheManager.getInstance().shutDown(); //cache_control.dispose(); notDone = false; - System.exit( -1 ); + //System.exit( -1 ); + return; } else --------------------------------------------------------------------- To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: jcs-dev-help@jakarta.apache.org