JBoss Remoting SVN: r3765 - 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-03-26 00:30:55 -0400 (Wed, 26 Mar 2008)
New Revision: 3765
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
Log:
JBREM-934: Put System.getProperty() in AccessController.doPrivileged() call.
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-03-26 04:30:00 UTC (rev 3764)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java 2008-03-26 04:30:55 UTC (rev 3765)
@@ -42,6 +42,9 @@
import javax.net.SocketFactory;
import javax.net.ssl.SSLServerSocketFactory;
import java.io.IOException;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -414,15 +417,45 @@
Map storeConfig = new HashMap();
storeConfig.putAll(owner.getConfiguration());
- String newFilePath = null;
+ String newFilePath = "data";
String filePath = (String) storeConfig.get(CallbackStore.FILE_PATH_KEY);
if(filePath == null)
{
- newFilePath = System.getProperty("jboss.server.data.dir", "data");
+ try
+ {
+ newFilePath = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return System.getProperty("jboss.server.data.dir", "data");
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ log.debug("error", e.getCause());
+ }
}
- newFilePath = newFilePath + System.getProperty("file.separator") + "remoting" +
- System.getProperty("file.separator") + sessionId;
+
+ String separator = "/";
+ try
+ {
+ separator = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return System.getProperty("file.separator");
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ log.debug("error", e.getCause());
+ }
+
+ newFilePath = newFilePath + separator + "remoting" +
+ System.getProperty("file.separator") + sessionId;
storeConfig.put(CallbackStore.FILE_PATH_KEY, newFilePath);
16 years, 9 months
JBoss Remoting SVN: r3764 - 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-03-26 00:30:00 -0400 (Wed, 26 Mar 2008)
New Revision: 3764
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackStore.java
Log:
JBREM-934: Put System.getProperty() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackStore.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackStore.java 2008-03-26 04:28:53 UTC (rev 3763)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackStore.java 2008-03-26 04:30:00 UTC (rev 3764)
@@ -24,10 +24,6 @@
import org.jboss.logging.Logger;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.serialization.SerializationStreamFactory;
-import org.jboss.remoting.transport.rmi.RMIServerInvoker;
-import org.jboss.util.propertyeditor.PropertyEditors;
-
-import java.beans.IntrospectionException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -122,7 +118,21 @@
// need to figure the best place to store on disk
if (filePath == null)
{
- filePath = System.getProperty("jboss.server.data.dir", "data");
+ try
+ {
+ filePath = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return System.getProperty("jboss.server.data.dir", "data");
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ log.debug("error", e.getCause());
+ filePath = "data";
+ }
}
File storeFile = new File(filePath);
if (!storeFile.exists())
16 years, 9 months
JBoss Remoting SVN: r3763 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-26 00:28:53 -0400 (Wed, 26 Mar 2008)
New Revision: 3763
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java
Log:
JBREM-934: Put System.getProperty() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java 2008-03-26 04:27:57 UTC (rev 3762)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java 2008-03-26 04:28:53 UTC (rev 3763)
@@ -56,6 +56,8 @@
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.UnknownHostException;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -1268,14 +1270,25 @@
{
// now need to get some external bindable address
boolean byHost = true;
- String bindByHost = System.getProperty(InvokerLocator.BIND_BY_HOST, "True");
+ String bindByHost = "True";
+
try
{
- byHost = Boolean.valueOf(bindByHost).booleanValue();
+ bindByHost = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return System.getProperty(InvokerLocator.BIND_BY_HOST, "True");
+ }
+ });
}
- catch(Exception e)
+ catch (Exception e)
{
+ log.debug("error", e.getCause());
}
+
+ byHost = Boolean.valueOf(bindByHost).booleanValue();
+
try
{
if(byHost)
16 years, 9 months
JBoss Remoting SVN: r3762 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-26 00:27:57 -0400 (Wed, 26 Mar 2008)
New Revision: 3762
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java
Log:
JBREM-934: Put System.getProperty() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java 2008-03-26 00:39:19 UTC (rev 3761)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java 2008-03-26 04:27:57 UTC (rev 3762)
@@ -22,6 +22,7 @@
package org.jboss.remoting;
+import java.beans.IntrospectionException;
import java.io.Serializable;
import java.net.InetAddress;
import java.net.MalformedURLException;
@@ -30,6 +31,8 @@
import java.net.UnknownHostException;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -461,8 +464,25 @@
}
else if(host.indexOf("0.0.0.0") != -1)
{
- if(System.getProperty(SERVER_BIND_ADDRESS, "0.0.0.0").equals("0.0.0.0"))
+ String bindAddress = null;
+ try
{
+ bindAddress = (String) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return System.getProperty(SERVER_BIND_ADDRESS, "0.0.0.0");
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ log.debug("error", e.getCause());
+ return "0.0.0.0";
+ }
+
+ if(bindAddress.equals("0.0.0.0"))
+ {
host = fixRemoteAddress(host);
}
else
@@ -480,14 +500,25 @@
if(address == null)
{
boolean byHost = true;
- String bindByHost = System.getProperty(BIND_BY_HOST, "True");
+ String bindByHost = "True";
+
try
{
- byHost = Boolean.getBoolean(bindByHost);
+ bindByHost = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return System.getProperty(BIND_BY_HOST, "True");
+ }
+ });
}
- catch(Exception e)
+ catch (Exception e)
{
+ log.debug("error", e.getCause());
}
+
+ byHost = Boolean.valueOf(bindByHost).booleanValue();
+
if(byHost)
{
return InetAddress.getLocalHost().getHostName();
16 years, 9 months
JBoss Remoting SVN: r3761 - remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-25 20:39:19 -0400 (Tue, 25 Mar 2008)
New Revision: 3761
Modified:
remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/AtomicStateMachine.java
Log:
Remove deprecated method
Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/AtomicStateMachine.java
===================================================================
--- remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/AtomicStateMachine.java 2008-03-26 00:38:16 UTC (rev 3760)
+++ remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/AtomicStateMachine.java 2008-03-26 00:39:19 UTC (rev 3761)
@@ -283,18 +283,6 @@
return this.state;
}
- @Deprecated
- public T waitForNotExclusive(final T state) {
- if (state == null) {
- throw new NullPointerException("state is null");
- }
- stateLock.lockExclusive();
- while (this.state == state) {
- stateLock.awaitExclusive();
- }
- return this.state;
- }
-
public T waitInterruptiblyForNotHold(final T state, final long timeout, final TimeUnit timeUnit) throws InterruptedException {
throw new RuntimeException("TODO - Implement");
}
16 years, 9 months
JBoss Remoting SVN: r3760 - in remoting3/trunk: jrpp/src/main/java/org/jboss/cx/remoting/jrpp and 1 other directory.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-25 20:38:16 -0400 (Tue, 25 Mar 2008)
New Revision: 3760
Modified:
remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreSession.java
remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppConnection.java
remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppProtocolSupport.java
Log:
Fix serialization problem, exception handling, and closed connection handling
Modified: remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreSession.java
===================================================================
--- remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreSession.java 2008-03-26 00:12:50 UTC (rev 3759)
+++ remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/CoreSession.java 2008-03-26 00:38:16 UTC (rev 3760)
@@ -98,7 +98,7 @@
}
UserSession getUserSession() {
- state.requireHold(State.UP);
+ state.waitForHold(State.UP);
try {
return userSession;
} finally {
@@ -452,9 +452,9 @@
@SuppressWarnings ({"unchecked"})
public void openSession(String remoteEndpointName) {
- state.waitForNotExclusive(State.NEW);
+ state.waitFor(State.CONNECTING);
+ state.requireTransitionExclusive(State.CONNECTING, State.UP);
try {
- state.requireTransition(State.CONNECTING, State.UP);
CoreSession.this.remoteEndpointName = remoteEndpointName;
} finally {
state.releaseExclusive();
@@ -565,9 +565,11 @@
throw new IOException("Duplicate stream identifier encountered: " + streamIdentifier);
}
streamSerializers.add(stream.getStreamSerializer());
+ log.trace("Writing stream marker for object: %s", testObject);
return new StreamMarker(factory.getClass(), streamIdentifier);
}
}
+ log.trace("Writing object: %s", testObject);
return testObject;
}
}
Modified: remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppConnection.java
===================================================================
--- remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppConnection.java 2008-03-26 00:12:50 UTC (rev 3759)
+++ remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppConnection.java 2008-03-26 00:38:16 UTC (rev 3760)
@@ -320,19 +320,19 @@
}
private void write(ObjectOutput output, ServiceIdentifier serviceIdentifier) throws IOException {
- output.writeShort(((JrppServiceIdentifier)serviceIdentifier).getId());
+ output.writeObject(serviceIdentifier);
}
private void write(ObjectOutput output, ContextIdentifier contextIdentifier) throws IOException {
- output.writeShort(((JrppContextIdentifier)contextIdentifier).getId());
+ output.writeObject(contextIdentifier);
}
private void write(ObjectOutput output, StreamIdentifier streamIdentifier) throws IOException {
- output.writeShort(((JrppStreamIdentifier)streamIdentifier).getId());
+ output.writeObject(streamIdentifier);
}
private void write(ObjectOutput output, RequestIdentifier requestIdentifier) throws IOException {
- output.writeShort(((JrppRequestIdentifier)requestIdentifier).getId());
+ output.writeObject(requestIdentifier);
}
public void sendResponse(byte[] rawMsgData) throws IOException {
@@ -674,6 +674,7 @@
public void exceptionCaught(Throwable throwable) {
log.error(throwable, "Exception from JRPP connection handler");
+ close();
if (throwable instanceof IOException) {
fail((IOException)throwable);
} else {
Modified: remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppProtocolSupport.java
===================================================================
--- remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppProtocolSupport.java 2008-03-26 00:12:50 UTC (rev 3759)
+++ remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppProtocolSupport.java 2008-03-26 00:38:16 UTC (rev 3760)
@@ -10,6 +10,7 @@
import org.apache.mina.common.IoProcessor;
import org.apache.mina.common.IoSession;
import org.apache.mina.common.IoSessionInitializer;
+import org.apache.mina.common.ExceptionMonitor;
import org.apache.mina.filter.logging.LoggingFilter;
import org.apache.mina.filter.sasl.SaslClientFilter;
import org.apache.mina.filter.sasl.SaslMessageSender;
@@ -73,6 +74,11 @@
// Lifecycle
public void create() throws RemotingException {
+ ExceptionMonitor.setInstance(new ExceptionMonitor() {
+ public void exceptionCaught(final Throwable cause) {
+ // do nothing!
+ }
+ });
ioProcessor = new NioProcessor(executor);
protocolHandlerFactory = new ProtocolHandlerFactoryImpl();
final Registration registration = endpoint.registerProtocol("jrpp", protocolHandlerFactory);
16 years, 9 months
JBoss Remoting SVN: r3759 - remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-25 20:12:50 -0400 (Tue, 25 Mar 2008)
New Revision: 3759
Modified:
remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppConnection.java
Log:
Some debug messages
Modified: remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppConnection.java
===================================================================
--- remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppConnection.java 2008-03-26 00:12:38 UTC (rev 3758)
+++ remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppConnection.java 2008-03-26 00:12:50 UTC (rev 3759)
@@ -727,6 +727,7 @@
write(output, MessageType.AUTH_SUCCESS);
output.commit();
saslServerFilter.startEncryption(ioSession);
+ log.trace("Server transitioning to UP state");
state.requireTransition(State.AWAITING_CLIENT_RESPONSE, State.UP);
protocolContext.openSession(remoteName);
}
@@ -775,6 +776,7 @@
final ObjectMessageOutput output = protocolContext.getMessageOutput(new IoBufferByteMessageOutput(buffer, ioSession));
write(output, MessageType.AUTH_SUCCESS);
output.commit();
+ log.trace("Server transitioning to UP state (immediate)");
state.requireTransition(State.UP);
protocolContext.openSession(remoteName);
} else {
@@ -832,6 +834,7 @@
case AUTH_SUCCESS: {
SaslClientFilter saslClientFilter = getSaslClientFilter();
saslClientFilter.startEncryption(ioSession);
+ log.trace("Client transitioning to UP state");
state.requireTransition(State.AWAITING_SERVER_CHALLENGE, State.UP);
protocolContext.openSession(remoteName);
return;
16 years, 9 months
JBoss Remoting SVN: r3758 - remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-25 20:12:38 -0400 (Tue, 25 Mar 2008)
New Revision: 3758
Modified:
remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/StateLock.java
Log:
Fix detection of exclusive locking
Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/StateLock.java
===================================================================
--- remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/StateLock.java 2008-03-25 23:30:48 UTC (rev 3757)
+++ remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/StateLock.java 2008-03-26 00:12:38 UTC (rev 3758)
@@ -43,6 +43,9 @@
// @protectedby {@code lock} (writes only)
private volatile boolean exclusive = false;
+ // @protectedby {@code lock} (all accesses)
+ private int serial = 0;
+
private final ThreadLocal<LockState> localLockState = new ThreadLocal<LockState>();
private void incLocalExclCount() {
@@ -116,6 +119,7 @@
}
}
exclusive = true;
+ serial++;
incLocalExclCount();
return;
} finally {
@@ -190,14 +194,11 @@
final ReaderToken token = nextReaderToken;
token.count++;
sharedHolderCount--;
- while (! exclusive) {
- try {
- lock.wait();
- } catch (InterruptedException e) {
- intr = true;
- }
+ if (sharedHolderCount == 0) {
+ lock.notifyAll();
}
- while (exclusive) {
+ final int origSerial = serial;
+ while (serial == origSerial || exclusive) {
try {
lock.wait();
} catch (InterruptedException e) {
16 years, 9 months
JBoss Remoting SVN: r3757 - remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-25 19:30:48 -0400 (Tue, 25 Mar 2008)
New Revision: 3757
Modified:
remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppConnection.java
Log:
JBREM-941 - confidentiality fails
Modified: remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppConnection.java
===================================================================
--- remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppConnection.java 2008-03-25 23:16:10 UTC (rev 3756)
+++ remoting3/trunk/jrpp/src/main/java/org/jboss/cx/remoting/jrpp/JrppConnection.java 2008-03-25 23:30:48 UTC (rev 3757)
@@ -235,7 +235,8 @@
defaultProps.put(Sasl.POLICY_NOANONYMOUS, "true");
defaultProps.put(Sasl.POLICY_NODICTIONARY, "true");
defaultProps.put(Sasl.POLICY_NOACTIVE, "true");
- defaultProps.put(Sasl.QOP, "auth-conf");
+ // TODO: JBREM-941
+ // defaultProps.put(Sasl.QOP, "auth-conf");
defaultProps.put("org.jboss.cx.remoting.sasl.srp.verifier", "password");
return defaultProps;
}
@@ -736,6 +737,7 @@
output.writeUTF("Authentication failed: " + ex.getMessage());
output.commit();
log.debug("Client authentication failed (" + ex.getMessage() + ")");
+ log.trace(ex, "Client authentication failure details follow");
// todo - retry counter - JBREM-907
state.requireTransition(State.AWAITING_CLIENT_RESPONSE, State.AWAITING_CLIENT_AUTH_REQUEST);
}
16 years, 9 months
JBoss Remoting SVN: r3756 - remoting3/trunk/srp/src/main/java/org/jboss/cx/remoting/core/security/sasl.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-25 19:16:10 -0400 (Tue, 25 Mar 2008)
New Revision: 3756
Modified:
remoting3/trunk/srp/src/main/java/org/jboss/cx/remoting/core/security/sasl/SrpSaslClientImpl.java
Log:
Remove a debug println
Modified: remoting3/trunk/srp/src/main/java/org/jboss/cx/remoting/core/security/sasl/SrpSaslClientImpl.java
===================================================================
--- remoting3/trunk/srp/src/main/java/org/jboss/cx/remoting/core/security/sasl/SrpSaslClientImpl.java 2008-03-25 23:15:16 UTC (rev 3755)
+++ remoting3/trunk/srp/src/main/java/org/jboss/cx/remoting/core/security/sasl/SrpSaslClientImpl.java 2008-03-25 23:16:10 UTC (rev 3756)
@@ -307,7 +307,6 @@
try {
selectIntegrity(integrity, K_bytes);
clientOptions.getIntegritySet().add(integrity);
- System.out.println("Adding integrity option " + integrity);
break;
} catch (NoSuchAlgorithmException e) {
if (trace) log.trace("Rejected JCA MAC algorithm '" + integrity + "': " + e.getMessage());
16 years, 9 months