JBoss Remoting SVN: r5156 - remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-07 21:52:32 -0400 (Thu, 07 May 2009)
New Revision: 5156
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/LeasePinger.java
Log:
JBREM-1128: Uses "useClientConnectIdentity" parameter.
Modified: remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/LeasePinger.java
===================================================================
--- remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/LeasePinger.java 2009-05-08 01:51:25 UTC (rev 5155)
+++ remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/LeasePinger.java 2009-05-08 01:52:32 UTC (rev 5156)
@@ -49,6 +49,7 @@
private int disconnectTimeout = DEFAULT_DISCONNECT_TIMEOUT;
private String leasePingerId;
+ private boolean useClientConnectionIdentity;
// Constructors ---------------------------------------------------------------------------------
@@ -80,12 +81,15 @@
timerTask.cancel();
timerTask = null;
- Iterator it = clients.values().iterator();
+ if (useClientConnectionIdentity)
{
- Client client = (Client) it.next();
- log.debug(this + " calling " + client + ".notifyAndDisconnect()");
- client.notifyAndDisconnect();
- it.remove();
+ Iterator it = clients.values().iterator();
+ {
+ Client client = (Client) it.next();
+ log.debug(this + " calling " + client + ".notifyAndDisconnect()");
+ client.notifyAndDisconnect();
+ it.remove();
+ }
}
try
@@ -121,7 +125,7 @@
if (!clientSessionIds.isEmpty())
{
log.debug(this + " " + clientSessionIds.size() + " remaining clients:");
- it = clientSessionIds.keySet().iterator();
+ Iterator it = clientSessionIds.keySet().iterator();
while (it.hasNext())
{
log.debug(this + ": " + it.next());
@@ -145,10 +149,13 @@
if(trace) { log.trace(this + " adding new client with session ID " + sessionID + " and lease period " + leasePeriod); }
- Client client = (Client) configuration.remove(Client.CLIENT);
- if (client != null)
+ if (useClientConnectionIdentity)
{
- clients.put(sessionID, client);
+ Client client = (Client) configuration.remove(Client.CLIENT);
+ if (client != null)
+ {
+ clients.put(sessionID, client);
+ }
}
ClientHolder newClient = new ClientHolder(sessionID, configuration, leasePeriod);
@@ -209,7 +216,10 @@
}
clientSessionIds.remove(sessionID);
- clients.remove(sessionID);
+ if (useClientConnectionIdentity)
+ {
+ clients.remove(sessionID);
+ }
}
else
{
@@ -306,6 +316,16 @@
this.leasePingerId = leasePingerId;
}
+ boolean isUseClientConnectionIdentity()
+ {
+ return useClientConnectionIdentity;
+ }
+
+ void setUseClientConnectionIdentity(boolean useClientConnectionIdentity)
+ {
+ this.useClientConnectionIdentity = useClientConnectionIdentity;
+ }
+
// Private --------------------------------------------------------------------------------------
private void sendClientPing()
15 years, 9 months
JBoss Remoting SVN: r5155 - remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-07 21:51:25 -0400 (Thu, 07 May 2009)
New Revision: 5155
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Client.java
Log:
JBREM-1128: Uses "useClientConnectIdentity" parameter.
Modified: remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Client.java
===================================================================
--- remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Client.java 2009-05-07 21:58:37 UTC (rev 5154)
+++ remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Client.java 2009-05-08 01:51:25 UTC (rev 5155)
@@ -197,6 +197,8 @@
private boolean connected = false;
private Set connectionListeners = new HashSet();
+
+ private boolean useClientConnectionIdentity;
// Constructors ---------------------------------------------------------------------------------
@@ -274,6 +276,15 @@
if (configuration != null)
{
this.configuration = new HashMap(configuration);
+ Object o = configuration.get(Remoting.USE_CLIENT_CONNECTION_IDENTITY);
+ if (o instanceof String)
+ {
+ useClientConnectionIdentity = Boolean.valueOf((String) o).booleanValue();
+ }
+ else if (o != null)
+ {
+ log.warn("value of " + Remoting.USE_CLIENT_CONNECTION_IDENTITY + " must be a String: " + o);
+ }
}
this.sessionId = new GUID().toString();
}
@@ -1819,8 +1830,11 @@
{
temp.putAll(metadata);
}
- temp.put(CLIENT, this);
- temp.put(CONNECTION_LISTENER, listener);
+ if (useClientConnectionIdentity)
+ {
+ temp.put(CLIENT, this);
+ temp.put(CONNECTION_LISTENER, listener);
+ }
log.debug(this + ": temp = " + temp);
log.debug(this + " calling MicroRemoteClientInvoker.establishLease()");
invoker.establishLease(sessionId, temp, leasePeriod);
15 years, 9 months
JBoss Remoting SVN: r5154 - remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-07 17:58:37 -0400 (Thu, 07 May 2009)
New Revision: 5154
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Client.java
Log:
JBREM-1128: Made new connect() synchronized.
Modified: remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Client.java
===================================================================
--- remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Client.java 2009-05-07 21:57:57 UTC (rev 5153)
+++ remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Client.java 2009-05-07 21:58:37 UTC (rev 5154)
@@ -559,7 +559,7 @@
* ConnectionListeners of the broken connection. At that point, the LeasePinger will be
* destroyed, and all of the associated Clients will be disconnected.
*/
- public void connect(ConnectionListener listener, Map metadata) throws Exception
+ public synchronized void connect(ConnectionListener listener, Map metadata) throws Exception
{
log.debug(this + ".connect(" + listener + ")");
log.debug(this + ": metadata = " + metadata);
15 years, 9 months
JBoss Remoting SVN: r5153 - remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-07 17:57:57 -0400 (Thu, 07 May 2009)
New Revision: 5153
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/ConnectionValidator.java
Log:
JBREM-1128: Just makes one call to Client.getInvoker() in getParameters() (cosmetic).
Modified: remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/ConnectionValidator.java
===================================================================
--- remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/ConnectionValidator.java 2009-05-07 21:56:11 UTC (rev 5152)
+++ remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/ConnectionValidator.java 2009-05-07 21:57:57 UTC (rev 5153)
@@ -518,7 +518,8 @@
ClientInvoker clientInvoker = client.getInvoker();
if (clientInvoker instanceof MicroRemoteClientInvoker)
{
- invokerSessionId = ((MicroRemoteClientInvoker) clientInvoker).getSessionId();
+ sharedInvoker = (MicroRemoteClientInvoker) clientInvoker;
+ invokerSessionId = sharedInvoker.getSessionId();
}
else
{
@@ -526,7 +527,6 @@
}
if (stopLeaseOnFailure)
{
- sharedInvoker = (MicroRemoteClientInvoker) client.getInvoker();
if (sharedInvoker != null)
{
leasePinger = sharedInvoker.getLeasePinger();
15 years, 9 months
JBoss Remoting SVN: r5152 - remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-07 17:56:11 -0400 (Thu, 07 May 2009)
New Revision: 5152
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/LeasePinger.java
Log:
(1) JBREM-1129: Uses LeasePinger.TIME_STAMP; (2) JBREM-1128: removeClient() removes Client from clients.
Modified: remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/LeasePinger.java
===================================================================
--- remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/LeasePinger.java 2009-05-07 21:53:39 UTC (rev 5151)
+++ remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/LeasePinger.java 2009-05-07 21:56:11 UTC (rev 5152)
@@ -24,7 +24,9 @@
public static final long DEFAULT_LEASE_PERIOD = 5000;
public static final int DEFAULT_DISCONNECT_TIMEOUT = -1;
- public static final String LEASE_PINGER_ID = "leasePingerId";
+
+ static final String LEASE_PINGER_ID = "leasePingerId";
+ static final String TIME_STAMP = "timeStamp";
// Static ---------------------------------------------------------------------------------------
@@ -207,6 +209,7 @@
}
clientSessionIds.remove(sessionID);
+ clients.remove(sessionID);
}
else
{
@@ -329,7 +332,7 @@
Map requestClients = new ConcurrentHashMap();
requestClients.put(ClientHolder.CLIENT_HOLDER_KEY, clientsClone);
requestClients.put(LeasePinger.LEASE_PINGER_ID, leasePingerId);
- requestClients.put("time", Long.toString(System.currentTimeMillis()));
+ requestClients.put(TIME_STAMP, Long.toString(System.currentTimeMillis()));
InvocationRequest ir = new InvocationRequest(invokerSessionID, null, "$PING$", requestClients, null, null);
invoker.invoke(ir);
15 years, 9 months
JBoss Remoting SVN: r5151 - remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-07 17:53:39 -0400 (Thu, 07 May 2009)
New Revision: 5151
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Lease.java
Log:
JBREM-1112 (and others to be named): Uses LeasePinger.TIME_STAMP.
Modified: remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Lease.java
===================================================================
--- remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Lease.java 2009-05-07 06:10:58 UTC (rev 5150)
+++ remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Lease.java 2009-05-07 21:53:39 UTC (rev 5151)
@@ -70,7 +70,7 @@
{
this.requestPayload = (Map)requestPayload.get(ClientHolder.CLIENT_HOLDER_KEY);
this.leasePingerId = (String) requestPayload.get(LeasePinger.LEASE_PINGER_ID);
- this.lastUpdate = Long.valueOf((String) requestPayload.get("time")).longValue();
+ this.lastUpdate = Long.valueOf((String) requestPayload.get(LeasePinger.TIME_STAMP)).longValue();
log.debug(this + " initialized with lastUpdate: " + lastUpdate);
log.debug(this + " initialized with requestPayload: " + this.requestPayload);
}
15 years, 9 months
JBoss Remoting SVN: r5150 - remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-07 02:10:58 -0400 (Thu, 07 May 2009)
New Revision: 5150
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/ServerInvoker.java
Log:
JBREM-1112 (and others to be named): Reduced level of a log statement.
Modified: remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/ServerInvoker.java
===================================================================
--- remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/ServerInvoker.java 2009-05-07 06:10:19 UTC (rev 5149)
+++ remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/ServerInvoker.java 2009-05-07 06:10:58 UTC (rev 5150)
@@ -1950,7 +1950,7 @@
{
callbackHandler = (ServerInvokerCallbackHandler) callbackHandlers.remove(id);
}
- log.info(this + " removed " + callbackHandler);
+ log.debug(this + " removed " + callbackHandler);
return callbackHandler;
}
15 years, 9 months
JBoss Remoting SVN: r5149 - remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-07 02:10:19 -0400 (Thu, 07 May 2009)
New Revision: 5149
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Client.java
Log:
JBREM-1112 (and others to be named): setupClientLease() passes metadata to addConnectionListener()..
Modified: remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Client.java
===================================================================
--- remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Client.java 2009-05-07 05:12:55 UTC (rev 5148)
+++ remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/Client.java 2009-05-07 06:10:19 UTC (rev 5149)
@@ -1827,7 +1827,7 @@
}
else if (listener != null)
{
- addConnectionListener(listener, configuration);
+ addConnectionListener(listener, metadata);
}
}
15 years, 9 months
JBoss Remoting SVN: r5148 - remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/callback.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-07 01:12:55 -0400 (Thu, 07 May 2009)
New Revision: 5148
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
Log:
JBREM-1112 (and others to be named): Reduced level of a log statement.
Modified: remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
===================================================================
--- remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java 2009-05-07 04:45:37 UTC (rev 5147)
+++ remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java 2009-05-07 05:12:55 UTC (rev 5148)
@@ -1033,7 +1033,7 @@
{
if (clientSessionId.equals(client.getSessionId()))
{
- log.info(this + ".handleConnectionException() got a match: " + client.getSessionId());
+ log.debug(this + ".handleConnectionException() got a match: " + client.getSessionId());
shutdown();
}
}
15 years, 9 months
JBoss Remoting SVN: r5147 - remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/callback.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2009-05-07 00:45:37 -0400 (Thu, 07 May 2009)
New Revision: 5147
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
Log:
JBREM-1112 (and others to be named): Added shutdown() method.
Modified: remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
===================================================================
--- remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java 2009-05-07 04:45:05 UTC (rev 5146)
+++ remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java 2009-05-07 04:45:37 UTC (rev 5147)
@@ -80,6 +80,7 @@
private SerializableStore callbackStore = null;
private CallbackErrorHandler callbackErrorHandler = null;
+ private ServerInvoker serverInvoker;
/**
* The map key to use when looking up any callback store that
@@ -165,6 +166,7 @@
private void init(InvocationRequest invocation, ServerInvoker owner) throws Exception
{
+ serverInvoker = owner;
clientSessionId = invocation.getSessionId();
sessionId = invocation.getSessionId();
@@ -854,7 +856,7 @@
}
catch(Throwable t)
{
- log.error("Error handling callback", t);
+ log.debug("Error handling callback", t);
throw new HandleCallbackException("Error handling callback", t);
}
}
@@ -1020,12 +1022,19 @@
}
}
+ public void shutdown()
+ {
+ serverInvoker.shutdownCallbackHandler(this, invocation);
+ destroy();
+ log.debug(this + " shut down");
+ }
+
public void handleConnectionException(Throwable throwable, Client client)
{
if (clientSessionId.equals(client.getSessionId()))
{
- destroy();
- log.debug(this + " shut down");
+ log.info(this + ".handleConnectionException() got a match: " + client.getSessionId());
+ shutdown();
}
}
}
15 years, 9 months