JBoss Remoting SVN: r4664 - remoting3/trunk.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-11-13 00:12:29 -0500 (Thu, 13 Nov 2008)
New Revision: 4664
Modified:
remoting3/trunk/build.properties
Log:
New XNIO snapshot
Modified: remoting3/trunk/build.properties
===================================================================
--- remoting3/trunk/build.properties 2008-11-13 05:12:16 UTC (rev 4663)
+++ remoting3/trunk/build.properties 2008-11-13 05:12:29 UTC (rev 4664)
@@ -179,7 +179,7 @@
lib.trove.local=${local.repository}/${lib.trove.path}
lib.trove.remote=${remote.repository}/${lib.trove.path}
-lib.xnio.version=1.2.0.Alpha2008101601
+lib.xnio.version=1.2.0.Alpha2008111101
lib.xnio-api.name=xnio-api-${lib.xnio.version}.jar
lib.xnio-api.license=lgpl
16 years, 1 month
JBoss Remoting SVN: r4663 - remoting3/trunk/api/src/main/java/org/jboss/remoting/spi.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-11-13 00:12:16 -0500 (Thu, 13 Nov 2008)
New Revision: 4663
Modified:
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/SpiUtils.java
Log:
Change the logger to be specific to handler errors
Modified: remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/SpiUtils.java
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/SpiUtils.java 2008-11-13 04:53:59 UTC (rev 4662)
+++ remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/SpiUtils.java 2008-11-13 05:12:16 UTC (rev 4663)
@@ -32,9 +32,10 @@
* Utility methods for Remoting service providers.
*/
public final class SpiUtils {
+
private SpiUtils() {}
- private static final Logger log = Logger.getLogger(SpiUtils.class);
+ private static final Logger heLog = Logger.getLogger("org.jboss.remoting.handler-errors");
/**
* Safely notify a reply handler of an exception.
@@ -46,7 +47,7 @@
try {
replyHandler.handleException(exception);
} catch (Throwable t) {
- log.debug(t, "Failed to properly handle exception");
+ heLog.debug(t, "Failed to properly handle exception");
}
}
@@ -61,7 +62,7 @@
try {
replyHandler.handleReply(reply);
} catch (Throwable t) {
- log.debug(t, "Failed to properly handle reply");
+ heLog.debug(t, "Failed to properly handle reply");
}
}
@@ -74,7 +75,7 @@
try {
replyHandler.handleCancellation();
} catch (Throwable t) {
- log.debug(t, "Failed to properly handle cancellation");
+ heLog.debug(t, "Failed to properly handle cancellation");
}
}
@@ -88,7 +89,7 @@
try {
handler.notifyCancel(requestContext);
} catch (Throwable t) {
- log.error(t, "Request cancel handler threw an exception");
+ heLog.error(t, "Request cancel handler threw an exception");
}
}
@@ -103,7 +104,7 @@
try {
handler.handleClose(closed);
} catch (Throwable t) {
- log.error(t, "Close handler threw an exception");
+ heLog.error(t, "Close handler threw an exception");
}
}
16 years, 1 month
JBoss Remoting SVN: r4662 - remoting2/branches/2.2/src/main/org/jboss/remoting/loading.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-11-12 23:53:59 -0500 (Wed, 12 Nov 2008)
New Revision: 4662
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/loading/RemotingClassLoader.java
Log:
JBREM-1042: Renamed "remotingClassLoader" to "primaryClassLoader" and renamed "userClassLoader" to "secondaryClassLoader".
Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/loading/RemotingClassLoader.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/loading/RemotingClassLoader.java 2008-11-13 04:52:33 UTC (rev 4661)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/loading/RemotingClassLoader.java 2008-11-13 04:53:59 UTC (rev 4662)
@@ -30,15 +30,15 @@
*/
public class RemotingClassLoader extends ClassLoader
{
- private ClassLoader userClassLoader = null;
+ private ClassLoader secondaryClassLoader = null;
protected static final Logger log = Logger.getLogger(RemotingClassLoader.class);
protected static final boolean isTrace = log.isTraceEnabled();
- public RemotingClassLoader(ClassLoader remotingClassLoader, ClassLoader userClassLoader)
+ public RemotingClassLoader(ClassLoader primaryClassLoader, ClassLoader secondaryClassLoader)
{
- super(remotingClassLoader);
- this.userClassLoader = userClassLoader;
+ super(primaryClassLoader);
+ this.secondaryClassLoader = secondaryClassLoader;
}
public Class loadClass(String name) throws ClassNotFoundException
@@ -48,6 +48,7 @@
try
{
loadedClass = Class.forName(name, false, getParent());
+ if (isTrace) log.trace("loaded from primary classloader: " + name);
}
catch(ClassNotFoundException e)
{
@@ -55,11 +56,12 @@
{
log.trace("Could not load class (" + name + ") using parent remoting class loader (" + getParent() + ")");
}
- if(userClassLoader != null)
+ if(secondaryClassLoader != null)
{
try
{
- loadedClass = Class.forName(name, false, userClassLoader);
+ loadedClass = Class.forName(name, false, secondaryClassLoader);
+ if (isTrace) log.trace("loaded from secondary classloader: " + name);
}
catch (ClassNotFoundException e1)
{
16 years, 1 month
JBoss Remoting SVN: r4661 - remoting2/branches/2.2/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-11-12 23:52:33 -0500 (Wed, 12 Nov 2008)
New Revision: 4661
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/Remoting.java
Log:
JBREM-1042: Added CLASSLOADING_PARENT_FIRST_DELEGATION and CLASSLOADING_PARENT_FIRST_DELEGATION_PROP.
Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/Remoting.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/Remoting.java 2008-11-13 04:51:40 UTC (rev 4660)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/Remoting.java 2008-11-13 04:52:33 UTC (rev 4661)
@@ -63,4 +63,11 @@
* a socket creation listener for sockets created by a ServerSocket.
*/
public static final String SOCKET_CREATION_SERVER_LISTENER = "socketCreationServerListener";
+
+ /**
+ * A flag indicating whether the RemotingClassLoader uses parent first (=true)
+ * or user class loader first delegation.
+ */
+ public static final String CLASSLOADING_PARENT_FIRST_DELEGATION = "classloadingParentFirstDelegation";
+ public static final String CLASSLOADING_PARENT_FIRST_DELEGATION_PROP = "org.jboss.remoting.classloadingParentFirstDelegation";
}
16 years, 1 month
JBoss Remoting SVN: r4660 - remoting2/branches/2.2/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-11-12 23:51:40 -0500 (Wed, 12 Nov 2008)
New Revision: 4660
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
Log:
JBREM-1042: Introduced parentFirstClassLoading variable and associated facility.
Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2008-11-13 04:19:42 UTC (rev 4659)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2008-11-13 04:51:40 UTC (rev 4660)
@@ -41,15 +41,18 @@
private final Object clientLeaseLock = new Object();
private LeasePinger leasePinger = null;
private String invokerSessionID = new GUID().toString();
+ private boolean parentFirstClassLoading = true;
public MicroRemoteClientInvoker(InvokerLocator locator)
{
super(locator);
+ init();
}
public MicroRemoteClientInvoker(InvokerLocator locator, Map configuration)
{
super(locator, configuration);
+ init();
}
/**
@@ -88,8 +91,15 @@
// creating a new classloader containing the remoting class loader (for remote classloading)
// and the current thread's class loader. This allows to load remoting classes as well as
// user's classes.
- ClassLoader remotingClassLoader =
- new RemotingClassLoader(getClassLoader(), Thread.currentThread().getContextClassLoader());
+ ClassLoader remotingClassLoader = null;
+ if (parentFirstClassLoading)
+ {
+ remotingClassLoader = new RemotingClassLoader(getClassLoader(), Thread.currentThread().getContextClassLoader());
+ }
+ else
+ {
+ remotingClassLoader = new RemotingClassLoader(Thread.currentThread().getContextClassLoader(), getClassLoader());
+ }
// try by locator (in case unmarshaller class name specified)
unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), getClassLoader());
@@ -471,6 +481,24 @@
}
return type;
}
+
+ protected void init()
+ {
+ // Get the parent delegation order flag, default is parent first
+ Object flag = configuration.get(Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION);
+ if(flag == null)
+ {
+ // Fallback to the system property
+ flag = System.getProperty(Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION_PROP);
+ }
+ boolean parentFirst = true;
+ if (flag != null)
+ {
+ String sflag = flag.toString();
+ parentFirst = Boolean.valueOf(sflag).booleanValue();
+ }
+ parentFirstClassLoading = parentFirst;
+ }
/**
* Each implementation of the remote client invoker should have
16 years, 1 month
JBoss Remoting SVN: r4659 - remoting2/branches/2.2/src/etc.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-11-12 23:19:42 -0500 (Wed, 12 Nov 2008)
New Revision: 4659
Added:
remoting2/branches/2.2/src/etc/ScopedTest.zip
Log:
JBREM-1041: Manual test that needs Application Server.
Added: remoting2/branches/2.2/src/etc/ScopedTest.zip
===================================================================
(Binary files differ)
Property changes on: remoting2/branches/2.2/src/etc/ScopedTest.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 1 month
JBoss Remoting SVN: r4658 - remoting2/branches/2.2/src/main/org/jboss/remoting/marshal.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-11-12 23:16:21 -0500 (Wed, 12 Nov 2008)
New Revision: 4658
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/MarshallerLoaderHandler.java
Log:
JBREM-1041: Fixed two problems in loadClassBytes().
Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/MarshallerLoaderHandler.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/MarshallerLoaderHandler.java 2008-11-12 05:48:32 UTC (rev 4657)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/MarshallerLoaderHandler.java 2008-11-13 04:16:21 UTC (rev 4658)
@@ -185,7 +185,7 @@
{
Object o = server.getAttribute(name, "Instance");
LoaderRepository repository = (LoaderRepository) o;
- Class c = repository.getCachedClass(className);
+ Class c = repository.loadClass(className);
if (c == null)
{
continue;
@@ -193,6 +193,7 @@
log.debug("found class in repository " + name);
RepositoryClassLoader cl = (RepositoryClassLoader) c.getClassLoader();
classDefinition = loadByteCode(cl, className);
+ break;
}
catch (Exception e)
{
16 years, 1 month
JBoss Remoting SVN: r4657 - remoting3/trunk/core/src/test/java/org/jboss/remoting/core.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-11-12 00:48:32 -0500 (Wed, 12 Nov 2008)
New Revision: 4657
Modified:
remoting3/trunk/core/src/test/java/org/jboss/remoting/core/EndpointTestCase.java
Log:
Add more involved unsent reply test
Modified: remoting3/trunk/core/src/test/java/org/jboss/remoting/core/EndpointTestCase.java
===================================================================
--- remoting3/trunk/core/src/test/java/org/jboss/remoting/core/EndpointTestCase.java 2008-11-12 05:29:27 UTC (rev 4656)
+++ remoting3/trunk/core/src/test/java/org/jboss/remoting/core/EndpointTestCase.java 2008-11-12 05:48:32 UTC (rev 4657)
@@ -217,4 +217,54 @@
executorService.shutdownNow();
}
}
+
+ public void testUnsentReply2() throws Throwable {
+ final EndpointImpl endpoint = new EndpointImpl();
+ final ExecutorService executorService = Executors.newCachedThreadPool();
+ final Object requestObj = new Object();
+ try {
+ endpoint.setExecutor(executorService);
+ endpoint.start();
+ try {
+ final Handle<RequestHandler> handle = endpoint.createRequestHandler(new AbstractRequestListener<Object, Object>() {
+ public void handleRequest(final RequestContext<Object> context, final Object request) throws RemoteExecutionException {
+ assertEquals(request, requestObj);
+ context.execute(new Runnable() {
+ public void run() {
+ context.execute(new Runnable() {
+ public void run() {
+ context.execute(new Runnable() {
+ public void run() {
+ }
+ });
+ }
+ });
+ context.execute(new Runnable() {
+ public void run() {
+ }
+ });
+ }
+ });
+ context.execute(new Runnable() {
+ public void run() {
+ }
+ });
+ }
+ }, Object.class, Object.class);
+ final RequestHandler requestHandler = handle.getResource();
+ try {
+ final Client<Object,Object> client = endpoint.createClient(requestHandler, Object.class, Object.class);
+ final IoFuture<Object> futureReply = client.send(requestObj);
+ assertEquals(IoFuture.Status.FAILED, futureReply.await(500L, TimeUnit.MILLISECONDS));
+ assertTrue(futureReply.getException() instanceof IndeterminateOutcomeException);
+ } finally {
+ IoUtils.safeClose(requestHandler);
+ }
+ } finally {
+ safeStop(endpoint);
+ }
+ } finally {
+ executorService.shutdownNow();
+ }
+ }
}
16 years, 1 month
JBoss Remoting SVN: r4656 - remoting3/trunk/core/src/test/java/org/jboss/remoting/core.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-11-12 00:29:27 -0500 (Wed, 12 Nov 2008)
New Revision: 4656
Modified:
remoting3/trunk/core/src/test/java/org/jboss/remoting/core/EndpointTestCase.java
Log:
Add unsent reply test
Modified: remoting3/trunk/core/src/test/java/org/jboss/remoting/core/EndpointTestCase.java
===================================================================
--- remoting3/trunk/core/src/test/java/org/jboss/remoting/core/EndpointTestCase.java 2008-11-12 05:21:58 UTC (rev 4655)
+++ remoting3/trunk/core/src/test/java/org/jboss/remoting/core/EndpointTestCase.java 2008-11-12 05:29:27 UTC (rev 4656)
@@ -33,10 +33,12 @@
import org.jboss.remoting.RemoteExecutionException;
import org.jboss.remoting.CloseHandler;
import org.jboss.remoting.Client;
+import org.jboss.remoting.IndeterminateOutcomeException;
import org.jboss.remoting.test.support.LoggingHelper;
import org.jboss.remoting.spi.RequestHandler;
import org.jboss.remoting.spi.Handle;
import org.jboss.xnio.IoUtils;
+import org.jboss.xnio.IoFuture;
import org.jboss.xnio.log.Logger;
/**
@@ -184,4 +186,35 @@
executorService.shutdownNow();
}
}
+
+ public void testUnsentReply() throws Throwable {
+ final EndpointImpl endpoint = new EndpointImpl();
+ final ExecutorService executorService = Executors.newCachedThreadPool();
+ final Object requestObj = new Object();
+ try {
+ endpoint.setExecutor(executorService);
+ endpoint.start();
+ try {
+ final Handle<RequestHandler> handle = endpoint.createRequestHandler(new AbstractRequestListener<Object, Object>() {
+ public void handleRequest(final RequestContext<Object> context, final Object request) throws RemoteExecutionException {
+ assertEquals(request, requestObj);
+ // don't send a reply!!
+ }
+ }, Object.class, Object.class);
+ final RequestHandler requestHandler = handle.getResource();
+ try {
+ final Client<Object,Object> client = endpoint.createClient(requestHandler, Object.class, Object.class);
+ final IoFuture<Object> futureReply = client.send(requestObj);
+ assertEquals(IoFuture.Status.FAILED, futureReply.await(500L, TimeUnit.MILLISECONDS));
+ assertTrue(futureReply.getException() instanceof IndeterminateOutcomeException);
+ } finally {
+ IoUtils.safeClose(requestHandler);
+ }
+ } finally {
+ safeStop(endpoint);
+ }
+ } finally {
+ executorService.shutdownNow();
+ }
+ }
}
16 years, 1 month
JBoss Remoting SVN: r4655 - remoting3/trunk/core/src/main/java/org/jboss/remoting/core.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-11-12 00:21:58 -0500 (Wed, 12 Nov 2008)
New Revision: 4655
Modified:
remoting3/trunk/core/src/main/java/org/jboss/remoting/core/RequestContextImpl.java
Log:
A response is known to be unsent if "closed" was *false*, not *true*...
Modified: remoting3/trunk/core/src/main/java/org/jboss/remoting/core/RequestContextImpl.java
===================================================================
--- remoting3/trunk/core/src/main/java/org/jboss/remoting/core/RequestContextImpl.java 2008-11-08 20:19:22 UTC (rev 4654)
+++ remoting3/trunk/core/src/main/java/org/jboss/remoting/core/RequestContextImpl.java 2008-11-12 05:21:58 UTC (rev 4655)
@@ -156,7 +156,7 @@
}
void finishTask() {
- if (taskCount.decrementAndGet() == 0 && closed.getAndSet(true)) {
+ if (taskCount.decrementAndGet() == 0 && ! closed.getAndSet(true)) {
// no response sent! send back IndeterminateOutcomeException
SpiUtils.safeHandleException(replyHandler, new IndeterminateOutcomeException("No reply was sent by the request listener"));
}
16 years, 1 month