Merge remote-tracking branch 'origin/master' into jetty-8

Conflicts:
	jetty-spdy/spdy-jetty-http-webapp/pom.xml
	jetty-spdy/spdy-jetty-http/pom.xml
	jetty-spdy/spdy-jetty/pom.xml
This commit is contained in:
Greg Wilkins 2012-03-19 17:22:02 +11:00
commit d8b1d80e4e
20 changed files with 260 additions and 105 deletions

View File

@ -276,6 +276,11 @@ class SelectConnector extends AggregateLifeCycle implements HttpClient.Connector
_endp.shutdownOutput(); _endp.shutdownOutput();
} }
public void dispatch()
{
_endp.asyncDispatch();
}
public void asyncDispatch() public void asyncDispatch()
{ {
_endp.asyncDispatch(); _endp.asyncDispatch();

View File

@ -103,6 +103,16 @@
<outputDirectory>${assembly-directory}/webapps</outputDirectory> <outputDirectory>${assembly-directory}/webapps</outputDirectory>
<destFileName>test.war</destFileName> <destFileName>test.war</destFileName>
</artifactItem> </artifactItem>
<artifactItem>
<groupId>org.eclipse.jetty.spdy</groupId>
<artifactId>spdy-jetty-http-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>true</overWrite>
<includes>**</includes>
<outputDirectory>${assembly-directory}/webapps</outputDirectory>
<destFileName>spdy.war</destFileName>
</artifactItem>
<artifactItem> <artifactItem>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-start</artifactId> <artifactId>jetty-start</artifactId>
@ -124,12 +134,24 @@
</goals> </goals>
<configuration> <configuration>
<includeGroupIds>org.eclipse.jetty</includeGroupIds> <includeGroupIds>org.eclipse.jetty</includeGroupIds>
<excludeGroupIds>org.eclipse.jetty.orbit</excludeGroupIds> <excludeGroupIds>org.eclipse.jetty.orbit,org.eclipse.jetty.spdy</excludeGroupIds>
<excludeArtifactIds>jetty-all,jetty-start,jetty-monitor,jetty-jsp</excludeArtifactIds> <excludeArtifactIds>jetty-all,jetty-start,jetty-monitor,jetty-jsp</excludeArtifactIds>
<includeTypes>jar</includeTypes> <includeTypes>jar</includeTypes>
<outputDirectory>${assembly-directory}/lib</outputDirectory> <outputDirectory>${assembly-directory}/lib</outputDirectory>
</configuration> </configuration>
</execution> </execution>
<execution>
<id>copy-lib-spdy-deps</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>org.eclipse.jetty.spdy</includeGroupIds>
<includeTypes>jar</includeTypes>
<outputDirectory>${assembly-directory}/lib/spdy</outputDirectory>
</configuration>
</execution>
<execution> <execution>
<id>copy-orbit-servlet-api-deps</id> <id>copy-orbit-servlet-api-deps</id>
<phase>generate-resources</phase> <phase>generate-resources</phase>
@ -222,7 +244,7 @@
<goal>unpack-dependencies</goal> <goal>unpack-dependencies</goal>
</goals> </goals>
<configuration> <configuration>
<includeGroupIds>org.eclipse.jetty</includeGroupIds> <includeGroupIds>org.eclipse.jetty,org.eclipse.jetty.spdy</includeGroupIds>
<classifier>config</classifier> <classifier>config</classifier>
<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact> <failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
<excludes>META-INF/**</excludes> <excludes>META-INF/**</excludes>
@ -398,6 +420,27 @@
<artifactId>jetty-overlay-deployer</artifactId> <artifactId>jetty-overlay-deployer</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.eclipse.jetty.spdy</groupId>
<artifactId>spdy-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.spdy</groupId>
<artifactId>spdy-jetty</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.spdy</groupId>
<artifactId>spdy-jetty-http</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.spdy</groupId>
<artifactId>spdy-jetty-http-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty.aggregate</groupId> <groupId>org.eclipse.jetty.aggregate</groupId>
<artifactId>jetty-all</artifactId> <artifactId>jetty-all</artifactId>

View File

@ -19,7 +19,14 @@ public interface AsyncEndPoint extends ConnectedEndPoint
{ {
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* Dispatch the endpoint to a thread to attend to it. * Dispatch the endpoint if it is not already dispatched
*
*/
public void dispatch();
/* ------------------------------------------------------------ */
/**
* Dispatch the endpoint. If it is already dispatched, schedule a redispatch
* *
*/ */
public void asyncDispatch(); public void asyncDispatch();

View File

@ -280,24 +280,17 @@ public class ChannelEndPoint implements EndPoint
if (buf instanceof NIOBuffer) if (buf instanceof NIOBuffer)
{ {
final NIOBuffer nbuf = (NIOBuffer)buf; final NIOBuffer nbuf = (NIOBuffer)buf;
final ByteBuffer bbuf=nbuf.getByteBuffer(); final ByteBuffer bbuf=nbuf.getByteBuffer().asReadOnlyBuffer();
try
//noinspection SynchronizationOnLocalVariableOrMethodParameter
synchronized(bbuf)
{ {
try bbuf.position(buffer.getIndex());
{ bbuf.limit(buffer.putIndex());
bbuf.position(buffer.getIndex()); len=_channel.write(bbuf);
bbuf.limit(buffer.putIndex()); }
len=_channel.write(bbuf); finally
} {
finally if (len>0)
{ buffer.skip(len);
if (len>0)
buffer.skip(len);
bbuf.position(0);
bbuf.limit(bbuf.capacity());
}
} }
} }
else if (buf instanceof RandomAccessFileBuffer) else if (buf instanceof RandomAccessFileBuffer)
@ -363,46 +356,29 @@ public class ChannelEndPoint implements EndPoint
synchronized(this) synchronized(this)
{ {
// We must sync because buffers may be shared (eg nbuf1 is likely to be cached content). // Adjust position indexs of buf0 and buf1
//noinspection SynchronizationOnLocalVariableOrMethodParameter bbuf0=bbuf0.asReadOnlyBuffer();
synchronized(bbuf0) bbuf0.position(header.getIndex());
bbuf0.limit(header.putIndex());
bbuf1=bbuf1.asReadOnlyBuffer();
bbuf1.position(buffer.getIndex());
bbuf1.limit(buffer.putIndex());
_gather2[0]=bbuf0;
_gather2[1]=bbuf1;
// do the gathering write.
length=(int)((GatheringByteChannel)_channel).write(_gather2);
int hl=header.length();
if (length>hl)
{ {
//noinspection SynchronizationOnLocalVariableOrMethodParameter header.clear();
synchronized(bbuf1) buffer.skip(length-hl);
{ }
try else if (length>0)
{ {
// Adjust position indexs of buf0 and buf1 header.skip(length);
bbuf0.position(header.getIndex());
bbuf0.limit(header.putIndex());
bbuf1.position(buffer.getIndex());
bbuf1.limit(buffer.putIndex());
_gather2[0]=bbuf0;
_gather2[1]=bbuf1;
// do the gathering write.
length=(int)((GatheringByteChannel)_channel).write(_gather2);
int hl=header.length();
if (length>hl)
{
header.clear();
buffer.skip(length-hl);
}
else if (length>0)
{
header.skip(length);
}
}
finally
{
bbuf0.position(0);
bbuf1.position(0);
bbuf0.limit(bbuf0.capacity());
bbuf1.limit(bbuf1.capacity());
}
}
} }
} }
return length; return length;

View File

@ -208,11 +208,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements AsyncEndPo
{ {
synchronized(this) synchronized(this)
{ {
if (_dispatched) if (!_dispatched)
{
throw new IllegalStateException("dispatched");
}
else
{ {
_dispatched = true; _dispatched = true;
boolean dispatched = _manager.dispatch(_handler); boolean dispatched = _manager.dispatch(_handler);

View File

@ -412,7 +412,7 @@ public class SslConnection extends AbstractConnection implements AsyncConnection
// If we are reading into the temp buffer and it has some content, then we should be dispatched. // If we are reading into the temp buffer and it has some content, then we should be dispatched.
if (toFill==_unwrapBuf && _unwrapBuf.hasContent() && !_connection.isSuspended()) if (toFill==_unwrapBuf && _unwrapBuf.hasContent() && !_connection.isSuspended())
_aEndp.asyncDispatch(); _aEndp.dispatch();
} }
finally finally
{ {
@ -721,6 +721,11 @@ public class SslConnection extends AbstractConnection implements AsyncConnection
process(null, null); process(null, null);
} }
public void dispatch()
{
_aEndp.dispatch();
}
public void asyncDispatch() public void asyncDispatch()
{ {
_aEndp.asyncDispatch(); _aEndp.asyncDispatch();

View File

@ -245,21 +245,37 @@ public class MongoSessionManager extends NoSqlSessionManager
{ {
for (String name : attrs.keySet()) for (String name : attrs.keySet())
{ {
if ( __METADATA.equals(name) ) if (__METADATA.equals(name))
{ {
continue; continue;
} }
String attr = decodeName(name); String attr = decodeName(name);
Object value = decodeValue(attrs.get(name)); Object value = decodeValue(attrs.get(name));
session.doPutOrRemove(attr,value);
session.bindValue(attr,value); if (attrs.keySet().contains(name))
{
session.doPutOrRemove(attr,value);
session.bindValue(attr,value);
}
else
{
session.doPutOrRemove(attr,value);
}
}
// cleanup, remove values from session, that don't exist in data anymore:
for (String name : session.getNames())
{
if (!attrs.keySet().contains(name))
{
session.doPutOrRemove(name,null);
session.unbindValue(name,session.getAttribute(name));
}
} }
} }
session.didActivate(); session.didActivate();
return version; return version;
} }
catch (Exception e) catch (Exception e)

View File

@ -12,7 +12,7 @@ The easiest place to put these lines are in the start.ini file.
For debugging the spengo authentication the following options are helpful: For debugging the spengo authentication the following options are helpful:
-Dorg.eclipse.jetty.LEVEL=debug -Dorg.eclipse.jetty.LEVEL=debug
-Dsun.security.spnego.debug=all -Dsun.security.spnego.debug=true
Spengo Authentication is enabled in the webapp with the following setup. Spengo Authentication is enabled in the webapp with the following setup.
@ -59,7 +59,4 @@ embedded, via the jetty.xml or in a context file for the webapp.
</New> </New>
</Set> </Set>
<Set name="checkWelcomeFiles">true</Set> <Set name="checkWelcomeFiles">true</Set>
</Get> </Get>
8

View File

@ -254,7 +254,7 @@ public class DigestAuthenticator extends LoginAuthenticator
Nonce nonce=_nonceQueue.peek(); Nonce nonce=_nonceQueue.peek();
while (nonce!=null && nonce._ts<expired) while (nonce!=null && nonce._ts<expired)
{ {
_nonceQueue.remove(); _nonceQueue.remove(nonce);
_nonceCount.remove(nonce._nonce); _nonceCount.remove(nonce._nonce);
nonce=_nonceQueue.peek(); nonce=_nonceQueue.peek();
} }

View File

@ -32,18 +32,15 @@ import javax.servlet.http.HttpServletResponse;
import junit.framework.Assert; import junit.framework.Assert;
import org.eclipse.jetty.http.HttpParser;
import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.StdErrLog; import org.eclipse.jetty.util.log.StdErrLog;
import org.hamcrest.CoreMatchers;
import org.hamcrest.Matchers; import org.hamcrest.Matchers;
import org.junit.Test; import org.junit.Test;
import org.junit.matchers.JUnitMatchers; import org.junit.matchers.JUnitMatchers;
import org.mockito.internal.matchers.Contains;
import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;

View File

@ -35,7 +35,6 @@ public class SelectChannelServerTest extends HttpServerTestBase
@Override @Override
public void testSuspendedPipeline() throws Exception public void testSuspendedPipeline() throws Exception
{ {
// TODO Auto-generated method stub
super.testSuspendedPipeline(); super.testSuspendedPipeline();
} }

View File

@ -15,20 +15,29 @@ package org.eclipse.jetty.server.ssl;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.Socket; import java.net.Socket;
import java.security.KeyStore; import java.security.KeyStore;
import java.util.Arrays; import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger;
import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.TrustManagerFactory;
import org.eclipse.jetty.io.AsyncEndPoint;
import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.nio.SslConnection;
import org.eclipse.jetty.server.HttpServerTestBase; import org.eclipse.jetty.server.HttpServerTestBase;
import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.assertThat;
import static org.hamcrest.Matchers.lessThan;
/** /**
* HttpServer Tester. * HttpServer Tester.
@ -46,11 +55,28 @@ public class SelectChannelServerSslTest extends HttpServerTestBase
return __sslContext.getSocketFactory().createSocket(host,port); return __sslContext.getSocketFactory().createSocket(host,port);
} }
private static final AtomicInteger _handlecount = new AtomicInteger();
@BeforeClass @BeforeClass
public static void init() throws Exception public static void init() throws Exception
{ {
SslSelectChannelConnector connector = new SslSelectChannelConnector(); SslSelectChannelConnector connector = new SslSelectChannelConnector()
{
@Override
protected SslConnection newSslConnection(AsyncEndPoint endPoint, SSLEngine engine)
{
return new SslConnection(engine, endPoint)
{
@Override
public Connection handle() throws IOException
{
_handlecount.incrementAndGet();
return super.handle();
}
};
}
};
String keystorePath = System.getProperty("basedir",".") + "/src/test/resources/keystore"; String keystorePath = System.getProperty("basedir",".") + "/src/test/resources/keystore";
SslContextFactory cf = connector.getSslContextFactory(); SslContextFactory cf = connector.getSslContextFactory();
cf.setKeyStorePath(keystorePath); cf.setKeyStorePath(keystorePath);
@ -69,7 +95,6 @@ public class SelectChannelServerSslTest extends HttpServerTestBase
__sslContext = SSLContext.getInstance("TLS"); __sslContext = SSLContext.getInstance("TLS");
__sslContext.init(null, trustManagerFactory.getTrustManagers(), null); __sslContext.init(null, trustManagerFactory.getTrustManagers(), null);
try try
{ {
HttpsURLConnection.setDefaultHostnameVerifier(__hostnameverifier); HttpsURLConnection.setDefaultHostnameVerifier(__hostnameverifier);
@ -105,7 +130,6 @@ public class SelectChannelServerSslTest extends HttpServerTestBase
{ {
OutputStream os=client.getOutputStream(); OutputStream os=client.getOutputStream();
int last=0; int last=0;
// Write out the fragments // Write out the fragments
@ -137,17 +161,17 @@ public class SelectChannelServerSslTest extends HttpServerTestBase
} }
} }
@Override @Override
@Ignore @Ignore
public void testAvailable() throws Exception public void testAvailable() throws Exception
{ {
} }
@Override @Override
public void testSuspendedPipeline() throws Exception public void testSuspendedPipeline() throws Exception
{ {
_handlecount.set(0);
super.testSuspendedPipeline(); super.testSuspendedPipeline();
assertThat(_handlecount.get(),lessThan(50));
} }
} }

View File

@ -12,6 +12,14 @@
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Jetty :: SPDY :: Parent</name> <name>Jetty :: SPDY :: Parent</name>
<properties>
<!--
npn version only needs to change when there are changes in that binary, not
with each and every release.
-->
<npn.version>7.6.2.v20120308</npn.version>
</properties>
<modules> <modules>
<module>spdy-core</module> <module>spdy-core</module>
<module>spdy-jetty</module> <module>spdy-jetty</module>

View File

@ -9,10 +9,27 @@
<artifactId>spdy-jetty-http-webapp</artifactId> <artifactId>spdy-jetty-http-webapp</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>Jetty :: SPDY :: Jetty HTTP Web Application</name> <name>Jetty :: SPDY :: Jetty HTTP Web Application</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>config</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
<!-- <!--
<build>
<plugins>
<plugin> <plugin>
<groupId>org.mortbay.jetty</groupId> <groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId> <artifactId>jetty-maven-plugin</artifactId>
@ -40,7 +57,7 @@
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
</plugins>
</build>
--> -->
</plugins>
</build>
</project> </project>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd"> <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/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>org.eclipse.jetty.spdy</groupId> <groupId>org.eclipse.jetty.spdy</groupId>
<artifactId>spdy-parent</artifactId> <artifactId>spdy-parent</artifactId>
@ -10,11 +11,35 @@
<name>Jetty :: SPDY :: Jetty HTTP Layer</name> <name>Jetty :: SPDY :: Jetty HTTP Layer</name>
<build> <build>
<plugins> <plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.mortbay.jetty.npn</groupId>
<artifactId>npn-boot</artifactId>
<version>${npn.version}</version>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${build.directory}/npn</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<configuration> <configuration>
<skip>true</skip> <skip>true</skip>
<argLine>-Xbootclasspath/p:${settings.localRepository}/org/mortbay/jetty/npn/npn-boot/${project.version}/npn-boot-${project.version}.jar </argLine> <argLine>-Xbootclasspath/p:${build.directory}/npn/npn-boot-${npn.version}.jar </argLine>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
@ -27,7 +52,7 @@
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<configuration> <configuration>
<skip>true</skip> <skip>true</skip>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@ -10,11 +10,35 @@
<name>Jetty :: SPDY :: Jetty Binding</name> <name>Jetty :: SPDY :: Jetty Binding</name>
<build> <build>
<plugins> <plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.mortbay.jetty.npn</groupId>
<artifactId>npn-boot</artifactId>
<version>${npn.version}</version>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${build.directory}/npn</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<configuration> <configuration>
<skip>true</skip> <skip>true</skip>
<argLine>-Xbootclasspath/p:${settings.localRepository}/org/mortbay/jetty/npn/npn-boot/${project.version}/npn-boot-${project.version}.jar </argLine> <argLine>-Xbootclasspath/p:${build.directory}/npn/npn-boot-${npn.version}.jar </argLine>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@ -32,6 +32,11 @@ public class EmptyAsyncEndPoint implements AsyncEndPoint
private boolean closed; private boolean closed;
private int maxIdleTime; private int maxIdleTime;
@Override
public void dispatch()
{
}
@Override @Override
public void asyncDispatch() public void asyncDispatch()
{ {

View File

@ -350,10 +350,17 @@ public class AggregateLifeCycle extends AbstractLifeCycle implements Destroyable
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
public static void dumpObject(Appendable out,Object o) throws IOException public static void dumpObject(Appendable out,Object o) throws IOException
{ {
if (o instanceof LifeCycle) try
out.append(String.valueOf(o)).append(" - ").append((AbstractLifeCycle.getState((LifeCycle)o))).append("\n"); {
else if (o instanceof LifeCycle)
out.append(String.valueOf(o)).append("\n"); out.append(String.valueOf(o)).append(" - ").append((AbstractLifeCycle.getState((LifeCycle)o))).append("\n");
else
out.append(String.valueOf(o)).append("\n");
}
catch(Throwable th)
{
out.append(" => ").append(th.toString()).append('\n');
}
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */

View File

@ -465,12 +465,16 @@ public class QueuedThreadPool extends AbstractLifeCycle implements SizedThreadPo
{ {
final StackTraceElement[] trace=thread.getStackTrace(); final StackTraceElement[] trace=thread.getStackTrace();
boolean inIdleJobPoll=false; boolean inIdleJobPoll=false;
for (StackTraceElement t : trace) // trace can be null on early java 6 jvms
if (trace != null)
{ {
if ("idleJobPoll".equals(t.getMethodName())) for (StackTraceElement t : trace)
{ {
inIdleJobPoll=true; if ("idleJobPoll".equals(t.getMethodName()))
break; {
inIdleJobPoll = true;
break;
}
} }
} }
final boolean idle=inIdleJobPoll; final boolean idle=inIdleJobPoll;