CVS update: JGroups/src/org/jgroups/protocols STOMP.java
"Bela Ban" <[email protected]> Mon, 25 Oct 2010 12:25:40 +0000
| Newsgroups | gmane.comp.java.javagroups.cvs |
|---|---|
| Message-ID | <[email protected]> |
User: belaban
Date: 10/10/25 12:25:40
Modified: src/org/jgroups/protocols STOMP.java
Log:
ns
Revision Changes Path
1.12 +14 -5 JGroups/src/org/jgroups/protocols/STOMP.java
Index: STOMP.java
===================================================================
RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/protocols/STOMP.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- STOMP.java 25 Oct 2010 12:18:29 -0000 1.11
+++ STOMP.java 25 Oct 2010 12:25:40 -0000 1.12
@@ -24,7 +24,7 @@
* The intended use for this protocol is pub-sub with clients which handle text messages, e.g. stock updates,
* SMS messages to mobile clients, SNMP traps etc.
* @author Bela Ban
- * @version $Id: STOMP.java,v 1.11 2010/10/25 12:18:29 belaban Exp $
+ * @version $Id: STOMP.java,v 1.12 2010/10/25 12:25:40 belaban Exp $
* @since 2.11
*/
@MBean
@@ -70,7 +70,8 @@
public static enum ClientVerb {CONNECT, SEND, SUBSCRIBE, UNSUBSCRIBE, BEGIN, COMMIT, ABORT, ACK, DISCONNECT}
- public static enum ServerVerb {MESSAGE, RECEIPT, ERROR, ENDPOINTS, CONNECTED}
+ public static enum ServerVerb {MESSAGE, RECEIPT, ERROR, CONNECTED, INFO
+ }
public static final byte NULL_BYTE=0;
@@ -174,8 +175,10 @@
}
update_clients=old_endpoint == null || !old_endpoint.equals(hdr.endpoint);
if(update_clients && this.send_endpoints) {
- for(Connection conn: connections) {
- conn.writeResponse(ServerVerb.ENDPOINTS, "endpoints", getAllEndpoints());
+ synchronized(connections) {
+ for(Connection conn: connections) {
+ conn.writeResponse(ServerVerb.INFO, "endpoints", getAllEndpoints());
+ }
}
}
}
@@ -194,12 +197,18 @@
return up_prot.up(evt);
}
- private void handleView(View view) {
+ protected void handleView(View view) {
broadcastEndpoint();
List<Address> mbrs=view.getMembers();
synchronized(endpoints) {
endpoints.keySet().retainAll(mbrs);
}
+
+ synchronized(connections) {
+ for(Connection conn: connections) {
+ conn.writeResponse(ServerVerb.INFO, "view", view.toString());
+ }
+ }
}
private static String getAddress(int port) {
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev