JBoss Remoting SVN: r4218 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/performance/asynchronous.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:45:41 -0400 (Wed, 21 May 2008)
New Revision: 4218
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/performance/asynchronous/PerformanceClientSideClientTest.java
Log:
JBREM-982: Added main().
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/performance/asynchronous/PerformanceClientSideClientTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/performance/asynchronous/PerformanceClientSideClientTest.java 2008-05-22 03:43:51 UTC (rev 4217)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/performance/asynchronous/PerformanceClientSideClientTest.java 2008-05-22 03:45:41 UTC (rev 4218)
@@ -52,5 +52,30 @@
{
//NO OP since no return
}
+
+ public static void main(String[] args)
+ {
+ PerformanceClientSideClientTest test = new PerformanceClientSideClientTest();
+ try
+ {
+ test.setUp();
+ test.testClientCalls();
+ }
+ catch(Throwable throwable)
+ {
+ throwable.printStackTrace();
+ }
+ finally
+ {
+ try
+ {
+ test.tearDown();
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
}
\ No newline at end of file
16 years, 6 months
JBoss Remoting SVN: r4217 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:43:51 -0400 (Wed, 21 May 2008)
New Revision: 4217
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/CallbackTestCase.java
Log:
JBREM-930: Reduced log level to INFO.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/CallbackTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/CallbackTestCase.java 2008-05-22 03:41:37 UTC (rev 4216)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/CallbackTestCase.java 2008-05-22 03:43:51 UTC (rev 4217)
@@ -44,8 +44,13 @@
protected Level getTestLogLevel()
{
- return Level.DEBUG;
+ return Level.INFO;
}
+
+ protected Level getTestHarnessLogLevel()
+ {
+ return Level.INFO;
+ }
/**
* How long to wait for test results to be returned from the client(s). If goes longer than the
16 years, 6 months
JBoss Remoting SVN: r4216 - remoting2/branches/2.x/src/main/org/jboss/remoting/util.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:41:37 -0400 (Wed, 21 May 2008)
New Revision: 4216
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/util/SecurityUtility.java
Log:
JBREM-978: Added two classloader retrieval methods.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/util/SecurityUtility.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/util/SecurityUtility.java 2008-05-22 03:40:07 UTC (rev 4215)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/util/SecurityUtility.java 2008-05-22 03:41:37 UTC (rev 4216)
@@ -64,10 +64,9 @@
import javax.servlet.http.HttpServletResponse;
import org.jboss.remoting.Remoting;
+import org.jboss.remoting.loading.RemotingClassLoader;
import org.jboss.remoting.security.ServerSocketFactoryMBean;
-import org.jboss.remoting.transport.rmi.RMIServerInvoker;
import org.jboss.remoting.transport.rmi.RMIServerInvokerInf;
-import org.jboss.remoting.transport.rmi.RemotingRMIClientSocketFactory;
import org.jboss.remoting.transport.servlet.ServletServerInvokerMBean;
import org.jboss.serial.io.JBossObjectInputStream;
import org.jboss.serial.io.JBossObjectOutputStream;
@@ -129,7 +128,6 @@
return skipAccessControl;
}
-
///////////////////////////////////////////////////////////////////////////////////////
// FilePermission methods
///////////////////////////////////////////////////////////////////////////////////////
@@ -423,7 +421,7 @@
catch (PrivilegedActionException e)
{
throw (Exception) e.getCause();
- }
+ }
}
@@ -436,7 +434,7 @@
try
{
c = Class.forName("java.lang.management.ManagementFactory");
- }
+ }
catch (Exception e)
{
System.out.println("Unable to access java.lang.management.ManagementFactory: must be using jdk 1.4");
@@ -458,7 +456,7 @@
try
{
c = Class.forName("java.lang.management.ManagementFactory");
- }
+ }
catch (Exception e)
{
System.out.println("Unable to access java.lang.management.ManagementFactory: must be using jdk 1.4");
@@ -479,7 +477,7 @@
throw (IllegalAccessException) cause;
else
throw (InvocationTargetException) cause;
- }
+ }
}
@@ -677,6 +675,23 @@
// RuntimePermission methods
///////////////////////////////////////////////////////////////////////////////////////
+ static public RemotingClassLoader createRemotingClassLoader(final ClassLoader remotingClassLoader, final ClassLoader userClassLoader)
+ {
+ if (skipAccessControl)
+ {
+ return new RemotingClassLoader(remotingClassLoader, userClassLoader);
+ }
+
+ return (RemotingClassLoader)AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ return new RemotingClassLoader(remotingClassLoader, userClassLoader);
+ }
+ });
+ }
+
+
static public Object forName(final String className) throws ClassNotFoundException
{
if (skipAccessControl)
@@ -718,6 +733,23 @@
}
+ static public ClassLoader getContextClassLoader(final Thread thread)
+ {
+ if (skipAccessControl)
+ {
+ return thread.getContextClassLoader();
+ }
+
+ return (ClassLoader) AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ return thread.getContextClassLoader();
+ }
+ });
+ }
+
+
static public ClassLoader getSystemClassLoader()
{
if (skipAccessControl)
@@ -848,7 +880,6 @@
}
}
-
///////////////////////////////////////////////////////////////////////////////////////
// SocketPermission methods
///////////////////////////////////////////////////////////////////////////////////////
16 years, 6 months
JBoss Remoting SVN: r4215 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/web.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:40:07 -0400 (Wed, 21 May 2008)
New Revision: 4215
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/web/WebServerInvoker.java
Log:
JBREM-978: Moved classloader retrieval to SecurityUtility.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/web/WebServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/web/WebServerInvoker.java 2008-05-22 03:39:24 UTC (rev 4214)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/web/WebServerInvoker.java 2008-05-22 03:40:07 UTC (rev 4215)
@@ -33,6 +33,7 @@
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.ServerInvoker;
import org.jboss.remoting.transport.http.HTTPMetadataConstants;
+import org.jboss.remoting.util.SecurityUtility;
import org.jboss.remoting.marshal.MarshalFactory;
import org.jboss.remoting.marshal.Marshaller;
import org.jboss.remoting.marshal.UnMarshaller;
@@ -99,14 +100,7 @@
public UnMarshaller getUnMarshaller()
{
- ClassLoader classLoader = (ClassLoader) AccessController.doPrivileged( new PrivilegedAction()
- {
- public Object run()
- {
- return WebServerInvoker.class.getClassLoader();
- }
- });
-
+ ClassLoader classLoader = SecurityUtility.getClassLoader(WebServerInvoker.class);
UnMarshaller unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), classLoader);
if(unmarshaller == null)
{
@@ -117,16 +111,8 @@
public Marshaller getMarshaller()
{
- ClassLoader classLoader = (ClassLoader) AccessController.doPrivileged( new PrivilegedAction()
- {
- public Object run()
- {
- return WebServerInvoker.class.getClassLoader();
- }
- });
-
+ ClassLoader classLoader = SecurityUtility.getClassLoader(WebServerInvoker.class);
Marshaller marshaller = MarshalFactory.getMarshaller(getLocator(), classLoader);
-
if(marshaller == null)
{
marshaller = MarshalFactory.getMarshaller(getDataType(), getSerializationType());
16 years, 6 months
JBoss Remoting SVN: r4214 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:39:24 -0400 (Wed, 21 May 2008)
New Revision: 4214
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java
Log:
JBREM-978: Removed some unused imports.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java 2008-05-22 03:38:26 UTC (rev 4213)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java 2008-05-22 03:39:24 UTC (rev 4214)
@@ -34,17 +34,12 @@
import javax.net.ServerSocketFactory;
import javax.net.ssl.SSLException;
-import java.beans.IntrospectionException;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;
-import java.net.UnknownHostException;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
16 years, 6 months
JBoss Remoting SVN: r4213 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:38:26 -0400 (Wed, 21 May 2008)
New Revision: 4213
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java
Log:
JBREM-982: (1) Introduced variable useOnewayConnectionTimeout; (2) gets classloader, InputStream, and OutputStream during initialization..
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java 2008-05-22 03:35:00 UTC (rev 4212)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java 2008-05-22 03:38:26 UTC (rev 4213)
@@ -52,8 +52,6 @@
import java.net.SocketAddress;
import java.net.SocketException;
import java.net.SocketTimeoutException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
@@ -100,6 +98,8 @@
{
return idGenerator++;
}
+
+ private static ClassLoader classLoader = SecurityUtility.getClassLoader(ServerThread.class);
// Attributes -----------------------------------------------------------------------------------
@@ -124,6 +124,9 @@
protected Marshaller marshaller;
protected UnMarshaller unmarshaller;
+
+ protected int version;
+ protected boolean performVersioning;
// the unique identity of the thread, which won't change during the life of the thread. The
// thread may get associated with different IP addresses though.
@@ -146,6 +149,8 @@
private boolean reuseAfterTimeout;
+ private boolean useOnewayConnectionTimeout = false;
+
// Constructors ---------------------------------------------------------------------------------
public ServerThread(Socket socket, SocketServerInvoker invoker, LRUPool clientpool,
@@ -166,6 +171,9 @@
if (invoker != null)
{
+ version = invoker.getVersion();
+ performVersioning = Version.performVersioning(version);
+
Map configMap = invoker.getConfiguration();
String checkValue = (String)configMap.get(SocketServerInvoker.CHECK_CONNECTION_KEY);
if (checkValue != null && checkValue.length() > 0)
@@ -191,6 +199,21 @@
" value of " + o + " to a int value");
}
}
+
+ o = configMap.get(MicroSocketClientInvoker.USE_ONEWAY_CONNECTION_TIMEOUT);
+ if (o != null)
+ {
+ try
+ {
+ useOnewayConnectionTimeout = Boolean.valueOf((String)o).booleanValue();
+ log.debug(this + " setting useOnewayConnectionTimeout to " + useOnewayConnectionTimeout);
+ }
+ catch (Exception e)
+ {
+ log.warn(this + " could not convert " + MicroSocketClientInvoker.USE_ONEWAY_CONNECTION_TIMEOUT +
+ " value of " + o + " to a boolean value");
+ }
+ }
}
}
@@ -454,6 +477,8 @@
protected void dorun()
{
running = true;
+ InputStream inputStream = null;
+ OutputStream outputStream = null;
// lazy initialize the socketWrapper on the worker thread itself. We do this to avoid to have
// it done on the acceptor thread (prone to lockup)
@@ -463,7 +488,9 @@
socketWrapper =
createServerSocketWrapper(socket, timeout, invoker.getLocator().getParameters());
-
+ inputStream = socketWrapper.getInputStream();
+ outputStream = socketWrapper.getOutputStream();
+
boolean valueSet = false;
Map configMap = invoker.getConfiguration();
Object o = configMap.get(CONTINUE_AFTER_TIMEOUT);
@@ -492,7 +519,7 @@
// Always do first one without an ACK because its not needed
if(trace) { log.trace("processing first invocation without acknowledging"); }
- processInvocation(socketWrapper);
+ processInvocation(socketWrapper, inputStream, outputStream);
}
catch (Exception ex)
{
@@ -519,7 +546,7 @@
}
acknowledge(socketWrapper);
- processInvocation(socketWrapper);
+ processInvocation(socketWrapper, inputStream, outputStream);
}
catch (EvictionException e)
{
@@ -633,15 +660,11 @@
}
}
- protected void processInvocation(SocketWrapper socketWrapper) throws Exception
+ protected void processInvocation(SocketWrapper socketWrapper, InputStream inputStream, OutputStream outputStream) throws Exception
{
if(trace) { log.trace("preparing to process next invocation invocation"); }
// Ok, now read invocation and invoke
-
- int version = invoker.getVersion();
- boolean performVersioning = Version.performVersioning(version);
- InputStream inputStream = socketWrapper.getInputStream();
if (performVersioning)
{
@@ -669,24 +692,16 @@
}
}
- completeInvocation(socketWrapper, inputStream, performVersioning, version);
+ completeInvocation(socketWrapper, inputStream, outputStream, performVersioning, version);
}
protected synchronized void completeInvocation(
SocketWrapper socketWrapper,
InputStream inputStream,
- boolean performVersioning,
- int version)
+ OutputStream outputStream,
+ boolean performVersioning, int version)
throws Exception
{
- ClassLoader classLoader = (ClassLoader) AccessController.doPrivileged( new PrivilegedAction()
- {
- public Object run()
- {
- return ServerThread.class.getClassLoader();
- }
- });
-
Object obj = versionedRead(inputStream, invoker, classLoader, version);
// setting timestamp since about to start processing
@@ -741,6 +756,14 @@
{
if(trace) { log.trace("oneway request, writing no reply on the wire"); }
}
+ else if (isOneway(req))
+ {
+ if (useOnewayConnectionTimeout && performVersioning)
+ {
+ writeVersion(outputStream, version);
+ outputStream.flush();
+ }
+ }
else
{
if(!createdInvocationRequest)
@@ -750,15 +773,11 @@
resp = new InvocationResponse(req.getSessionId(), resp, isError, req.getReturnPayload());
}
- OutputStream outputStream = socketWrapper.getOutputStream();
if (performVersioning)
{
writeVersion(outputStream, version);
}
-
- if (isOneway(req))
- resp = null;
-
+
versionedWrite(outputStream, invoker, classLoader, resp, version);
}
@@ -939,8 +958,6 @@
private void processNewSocket()
{
InvokerLocator locator = invoker.getLocator();
-
- ClassLoader classLoader = SecurityUtility.getClassLoader(ServerThread.class);
String dataType = invoker.getDataType();
String serializationType = invoker.getSerializationType();
@@ -995,8 +1012,12 @@
private int readVersion(InputStream inputStream) throws Exception
{
- if(trace) { log.trace(this + " blocking to read version from input stream"); }
- long start = System.currentTimeMillis();
+ long start = -1;
+ if(trace)
+ {
+ log.trace(this + " blocking to read version from input stream");
+ start = System.currentTimeMillis();
+ }
synchronized (evictionLock)
{
16 years, 6 months
JBoss Remoting SVN: r4212 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:35:00 -0400 (Wed, 21 May 2008)
New Revision: 4212
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java
Log:
JBREM-982: (1) Introduced variable useOnewayConnectionTimeout; (2) removed some calls to System.currentTimeMillis().
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java 2008-05-22 03:30:08 UTC (rev 4211)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java 2008-05-22 03:35:00 UTC (rev 4212)
@@ -77,6 +77,11 @@
/** Key for setting timeout used by OnewayConnectionTask */
public static final String ONEWAY_CONNECTION_TIMEOUT = "onewayConnectionTimeout";
+
+ /** Key to determine if client side oneway invocations should wait to read version.
+ * See JBREM-706.
+ */
+ public static final String USE_ONEWAY_CONNECTION_TIMEOUT = "useOnewayConnectionTimeout";
/**
* Default value for enable TCP nodelay. Value is false.
@@ -102,7 +107,7 @@
public static final int MAX_POOL_SIZE = 50;
/** Default timeout value used by OnewayConnectionTask. Value is 2 seconds. */
- public static final int ONEWAY_CONNECTION_TIMEOUT_DEFAULT = 2000;
+ public static final int ONEWAY_CONNECTION_TIMEOUT_DEFAULT = 5000;
// Static ---------------------------------------------------------------------------------------
@@ -188,7 +193,7 @@
// flag being set on true by a disconnect request. If trying to create a connection goes on in a
// loop and a disconnect request arrives, this flag will be used to sent this information into
// the connect loop
- private volatile boolean bailOut;
+ // private volatile boolean bailOut;
/**
* Indicates if will check the socket connection when getting from pool by sending byte over the
@@ -207,6 +212,7 @@
protected int numberOfCallRetries;
protected int maxPoolSize;
protected int onewayConnectionTimeout;
+ protected boolean useOnewayConnectionTimeout = false;
/**
* Pool for this invoker. This is shared between all instances of proxies attached to a specific
@@ -378,7 +384,7 @@
public synchronized void disconnect()
{
log.debug(this + " disconnecting ...");
- bailOut = true;
+// bailOut = true;
super.disconnect();
}
@@ -583,6 +589,22 @@
val + " to an int value");
}
}
+
+ // look for useOnewayConnectionTimeout param
+ val = params.get(USE_ONEWAY_CONNECTION_TIMEOUT);
+ if (val != null)
+ {
+ try
+ {
+ useOnewayConnectionTimeout = Boolean.valueOf((String)val).booleanValue();
+ log.debug(this + " setting useOnewayConnectionTimeout to " + useOnewayConnectionTimeout);
+ }
+ catch (Exception e)
+ {
+ log.warn(this + " could not convert " + USE_ONEWAY_CONNECTION_TIMEOUT + " value of " +
+ val + " to a boolean value");
+ }
+ }
}
protected ServerAddress createServerAddress(InetAddress addr, int port)
@@ -660,7 +682,6 @@
Marshaller marshaller, UnMarshaller unmarshaller)
throws IOException, ConnectionFailedException, ClassNotFoundException
{
- long start = System.currentTimeMillis();
SocketWrapper socketWrapper = null;
Object response = null;
boolean oneway = false;
@@ -669,6 +690,7 @@
int tempTimeout = -1;
int timeLeft = -1;
int savedTimeout = -1;
+ long start = -1;
if(metadata != null)
{
@@ -697,6 +719,11 @@
}
}
}
+
+ if (tempTimeout >= 0)
+ {
+ start = System.currentTimeMillis();
+ }
boolean serverSideOneway = false;
if (oneway && invocation instanceof InvocationRequest)
@@ -725,10 +752,7 @@
boolean tryPool = retryCount < (numberOfCallRetries - 1)
|| maxPoolSize == 1
|| numberOfCallRetries == 1;
- long l = System.currentTimeMillis();
socketWrapper = getConnection(marshaller, unmarshaller, tryPool, timeLeft);
- long d = System.currentTimeMillis() - l;
- if (trace) log.trace("took " + d + " ms to get socket " + socketWrapper);
}
catch (InterruptedException e)
{
@@ -757,9 +781,6 @@
socketWrapper.setTimeout(timeLeft);
}
- long end = System.currentTimeMillis() - start;
- getSocketTime += end;
-
try
{
int version = getVersion();
@@ -775,23 +796,35 @@
//TODO: -TME so this is messed up as now ties remoting versioning to using a marshaller type
versionedWrite(outputStream, marshaller, invocation, version);
- end = System.currentTimeMillis() - start;
- writeTime += end;
- start = System.currentTimeMillis();
-
if (serverSideOneway)
{
if(trace) { log.trace(this + " sent oneway invocation, so not waiting for response, returning null"); }
}
- else
+ else if (oneway)
{
- int onewaySavedTimeout = -1;
- if (oneway)
+ if (performVersioning && useOnewayConnectionTimeout)
{
- onewaySavedTimeout = socketWrapper.getTimeout();
+ int onewaySavedTimeout = socketWrapper.getTimeout();
socketWrapper.setTimeout(onewayConnectionTimeout);
+ InputStream inputStream = socketWrapper.getInputStream();
+ version = readVersion(inputStream);
+ if (version == -1)
+ {
+ throw new EOFException("end of file");
+ }
+ if (version == SocketWrapper.CLOSING)
+ {
+ log.trace(this + " received version 254: treating as end of file");
+ throw new EOFException("end of file");
+ }
+
+ // Note that if an exception is thrown, the socket is thrown away,
+ // so there's no need to reset the timeout value.
+ socketWrapper.setTimeout(onewaySavedTimeout);
}
-
+ }
+ else
+ {
InputStream inputStream = socketWrapper.getInputStream();
if (performVersioning)
{
@@ -808,18 +841,8 @@
}
response = versionedRead(inputStream, unmarshaller, version);
-
- // Note that if an exception is thrown, the socket is thrown away,
- // so there's no need to reset the timeout value.
- if (oneway)
- {
- socketWrapper.setTimeout(onewaySavedTimeout);
}
- }
- end = System.currentTimeMillis() - start;
- readTime += end;
-
// Note that resetting the timeout value after closing the socket results
// in an exception, so the reset is not done in a finally clause. However,
// if a catch clause is ever added that does not close the socket, care
16 years, 6 months
JBoss Remoting SVN: r4211 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:30:08 -0400 (Wed, 21 May 2008)
New Revision: 4211
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ClientSocketWrapper.java
Log:
JBREM-982: Checks if (trace) before calling log.trace().
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ClientSocketWrapper.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ClientSocketWrapper.java 2008-05-22 03:28:55 UTC (rev 4210)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ClientSocketWrapper.java 2008-05-22 03:30:08 UTC (rev 4211)
@@ -98,7 +98,7 @@
public void checkOpenConnection() throws IOException
{
- log.trace("checking open connection");
+ if (trace) log.trace("checking open connection");
if (in.available() > 1)
{
log.debug("remote endpoint has closed");
16 years, 6 months
JBoss Remoting SVN: r4210 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:28:55 -0400 (Wed, 21 May 2008)
New Revision: 4210
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java
Log:
JBREM-982: Calls conn.getHeaderFields() just once.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java 2008-05-22 03:27:52 UTC (rev 4209)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java 2008-05-22 03:28:55 UTC (rev 4210)
@@ -349,7 +349,7 @@
metadata.put(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE, conn.getResponseMessage());
metadata.put(HTTPMetadataConstants.RESPONSE_CODE, new Integer(responseCode));
- metadata.put(HTTPMetadataConstants.RESPONSE_HEADERS, conn.getHeaderFields());
+ metadata.put(HTTPMetadataConstants.RESPONSE_HEADERS, headers);
result = readResponse(metadata, headers, unmarshaller, is);
}
16 years, 6 months
JBoss Remoting SVN: r4209 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:27:52 -0400 (Wed, 21 May 2008)
New Revision: 4209
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote/CoyoteInvoker.java
Log:
JBREM-982: Checks SecurityUtility.skipAccessControl().
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote/CoyoteInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote/CoyoteInvoker.java 2008-05-22 03:26:00 UTC (rev 4208)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote/CoyoteInvoker.java 2008-05-22 03:27:52 UTC (rev 4209)
@@ -601,16 +601,23 @@
private void populateRequestMetadata(RequestMap metadata, Request req)
{
final MimeHeaders headers = req.getMimeHeaders();
- Enumeration nameEnum
- = (Enumeration)AccessController.doPrivileged( new PrivilegedAction()
- {
- public Object run()
- {
- return headers.names();
- }}
- );
+ Enumeration nameEnum = null;
+
+ if (SecurityUtility.skipAccessControl())
+ {
+ nameEnum = headers.names();
+ }
+ else
+ {
+ nameEnum = (Enumeration)AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ return headers.names();
+ }}
+ );
+ }
-
while (nameEnum.hasMoreElements())
{
Object nameObj = nameEnum.nextElement();
@@ -988,13 +995,22 @@
try
{
- Method methods[] = (Method[]) AccessController.doPrivileged( new PrivilegedAction()
+ Method[] methods = null;
+
+ if (SecurityUtility.skipAccessControl())
{
- public Object run()
+ methods = o.getClass().getMethods();
+ }
+ else
+ {
+ methods = (Method[]) AccessController.doPrivileged( new PrivilegedAction()
{
- return o.getClass().getMethods();
- }
- });
+ public Object run()
+ {
+ return o.getClass().getMethods();
+ }
+ });
+ }
Method setPropertyMethod = null;
16 years, 6 months