JBoss Remoting SVN: r4208 - remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/http.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:26:00 -0400 (Wed, 21 May 2008)
New Revision: 4208
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/http/HTTPUnMarshaller.java
Log:
JBREM-982: Made logger static.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/http/HTTPUnMarshaller.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/http/HTTPUnMarshaller.java 2008-05-22 03:25:10 UTC (rev 4207)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/http/HTTPUnMarshaller.java 2008-05-22 03:26:00 UTC (rev 4208)
@@ -49,7 +49,7 @@
public final static String PRESERVE_LINES = "preserveLines";
- protected final Logger log = Logger.getLogger(getClass());
+ protected final static Logger log = Logger.getLogger(HTTPUnMarshaller.class);
/**
* Will try to unmarshall data from inputstream. Will try to convert to either an object
16 years, 8 months
JBoss Remoting SVN: r4207 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:25:10 -0400 (Wed, 21 May 2008)
New Revision: 4207
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java
Log:
JBREM-982: In invoke() make a single test if payload is a String before testing for internal actions.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java 2008-05-22 03:21:34 UTC (rev 4206)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java 2008-05-22 03:25:10 UTC (rev 4207)
@@ -731,60 +731,63 @@
{
return ECHO;
}
-
- // check to see if this is a is alive ping
- if ("$PING$".equals(param))
+
+ if (param instanceof String)
{
- Map metadata = invocation.getRequestPayload();
- if (metadata != null)
+ // check to see if this is a is alive ping
+ if ("$PING$".equals(param))
{
- String invokerSessionId = (String) metadata.get(INVOKER_SESSION_ID);
- if (invokerSessionId != null)
+ Map metadata = invocation.getRequestPayload();
+ if (metadata != null)
{
- // Comes from ConnectionValidator configured to tie validation with lease.
- boolean response = checkForClientLease(invokerSessionId);
- if (trace) log.trace(this + " responding " + response + " to $PING$ for invoker sessionId " + invokerSessionId);
- return new Boolean(response);
+ String invokerSessionId = (String) metadata.get(INVOKER_SESSION_ID);
+ if (invokerSessionId != null)
+ {
+ // Comes from ConnectionValidator configured to tie validation with lease.
+ boolean response = checkForClientLease(invokerSessionId);
+ if (trace) log.trace(this + " responding " + response + " to $PING$ for invoker sessionId " + invokerSessionId);
+ return new Boolean(response);
+ }
}
- }
-
- if (leaseManagement)
- {
- // Otherwise, it's a normal PING. NOTE we only update the lease when we
- // receive a PING, not for all invocations.
- updateClientLease(invocation);
- }
- // if this is an invocation ping, just pong back
- Map responseMap = new HashMap();
- responseMap.put(CLIENT_LEASE_PERIOD, new Long(leasePeriod));
+ if (leaseManagement)
+ {
+ // Otherwise, it's a normal PING. NOTE we only update the lease when we
+ // receive a PING, not for all invocations.
+ updateClientLease(invocation);
+ }
- InvocationResponse ir = new InvocationResponse(invocation.getSessionId(),
- new Boolean(leaseManagement),
- false, responseMap);
+ // if this is an invocation ping, just pong back
+ Map responseMap = new HashMap();
+ responseMap.put(CLIENT_LEASE_PERIOD, new Long(leasePeriod));
- if (trace) { log.trace(this + " returning " + ir); }
- return ir;
- }
+ InvocationResponse ir = new InvocationResponse(invocation.getSessionId(),
+ new Boolean(leaseManagement),
+ false, responseMap);
- if ("$GET_CLIENT_LOCAL_ADDRESS$".equals(param))
- {
- InetAddress address = null;
- if (invocation.getRequestPayload() != null)
- address = (InetAddress) invocation.getRequestPayload().get(Remoting.CLIENT_ADDRESS);
-
- return address;
- }
+ if (trace) { log.trace(this + " returning " + ir); }
+ return ir;
+ }
- if ("$DISCONNECT$".equals(param))
- {
- if (leaseManagement)
+ if ("$GET_CLIENT_LOCAL_ADDRESS$".equals(param))
{
- terminateLease(invocation);
+ InetAddress address = null;
+ if (invocation.getRequestPayload() != null)
+ address = (InetAddress) invocation.getRequestPayload().get(Remoting.CLIENT_ADDRESS);
+
+ return address;
}
- if (trace) { log.trace(this + " returning null"); }
- return null;
+ if ("$DISCONNECT$".equals(param))
+ {
+ if (leaseManagement)
+ {
+ terminateLease(invocation);
+ }
+
+ if (trace) { log.trace(this + " returning null"); }
+ return null;
+ }
}
//TODO: -TME both oneway and internal invocation will be broken since have not
@@ -1042,7 +1045,7 @@
{
try
{
- maxOnewayThreadPoolQueueSize = Integer.parseInt(param);
+ maxOnewayThreadPoolQueueSize = Integer.parseInt((String) param);
}
catch (NumberFormatException e)
{
16 years, 8 months
JBoss Remoting SVN: r4206 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:21:34 -0400 (Wed, 21 May 2008)
New Revision: 4206
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
Log:
JBREM-978: Moved classloader retrieval to SecurityUtility.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2008-05-21 02:01:20 UTC (rev 4205)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2008-05-22 03:21:34 UTC (rev 4206)
@@ -9,11 +9,10 @@
import org.jboss.remoting.marshal.UnMarshaller;
import org.jboss.remoting.marshal.UpdateableClassloaderUnMarshaller;
import org.jboss.remoting.transport.ClientInvoker;
+import org.jboss.remoting.util.SecurityUtility;
import org.jboss.util.id.GUID;
import java.io.IOException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -117,13 +116,7 @@
// class loader. This allows to load remoting classes as well as user's
// classes. If possible, will simply reset context classloader on existing
// RemotingClassLoader.
- final ClassLoader contextClassLoader = (ClassLoader) AccessController.doPrivileged( new PrivilegedAction()
- {
- public Object run()
- {
- return Thread.currentThread().getContextClassLoader();
- }
- });
+ final ClassLoader contextClassLoader = SecurityUtility.getContextClassLoader(Thread.currentThread());
if (unmarshaller instanceof UpdateableClassloaderUnMarshaller)
{
UpdateableClassloaderUnMarshaller uclum = (UpdateableClassloaderUnMarshaller) unmarshaller;
@@ -135,26 +128,13 @@
}
else
{
- rcl = (RemotingClassLoader)AccessController.doPrivileged( new PrivilegedAction()
- {
- public Object run()
- {
- return new RemotingClassLoader(getClassLoader(), contextClassLoader);
- }
- });
-
+ rcl = SecurityUtility.createRemotingClassLoader(getClassLoader(), contextClassLoader);
unmarshaller.setClassLoader(rcl);
}
}
else
{
- rcl = (RemotingClassLoader)AccessController.doPrivileged( new PrivilegedAction()
- {
- public Object run()
- {
- return new RemotingClassLoader(getClassLoader(), contextClassLoader);
- }
- });
+ rcl = SecurityUtility.createRemotingClassLoader(getClassLoader(), contextClassLoader);
unmarshaller.setClassLoader(rcl);
}
}
@@ -370,25 +350,13 @@
public void setUnMarshaller(UnMarshaller unmarshaller)
{
- ClassLoader classLoader = (ClassLoader) AccessController.doPrivileged( new PrivilegedAction()
- {
- public Object run()
- {
- return Thread.currentThread().getContextClassLoader();
- }
- });
+ ClassLoader classLoader = SecurityUtility.getContextClassLoader(Thread.currentThread());
unmarshallers.put(classLoader, unmarshaller);
}
public UnMarshaller getUnMarshaller()
{
- ClassLoader classLoader = (ClassLoader) AccessController.doPrivileged( new PrivilegedAction()
- {
- public Object run()
- {
- return Thread.currentThread().getContextClassLoader();
- }
- });
+ ClassLoader classLoader = SecurityUtility.getContextClassLoader(Thread.currentThread());
return (UnMarshaller)unmarshallers.get(classLoader);
}
16 years, 8 months
JBoss Remoting SVN: r4205 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-20 22:01:20 -0400 (Tue, 20 May 2008)
New Revision: 4205
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.java
Log:
JBREM-980: (1) Processs InvokerLocator with InvokerLocator.validateLocator() before matching; (2) matches against InvokerLocator.getLocatorURI() instead of getOriginalURI().
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.java 2008-05-21 01:59:13 UTC (rev 4204)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.java 2008-05-21 02:01:20 UTC (rev 4205)
@@ -42,6 +42,7 @@
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.util.Iterator;
/**
@@ -180,6 +181,16 @@
{
return null;
}
+ try
+ {
+ InvokerLocator validatedLocator = new InvokerLocator(locatorUrl);
+ locatorUrl = InvokerLocator.validateLocator(validatedLocator).getLocatorURI();
+ }
+ catch (MalformedURLException e)
+ {
+ log.warn("malformed URL: " + locatorUrl);
+ return null;
+ }
ServerInvoker[] serverInvokers = InvokerRegistry.getServerInvokers();
if (serverInvokers != null && serverInvokers.length > 0)
@@ -188,7 +199,7 @@
{
ServerInvoker svrInvoker = serverInvokers[x];
InvokerLocator locator = svrInvoker.getLocator();
- if (locatorUrl.equalsIgnoreCase(locator.getOriginalURI()))
+ if (locatorUrl.equalsIgnoreCase(locator.getLocatorURI()))
{
return (ServletServerInvokerMBean) svrInvoker;
}
16 years, 8 months
JBoss Remoting SVN: r4204 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-20 21:59:13 -0400 (Tue, 20 May 2008)
New Revision: 4204
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java
Log:
JBREM-980: Moved validateLocator() from ServerInvoker to InvokerLocator.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java 2008-05-21 01:58:36 UTC (rev 4203)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java 2008-05-21 01:59:13 UTC (rev 4204)
@@ -55,10 +55,6 @@
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.net.InetAddress;
-import java.net.MalformedURLException;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -1046,7 +1042,7 @@
{
try
{
- maxOnewayThreadPoolQueueSize = Integer.parseInt((String) param);
+ maxOnewayThreadPoolQueueSize = Integer.parseInt(param);
}
catch (NumberFormatException e)
{
@@ -1096,7 +1092,11 @@
createServerSocketFactory();
// need to check invoker locator to see if need to provide binding address (in the case 0.0.0.0 was used)
- locator = validateLocator(locator);
+ InvokerLocator originalLocator = locator;
+ locator = InvokerLocator.validateLocator(locator);
+
+ // need to update the locator key used in the invoker registry
+ InvokerRegistry.updateServerInvokerLocator(originalLocator, locator);
}
protected void setupHomes(Map config) throws Exception
@@ -1257,60 +1257,6 @@
return homes;
}
- /**
- * InvokerLocator leaves address 0.0.0.0 unchanged. Once serverBindAddress has been
- * extracted from the InvokerLocator, it is necessary to transform 0.0.0.0 into an
- * address that contacted over the network. See JBREM-687.
- */
- private InvokerLocator validateLocator(InvokerLocator locator) throws MalformedURLException
- {
- InvokerLocator externalLocator = locator;
-
- String host = locator.getHost();
- String newHost = null;
- if(host == null || InvokerLocator.ANY.equals(host))
- {
- // now need to get some external bindable address
- try
- {
- newHost = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- String bindByHost = System.getProperty(InvokerLocator.BIND_BY_HOST, "True");
- boolean byHost = Boolean.valueOf(bindByHost).booleanValue();
- if(byHost)
- {
- return InetAddress.getLocalHost().getHostName();
- }
- else
- {
- return InetAddress.getLocalHost().getHostAddress();
- }
- }
- });
- }
- catch (PrivilegedActionException e)
- {
- log.debug("Could not get host by name or address.", e.getCause());
- }
-
- if(newHost == null)
- {
- // now what? step through network interfaces?
- throw new RuntimeException("Can not determine bindable address for locator (" + locator + ")");
- }
-
- externalLocator = new InvokerLocator(locator.protocol, newHost, locator.port,
- locator.getPath(), locator.getParameters());
-
- // need to update the locator key used in the invoker registry
- InvokerRegistry.updateServerInvokerLocator(locator, externalLocator);
- }
-
- return externalLocator;
- }
-
protected int assignPort() throws IOException
{
int port;
16 years, 8 months
JBoss Remoting SVN: r4203 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-20 21:58:36 -0400 (Tue, 20 May 2008)
New Revision: 4203
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java
Log:
JBREM-980: Moved validateLocator() from ServerInvoker to InvokerLocator.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java 2008-05-19 03:15:53 UTC (rev 4202)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java 2008-05-21 01:58:36 UTC (rev 4203)
@@ -224,6 +224,58 @@
public static final String DEFAULT_PORT = "defaultPort";
+ /**
+ * InvokerLocator leaves address 0.0.0.0 unchanged. Once serverBindAddress has been
+ * extracted from the InvokerLocator, it is necessary to transform 0.0.0.0 into an
+ * address that contacted over the network. See JBREM-687.
+ */
+ public static InvokerLocator validateLocator(InvokerLocator locator) throws MalformedURLException
+ {
+ InvokerLocator externalLocator = locator;
+
+ String host = locator.getHost();
+ String newHost = null;
+ if(host == null || InvokerLocator.ANY.equals(host))
+ {
+ // now need to get some external bindable address
+ try
+ {
+ newHost = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ String bindByHost = System.getProperty(InvokerLocator.BIND_BY_HOST, "True");
+ boolean byHost = Boolean.valueOf(bindByHost).booleanValue();
+ if(byHost)
+ {
+ return InetAddress.getLocalHost().getHostName();
+ }
+ else
+ {
+ return InetAddress.getLocalHost().getHostAddress();
+ }
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ log.debug("Could not get host by name or address.", e.getCause());
+ }
+
+ if(newHost == null)
+ {
+ // now what? step through network interfaces?
+ throw new RuntimeException("Can not determine bindable address for locator (" + locator + ")");
+ }
+
+ externalLocator = new InvokerLocator(locator.protocol, newHost, locator.port,
+ locator.getPath(), locator.getParameters());
+ }
+
+ return externalLocator;
+ }
+
+
public static void extractHomes(String homeList, List list, int defaultPort)
{
StringTokenizer tok = new StringTokenizer(homeList, "!");
16 years, 8 months
JBoss Remoting SVN: r4202 - remoting2/branches/2.x/src/etc.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-18 23:15:53 -0400 (Sun, 18 May 2008)
New Revision: 4202
Modified:
remoting2/branches/2.x/src/etc/remoting.security.policy.tests
Log:
JBREM-920: Added some MBeanPermissions to replace some permissions removed from remoting.security.policy.core.
Modified: remoting2/branches/2.x/src/etc/remoting.security.policy.tests
===================================================================
--- remoting2/branches/2.x/src/etc/remoting.security.policy.tests 2008-05-18 04:42:39 UTC (rev 4201)
+++ remoting2/branches/2.x/src/etc/remoting.security.policy.tests 2008-05-19 03:15:53 UTC (rev 4202)
@@ -64,9 +64,15 @@
// org.jboss.test.remoting.transport.rmi.ssl.builder.RMIInvokerTestCase
permission javax.management.MBeanPermission "org.jboss.remoting.security.SSLServerSocketFactoryService#createServerSocket[test:type=serversocketfactory]", "invoke";
- // org.jboss.test.remoting.transport.{bisocket,socket}.ssl.config.FactoryConfigTestCase
+ // org.jboss.test.remoting.transport.{bisocket,http,socket}.ssl.config.FactoryConfigTestCase
permission javax.management.MBeanPermission "org.jboss.remoting.security.SSLServerSocketFactoryService#createServerSocket[jboss:type=serversocketfactory]", "invoke";
+ permission javax.management.MBeanPermission "org.jboss.remoting.security.SSLServerSocketFactoryService#SSLSocketBuilder[jboss:type=serversocketfactory]", "getAttribute";
+ permission javax.management.MBeanPermission "org.jboss.remoting.security.SSLServerSocketFactoryService#SSLSocketBuilder[jboss:type=serversocketfactory2]", "getAttribute";
+ // org.jboss.test.remoting.transport.rmi.ssl.config.FactoryConfigTestCase
+ permission javax.management.MBeanPermission "org.jboss.test.remoting.transport.rmi.ssl.config.FactoryConfigTestCase$SerializableServerSocketFactory#SSLSocketBuilder[jboss:type=serversocketfactory]", "getAttribute";
+ permission javax.management.MBeanPermission "org.jboss.test.remoting.transport.rmi.ssl.config.FactoryConfigTestCase$SerializableServerSocketFactory#SSLSocketBuilder[jboss:type=serversocketfactory2]", "getAttribute";
+
// org.jboss.test.remoting.transport.http.connection.socketfactory.by_mbean.SocketFactoryByMBeanTestCase
permission javax.management.MBeanPermission "org.jboss.test.remoting.transport.http.connection.socketfactory.by_mbean.SocketFactoryTestServer$ServerSocketFactoryMock#createServerSocket[jboss:type=serversocketfactory]", "invoke";
@@ -80,6 +86,9 @@
permission javax.management.MBeanPermission "org.jboss.test.remoting.transport.rmi.ssl.config.FactoryConfigTestCase$SerializableServerSocketFactory#createServerSocket[jboss:type=serversocketfactory]", "invoke";
permission javax.management.MBeanPermission "org.jboss.test.remoting.transport.rmi.ssl.config.FactoryConfigTestCase$SerializableServerSocketFactory#createServerSocket[jboss:type=serversocketfactory2]", "invoke";
+ // org.jboss.test.remoting.transport.{bisocket,rmi}.ssl.builder.SSLBisocketInvokerTestCase
+ permission javax.management.MBeanPermission "org.jboss.remoting.security.SSLServerSocketFactoryService#SSLSocketBuilder[test:type=serversocketfactory]", "getAttribute";
+
// Subclasses of org.jboss.test.remoting.transport.config.FactoryConfigTestCaseParent and FactoryConfigTestCaseSSLParent
// org.jboss.test.remoting.transport.{http,socket}.connection.socketfactory.by_mbean.SocketFactoryTestServer
permission javax.management.MBeanPermission "org.jboss.test.remoting.transport.socket.connection.socketfactory.by_mbean.SocketFactoryTestServer$ServerSocketFactoryMock#createServerSocket[jboss:type=serversocketfactory]", "invoke";
16 years, 8 months
JBoss Remoting SVN: r4201 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/security.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-18 00:42:39 -0400 (Sun, 18 May 2008)
New Revision: 4201
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/security/CallbackStoreProxyTestCase.java
Log:
JBREM-977: Sets ServerInvokerCallbackHandler.shouldPersist to true.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/security/CallbackStoreProxyTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/security/CallbackStoreProxyTestCase.java 2008-05-18 04:41:59 UTC (rev 4200)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/security/CallbackStoreProxyTestCase.java 2008-05-18 04:42:39 UTC (rev 4201)
@@ -204,6 +204,7 @@
{
public void addListener(InvokerCallbackHandler callbackHandler)
{
+ ((ServerInvokerCallbackHandler) callbackHandler).setShouldPersist(true);
TestCallbackThread callbackThread = new TestCallbackThread(callbackHandler);
callbackThread.start();
16 years, 8 months
JBoss Remoting SVN: r4200 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/security.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-18 00:41:59 -0400 (Sun, 18 May 2008)
New Revision: 4200
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/security/TestCallbackStore.java
Log:
JBREM-977: Eliminated big memory holder.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/security/TestCallbackStore.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/security/TestCallbackStore.java 2008-05-18 04:40:58 UTC (rev 4199)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/security/TestCallbackStore.java 2008-05-18 04:41:59 UTC (rev 4200)
@@ -31,16 +31,16 @@
public class TestCallbackStore implements TestCallbackStoreMBean
{
private static Logger log = Logger.getLogger(TestCallbackStore.class);
- private static byte[] memHolder;
+// private static byte[] memHolder;
- static
- {
- long max = Runtime.getRuntime().maxMemory();
- log.info("max mem: " + max);
- int memSize = (int) (max * 0.6);
- memHolder = new byte[memSize];
- log.info("memHolder.length: " + memHolder.length);
- }
+// static
+// {
+// long max = Runtime.getRuntime().maxMemory();
+// log.info("max mem: " + max);
+// int memSize = (int) (max * 0.6);
+// memHolder = new byte[memSize];
+// log.info("memHolder.length: " + memHolder.length);
+// }
private int size;
16 years, 8 months
JBoss Remoting SVN: r4199 - remoting2/branches/2.x/src/main/org/jboss/remoting/callback.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-18 00:40:58 -0400 (Sun, 18 May 2008)
New Revision: 4199
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
Log:
JBREM-977: Added flag "shouldPersist".
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java 2008-05-17 19:30:25 UTC (rev 4198)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java 2008-05-18 04:40:58 UTC (rev 4199)
@@ -80,6 +80,7 @@
private String clientSessionId;
private InvokerLocator serverLocator;
private int blockingTimeout = ServerInvoker.DEFAULT_BLOCKING_TIMEOUT;
+ private boolean shouldPersist;
private SerializableStore callbackStore = null;
@@ -879,6 +880,8 @@
*/
private boolean shouldPersist()
{
+ if (shouldPersist)
+ return true;
return isMemLow();
}
@@ -1032,4 +1035,14 @@
log.debug(this + " shut down");
}
}
+
+ public boolean isShouldPersist()
+ {
+ return shouldPersist;
+ }
+
+ public void setShouldPersist(boolean shouldPersist)
+ {
+ this.shouldPersist = shouldPersist;
+ }
}
16 years, 8 months