tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1187810 - in /tomcat/trunk/modules/bayeux: ./ java/org/apache/cometd/bayeux/ java/org/apache/tomcat/bayeux/ java/org/apache/tomcat/bayeux/request/ test/org/apache/cometd/bayeux/samples/ webapps/cometd/WEB-INF/ webapps/cometd/examples/simpl...
Date Sat, 22 Oct 2011 21:29:12 GMT
Author: markt
Date: Sat Oct 22 21:29:11 2011
New Revision: 1187810

URL: http://svn.apache.org/viewvc?rev=1187810&view=rev
Log:
Trailing whitespace removal from /modules/bayeux

Modified:
    tomcat/trunk/modules/bayeux/build.xml
    tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Bayeux.java
    tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Channel.java
    tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Client.java
    tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/DataFilter.java
    tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Listener.java
    tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Message.java
    tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/SecurityPolicy.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxException.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxRequest.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxServlet.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/ChannelImpl.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/ClientImpl.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/MessageImpl.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/RequestBase.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/RequestFactory.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/TomcatBayeux.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaConnectRequest.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaDisconnectRequest.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaHandshakeRequest.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaSubscribeRequest.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaUnsubscribeRequest.java
    tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/PublishRequest.java
    tomcat/trunk/modules/bayeux/test/org/apache/cometd/bayeux/samples/BayeuxStockTicker.java
    tomcat/trunk/modules/bayeux/test/org/apache/cometd/bayeux/samples/EchoChatClient.java
    tomcat/trunk/modules/bayeux/webapps/cometd/WEB-INF/web.xml
    tomcat/trunk/modules/bayeux/webapps/cometd/examples/simplechat/ticker.html

Modified: tomcat/trunk/modules/bayeux/build.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/build.xml?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/build.xml (original)
+++ tomcat/trunk/modules/bayeux/build.xml Sat Oct 22 21:29:11 2011
@@ -109,7 +109,7 @@
       <include name="org/apache/tomcat/bayeux/**" />
       <include name="org/apache/cometd/**" />
     </javac>
-    
+
     <!-- Cometd API JAR File -->
     <jar jarfile="${cometd-api.jar}">
       <fileset dir="${tomcat.classes}">
@@ -138,7 +138,7 @@
       <include name="org/apache/tomcat/bayeux/**" />
       <include name="org/apache/cometd/**" />
     </javac>
-    
+
     <!-- Cometd samples JAR File -->
     <jar jarfile="${tomcat-bayeux-samples.jar}">
       <fileset dir="${tomcat.classes}">
@@ -147,7 +147,7 @@
         <include name="org/apache/cometd/bayeux/samples/**" />
       </fileset>
     </jar>
-    
+
     <!-- build samples webapplication /cometd -->
   	<property name="cometd-app" value="${base.path}/cometd"/>
   	<mkdir dir="${cometd-app}"/>
@@ -178,10 +178,10 @@
     <checksum file="${cometd.war}" forceOverwrite="yes" fileext=".md5" />
     <checksum file="${tomcat.extras}/${json-lib.jar}" forceOverwrite="yes" fileext=".md5" />
   	
-  	<!-- print out how to --> 
+  	<!-- print out how to -->
     <echo>You've built the Tomcat Bayeux libraries, simply add the following libraries to your CATALINA_HOME/lib directory:
           ${cometd-api.jar}
-          ${tomcat-bayeux.jar} 
+          ${tomcat-bayeux.jar}
           ${tomcat.extras}/${json-lib.jar}
 To run the sample application, copy the following applications into your CATALINA_BASE/webapps directory
           ${cometd.war}

Modified: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Bayeux.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Bayeux.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Bayeux.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Bayeux.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,12 +40,12 @@ import java.util.List;
  * <br/>
  * A <code>Bayeux session</code> is active as long as the webapp hosting the Bayeux object is active.<br/>
  * When the webapplication shuts down, the Bayeux object will unsubscribe all clients and remove all the active channels.
- * 
+ *
  * @author Greg Wilkins
  * @author Filip Hanik
  */
 public interface Bayeux {
-    
+
     /**Meta definitions for channels*/
     public static final String META="/meta";
     /**Meta definitions for channels*/
@@ -156,14 +156,14 @@ public interface Bayeux {
      * @return Client-null if the client doesn't exist.returns the client if it does.
      */
     public Client getClient(String clientid);
-    
+
     /**
      * Returns a non modifiable list of all the clients that are currently active
      * in this Bayeux session
      * @return List<Client> - a list containing all clients. The List can not be modified.
      */
     public List<Client> getClients();
-    
+
     /**
      * Returns true if a client with the given id exists.<br/>
      * Same as executing <code>getClient(id)!=null</code>.
@@ -171,7 +171,7 @@ public interface Bayeux {
      * @return boolean - true if the client exists
      */
     public boolean hasClient(String clientId);
-    
+
     /**
      * Removes the client all together.
      * This will unsubscribe the client to any channels it may be subscribed to
@@ -181,7 +181,7 @@ public interface Bayeux {
      */
     public Client remove(Client client);
 
-    
+
     /*--Channel---------------------------------------------------------- */
     /**
      * Returns the channel for a given channel id.
@@ -190,11 +190,11 @@ public interface Bayeux {
      * if <code>create</code> is set to false, and the channel doesn't exist, null will be returned.
      * @param channelId String - the id of the channel to be retrieved or created
      * @param create boolean - true if the Bayeux impl should create the channel
-     * @return Channel - null if <code>create</code> is set to false and the channel doesn't exist, 
+     * @return Channel - null if <code>create</code> is set to false and the channel doesn't exist,
      * otherwise it returns a channel object.
      */
     public Channel getChannel(String channelId, boolean create);
-    
+
     /**
      * Returns a list of currently active channels in this Bayeux session.
      * @return List<Channel>
@@ -232,7 +232,7 @@ public interface Bayeux {
      * @return SecurityPolicy
      */
     public SecurityPolicy getSecurityPolicy();
-   
+
     /**
      * Sets the security policy to be used in this Bayeux session
      * @param securityPolicy SecurityPolicy

Modified: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Channel.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Channel.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Channel.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Channel.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,7 +18,7 @@ package org.apache.cometd.bayeux;
 
 import java.util.List;
 
-/** 
+/**
  * A Bayeux Channel represents a channel used to receive messages from and to publish messages to.
  * In order to publish messages to or receive messages from, one must subscribe to the channel.
  * This is easily done by invoking the <code>subscribe</code> method.
@@ -36,15 +36,15 @@ public interface Channel
      */
     public String getId();
 
-    /** 
+    /**
      * Publishes a message to all the subscribers of this channel.
      * The <code>from</code> is contained within the message, by calling
      * <code>msg.getClient()</code>
      * @param data - the message to be published, can not be null.
      */
     public void publish(Message msg);
-    
-    /** 
+
+    /**
      * Publishes more than one message to all the subscribers of this channel.
      * The <code>from</code> is contained within the message, by calling
      * <code>msg[x].getClient()</code>
@@ -52,27 +52,27 @@ public interface Channel
      */
     public void publish(Message[] msgs);
 
-    /** 
+    /**
      * Non persistent channels are removed when the last subscription is
      * removed. Persistent channels survive periods without any subscribers.
      * @return true if the Channel will persist without any subscription.
      */
     public boolean isPersistent();
-    
+
     /**
      * @param persistent true if the Channel will persist without any subscription.
      * @see isPersistent
      */
     public void setPersistent(boolean persistent);
-    
-    /** 
+
+    /**
      * Subscribes a client to a channel.
      * @param subscriber - the client to be subscribed. If the client
      * already is subscribed, this call will not create a duplicate subscription.
      */
     public void subscribe(Client subscriber);
 
-    /** 
+    /**
      * Unsubscribes a client from a channel
      * @param subscriber - the client to be subscribed.
      * @return - returns the client that was unsubscribed, or null if the client wasn't subscribed.
@@ -80,19 +80,19 @@ public interface Channel
     public Client unsubscribe(Client subscriber);
 
     /**
-     * returns a non modifiable list of all the subscribers to this 
+     * returns a non modifiable list of all the subscribers to this
      * channel.
      * @return a list of subscribers
      */
     public List<Client> getSubscribers();
-    
+
     /**
-     * Adds a data filter to this channel. All messages received by this channel 
+     * Adds a data filter to this channel. All messages received by this channel
      * will run through this filter.
      * @param filter Filter
      */
     public void addFilter(DataFilter filter);
-    
+
     /**
      * Removes a filter from this channel.
      * returns the filter that was removed, or null if the filter wasn't in the channel.

Modified: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Client.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Client.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Client.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Client.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,13 +22,13 @@ package org.apache.cometd.bayeux;
 /** A Bayeux Client.
  * <p>
  * A client may subscribe to channels and publish messages to channels.
- * Client instances should not be directly created by uses, but should 
+ * Client instances should not be directly created by uses, but should
  * be obtained via the {@link Bayeux#getClient(String)} or {@link Bayeux#newClient(String, Listener)}
  * methods.
  * </p>
  * <p>
  * Three types of client may be represented by this interface:<nl>
- * <li>The server representation of a remote client connected via HTTP, 
+ * <li>The server representation of a remote client connected via HTTP,
  *     automatically created by the Bayeux server when a connect message comes in</li>
  * <li>A server side client, created by the application using the {@link Bayeux#newClient(String, Listener)} method</li>
  * <li>A java client connected to a remote Bayeux server - not implemented</li>
@@ -46,23 +46,23 @@ public interface Client
 
     /**
      * Returns true if this client is holding messages to be delivered to the remote client.
-     * This method always returns false for local clients, since messages are delivered instantly using the 
+     * This method always returns false for local clients, since messages are delivered instantly using the
      * Listener(callback) object
      * @return boolean
      */
     public boolean hasMessages();
 
-    /** 
+    /**
      * Deliver a message to this client only
-     * Deliver a message directly to the client. The message is not 
+     * Deliver a message directly to the client. The message is not
      * filtered or published to a channel.
      * @param message
      */
     public void deliver(Message message);
 
-    /** 
+    /**
      * Deliver a batch of messages to this client only
-     * Deliver a batch messages directly to the client. The messages are not 
+     * Deliver a batch messages directly to the client. The messages are not
      * filtered or published to a channel.
      * @param message
      */
@@ -70,22 +70,22 @@ public interface Client
 
     /**
      * @return True if the client is local. False if this client is either a remote HTTP client or
-     * a java client to a remote server. 
+     * a java client to a remote server.
      */
     public boolean isLocal();
-    
+
     /**
      * Starts a batch, no messages will be delivered until endBatch is called.
      * Batches can be nested, and messages will only be delivered after
      * the last endBatch has been called.
      */
     public void startBatch();
-    
+
     /**
      * Ends a batch. since batches can be nested, messages will only be delivered
      * after the endBatch has been called as many times as startBatch has.
      */
     public void endBatch();
-    
-    
+
+
 }
\ No newline at end of file

Modified: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/DataFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/DataFilter.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/DataFilter.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/DataFilter.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,10 +16,10 @@
  */
 package org.apache.cometd.bayeux;
 
-/** 
+/**
  * Data Filter<br/>
  * Data filters are used to transform data as it is sent to a Channel.
- * Messages are filtered as the message is published to a channel, invoking the 
+ * Messages are filtered as the message is published to a channel, invoking the
  * {@link Channel#publish(Message)} method.<br/>
  * This method gets invoked in two different scenarios, the first being when a message is received from
  * a remote client, and the Bayeux implementation invokes the publish method directly.

Modified: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Listener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Listener.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Listener.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Listener.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
  */
 package org.apache.cometd.bayeux;
 
-/** 
+/**
  * Cometd Listener interface.<br/>
  * For local clients, in order to receive messages, they pass in a callback object
  * when the local client is created using the {@link Bayeux#newClient(String,Listener)} method.
@@ -33,13 +33,13 @@ public interface Listener
      * false if it was removed explicitly.
      */
     public void removed(boolean timeout);
-    
+
     /**
      * Invoked when a message is delivered to the client.
      * The message contains the message itself, as well as what channel this message came through
      * and who the sender is. If someone invoked {@link Client#deliver(Message)} then the channel reference will
      * be null.
-     * @param msg 
+     * @param msg
      */
     public void deliver(Message[] msg);
 }

Modified: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Message.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Message.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Message.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Message.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,11 +18,11 @@ package org.apache.cometd.bayeux;
 
 import java.util.Map;
 
-/** 
+/**
  * A Bayeux Message<br/>
  * A Bayeux message is a Map of String/Object key value pairs representing the data in the message.
  * The message contains information about the channel it was published through and who the sender was
- * 
+ *
  * @author Greg Wilkins
  * @author Filip Hanik
  */
@@ -43,21 +43,21 @@ public interface Message extends Map<Str
      * @return String
      */
     public String getId();
-    
+
     /**
-     * Sets the time to live in milliseconds. If the message hasn't been delivered 
+     * Sets the time to live in milliseconds. If the message hasn't been delivered
      * when the time passed after the creation time is longer than the TTL the message will
      * expire and removed from any delivery queues.
      * @param ttl long
      */
     public void setTTL(long ttl);
-    
+
     /**
      * Returns the time to live (in milliseconds) for this message
      * @return long
      */
     public long getTTL();
-    
+
     /**
      * returns the timestamp in milliseconds(System.currentTimeMillis()) of when this message was created.
      * @return long

Modified: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/SecurityPolicy.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/SecurityPolicy.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/SecurityPolicy.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/SecurityPolicy.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxException.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxException.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxException.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxException.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
  */
 package org.apache.tomcat.bayeux;
 /**
- * 
+ *
  * @author Filip Hanik
  * @version 1.0
  */

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxRequest.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxRequest.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxRequest.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,7 +19,7 @@ package org.apache.tomcat.bayeux;
 import org.apache.tomcat.bayeux.HttpError;
 
 /**
- * An interface that defines methods for managing Bayeux request meta 
+ * An interface that defines methods for managing Bayeux request meta
  * messages.
  *
  * @author Guy A. Molinari
@@ -33,22 +33,22 @@ public interface BayeuxRequest {
     public static final String JSON_MSG_ARRAY = "org.apache.cometd.bayeux.json_msg_array";
 
     /**
-     * Validates a specific request. 
+     * Validates a specific request.
      * This method must be called prior to process()
      * as a request can do pre processing in the validate method.
      * <br/>
-     * Should the validation fail, an error object is returned 
+     * Should the validation fail, an error object is returned
      * containing an error message, and potentially a stack trace
      * if an exception was generated
      * @return HttpError - null if no error was detected, an HttpError object containing information about the error.
      */
     public HttpError validate();
-    
+
     /**
      * processes a remote client Bayeux message
      * @param prevops - the operation requested by the previous request, in case of chained requests.
      * @return int - returns the interest operation for a CometEvent. Currently not used
-     * @throws BayeuxException - if an error was detected, and the appropriate error response couldn't be delivered to the client. 
+     * @throws BayeuxException - if an error was detected, and the appropriate error response couldn't be delivered to the client.
      */
     public int process(int prevops) throws BayeuxException;
 }

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxServlet.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxServlet.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxServlet.java Sat Oct 22 21:29:11 2011
@@ -34,7 +34,7 @@ import org.json.JSONObject;
 import org.apache.cometd.bayeux.Bayeux;
 
 /**
- * 
+ *
  * @author Filip Hanik
  * @author Guy Molinari
  * @version 1.0
@@ -45,7 +45,7 @@ public class BayeuxServlet implements Co
      * Attribute to hold the TomcatBayeux object in the servlet context
      */
     public static final String TOMCAT_BAYEUX_ATTR = Bayeux.DOJOX_COMETD_BAYEUX;
-    
+
     /**
      * Logger object
      */
@@ -55,14 +55,14 @@ public class BayeuxServlet implements Co
      * Servlet config - for future use
      */
     protected ServletConfig servletConfig;
-    
+
     /**
      * Reference to the global TomcatBayeux object
      */
     protected TomcatBayeux tb;
-    
+
     /**
-     * Upon servlet destruction, the servlet will clean up the 
+     * Upon servlet destruction, the servlet will clean up the
      * TomcatBayeux object and terminate any outstanding events.
      */
     public void destroy() {
@@ -70,9 +70,9 @@ public class BayeuxServlet implements Co
         //to do, close all outstanding comet events
         //tb.destroy();
         tb = null;//TO DO, close everything down
-        
+
     }
-    
+
     /**
      * Returns the preconfigured connection timeout.
      * If no timeout has been configured as a servlet init parameter named <code>timeout</code>
@@ -89,7 +89,7 @@ public class BayeuxServlet implements Co
         }
         return timeout;
     }
-    
+
     protected int getReconnectInterval() {
         String rs = servletConfig.getInitParameter("reconnectInterval");
         int rct = 1000; //1 seconds
@@ -121,12 +121,12 @@ public class BayeuxServlet implements Co
                 tb.remove(cometEvent);
                 cometEvent.close();
             }//end if
-            
+
         }//synchronized
     }//event
 
     /**
-     * 
+     *
      * @param cometEvent CometEvent
      * @return boolean - true if we comet event stays open
      * @throws IOException
@@ -134,7 +134,7 @@ public class BayeuxServlet implements Co
      */
     protected void checkBayeux(CometEvent cometEvent) throws IOException, UnsupportedOperationException {
         //we actually have data.
-        //data can be text/json or 
+        //data can be text/json or
         if (Bayeux.JSON_CONTENT_TYPE.equals(cometEvent.getHttpServletRequest().getContentType())) {
             //read and decode the bytes according to content length
             log.warn("["+Thread.currentThread().getName()+"] JSON encoding not supported, will throw an exception and abort the request.");
@@ -161,7 +161,7 @@ public class BayeuxServlet implements Co
             }
         }
     }
-    
+
     protected int handleBayeux(String message, CometEvent event) throws IOException, ServletException {
         int result = 0;
         if (message==null || message.length()==0) return result;
@@ -171,7 +171,7 @@ public class BayeuxServlet implements Co
             JSONArray jsArray = new JSONArray(message);
             for (int i = 0; i < jsArray.length(); i++) {
                 JSONObject msg = jsArray.getJSONObject(i);
-                
+
                 if (log.isDebugEnabled()) {
                     log.debug("["+Thread.currentThread().getName()+"] Processing bayeux message:"+msg);
                 }
@@ -197,7 +197,7 @@ public class BayeuxServlet implements Co
                     log.debug("["+Thread.currentThread().getName()+"] Done bayeux message, delivered to client");
                 }
             }
-            
+
         }catch (JSONException x) {
             log.error(x);//to do impl error handling
             result = -1;
@@ -217,7 +217,7 @@ public class BayeuxServlet implements Co
     }
 
     public void init(ServletConfig servletConfig) throws ServletException {
-        
+
         this.servletConfig = servletConfig;
         ServletContext ctx = servletConfig.getServletContext();
         if (ctx.getAttribute(TOMCAT_BAYEUX_ATTR)==null)

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/ChannelImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/ChannelImpl.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/ChannelImpl.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/ChannelImpl.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,34 +28,34 @@ import java.util.Iterator;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 /**
- * 
+ *
  * @author Filip Hanik
  * @version 1.0
  */
 public class ChannelImpl implements Channel {
-    
+
     private static final Log log = LogFactory.getLog(ChannelImpl.class);
-    
+
     /**
      * The unique id of this channel
      */
     protected String id = null;
-    
+
     /**
      * A list of the current subscribers
      */
     protected LinkedList<Client> subscribers = new LinkedList<Client>();
-    
+
     /**
      * A list of the current filters
      */
     protected LinkedList<DataFilter> filters = new LinkedList<DataFilter>();
-    
+
     /**
      * Is this channel persistent, default value is true
      */
-    protected boolean persistent = true; 
-    
+    protected boolean persistent = true;
+
     /**
      * Creates a new channel
      * @param id String - the id of the channel, can not be null
@@ -72,7 +72,7 @@ public class ChannelImpl implements Chan
     public String getId() {
         return id;
     }
-    
+
     /**
      * Returns true if this channel matches the pattern to its id.
      * The channel pattern can be a complete name like <code>/service/mychannel</code>
@@ -92,7 +92,7 @@ public class ChannelImpl implements Chan
         String leadSubstring = pattern.substring(0, wildcardPos);
         if (leadSubstring == null)
             return false;
-        if (multiSegment) 
+        if (multiSegment)
             return getId().startsWith(leadSubstring);
         else {
             if (getId().length() <= wildcardPos + 2)
@@ -116,7 +116,7 @@ public class ChannelImpl implements Chan
     public boolean isPersistent() {
         return persistent;
     }
-    
+
     public void publish(Message msg) {
         publish(new Message[] {msg});
     }
@@ -127,7 +127,7 @@ public class ChannelImpl implements Chan
         for (int i=0; msgs!=null && i<msgs.length; i++) {
             Message data = msgs[i];
 
-            if (!(data instanceof MessageImpl)) 
+            if (!(data instanceof MessageImpl))
                 throw new IllegalArgumentException("Invalid message class, you can only publish messages "+
                                                    "created through the Bayeux.newMessage() method");
             if (log.isDebugEnabled()) {
@@ -148,7 +148,7 @@ public class ChannelImpl implements Chan
             ClientImpl c = (ClientImpl)it.next();
             c.deliverInternal(this,imsgs);
         }
-        
+
     }
 
     public void setPersistent(boolean persistent) {
@@ -156,7 +156,7 @@ public class ChannelImpl implements Chan
     }
 
     public void subscribe(Client subscriber) {
-        if (!subscribers.contains((subscriber))) { 
+        if (!subscribers.contains((subscriber))) {
             subscribers.addLast(subscriber);
             ((ClientImpl)subscriber).subscribed(this);
         }
@@ -169,9 +169,9 @@ public class ChannelImpl implements Chan
         } else
             return null;
     }
-    
+
     public void addFilter(DataFilter filter) {
-        if (!filters.contains(filter)) 
+        if (!filters.contains(filter))
             filters.addLast(filter);
     }
 
@@ -179,7 +179,7 @@ public class ChannelImpl implements Chan
         if ( filters.remove(filter) ) return filter;
         else return null;
     }
-    
+
     public String toString() {
         StringBuilder buf = new StringBuilder(super.toString());
         buf.append("; channelId=").append(getId());

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/ClientImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/ClientImpl.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/ClientImpl.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/ClientImpl.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,12 +35,12 @@ import java.util.HashMap;
 import java.util.ArrayList;
 
 public class ClientImpl implements Client {
-    
+
     public static final int SUPPORT_CALLBACK_POLL = 0x1;
-    public static final int SUPPORT_LONG_POLL = 0x2; 
+    public static final int SUPPORT_LONG_POLL = 0x2;
 
     public static final String COMET_EVENT_ATTR = "org.apache.cometd.bayeux.client";
-    
+
     private static final Log log = LogFactory.getLog(ClientImpl.class);
 
     protected static LinkedList<Message> EMPTY_LIST = new LinkedList<Message>();
@@ -48,50 +48,50 @@ public class ClientImpl implements Clien
      * queued message for remote clients.
      */
     protected LinkedList<Message> messages = null;
-    
+
     /**
-     * 
+     *
      */
     protected Queue<CometEvent> events = new LinkedList<CometEvent>();
-    
+
     /**
      * Unique id representing this client
      */
     protected String id;
-    
+
     /**
      * supported connection types, defaults to long-polling
      */
     protected int supportedConnTypes = SUPPORT_LONG_POLL | SUPPORT_CALLBACK_POLL;
-    
+
     /**
      * The desired connection type
      */
     protected int desirectConnType = SUPPORT_LONG_POLL;
-    
+
     /**
      * Does this client use json-comment-filtered messages
      */
     protected boolean useJsonFiltered = false;
-    
+
     /**
      * Same JVM clients, get local=true
      */
     protected boolean local;
-    
+
     /**
      * The callback object for local clients
      */
     protected Listener listener;
-    
+
     protected AtomicInteger nrofsubscriptions = new AtomicInteger(0);
-    
+
     protected ClientImpl(String id, boolean local) {
         this.id = id;
         this.local = local;
         if (!local) messages = new LinkedList<Message>();
     }
-    
+
     protected ClientImpl(String id, CometEvent event) {
         this(id,false);
         events = new ConcurrentLinkedQueue<CometEvent>();
@@ -101,7 +101,7 @@ public class ClientImpl implements Clien
     public synchronized void deliver(Message message) {
         deliverInternal(null,new MessageImpl[] {(MessageImpl)message});
     }
-    
+
     public synchronized void deliver(Message[] message) {
         deliverInternal(null,message);
     }
@@ -124,7 +124,7 @@ public class ClientImpl implements Clien
         } else {
             for (int i=0; msgs!=null && i<msgs.length; i++) {
                 MessageImpl message = (MessageImpl)msgs[i];
-                if (this==message.getClient()) { 
+                if (this==message.getClient()) {
                     //dont deliver to ourself
                     continue;
                 }
@@ -159,7 +159,7 @@ public class ClientImpl implements Clien
                             }
                         }
                     }
-                } 
+                }
                 if (!delivered) {
                     if (log.isDebugEnabled()) {
                         log.debug("Message added to queue for remote client["+this+"] message:"+message);
@@ -233,17 +233,17 @@ public class ClientImpl implements Clien
         messages.clear();
         return result;
     }
-    
+
     public String toString() {
         StringBuilder buf = new StringBuilder(super.toString());
         buf.append(" id=").append(getId());
         return buf.toString();
     }
-    
+
     public boolean isSubscribed() {
         return nrofsubscriptions.get()>0;
     }
-    
+
     protected synchronized boolean addCometEvent(CometEvent event) {
         boolean result = false;
         if (!events.contains(event)) {
@@ -253,27 +253,27 @@ public class ClientImpl implements Clien
         event.getHttpServletRequest().setAttribute(COMET_EVENT_ATTR,this);
         return result;
     }
-    
+
     protected synchronized boolean removeCometEvent(CometEvent event) {
         boolean result = events.remove(event);
         event.getHttpServletRequest().removeAttribute(COMET_EVENT_ATTR);
         return result;
     }
-    
-    
+
+
     protected void subscribed(ChannelImpl ch) {
         nrofsubscriptions.addAndGet(1);
     }
-    
+
     protected void unsubscribed(ChannelImpl ch) {
         nrofsubscriptions.addAndGet(-1);
     }
-    
+
     public void startBatch(){
         //noop until improved
     }
     public void endBatch() {
         //noop until improved
     }
-        
+
 }

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/MessageImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/MessageImpl.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/MessageImpl.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/MessageImpl.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,7 +23,7 @@ import org.apache.cometd.bayeux.Client;
 import org.apache.cometd.bayeux.Message;
 
 public class MessageImpl extends HashMap<String,Object> implements Message {
-    
+
     protected Channel channel;
     protected Client client;
     protected String id;

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/RequestBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/RequestBase.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/RequestBase.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/RequestBase.java Sat Oct 22 21:29:11 2011
@@ -48,7 +48,7 @@ import org.apache.cometd.bayeux.Message;
  *
  */
 public abstract class RequestBase implements BayeuxRequest {
-    
+
     protected static final SimpleDateFormat timestampFmt =
         new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
     static {
@@ -69,15 +69,15 @@ public abstract class RequestBase implem
     protected String conType = null;
     protected LinkedHashMap<String, Object> ext = new LinkedHashMap<String, Object> ();
 
-    
+
     protected CometEvent event;
-    
+
     protected HashMap<String, Object> response = null;
-    
+
     private static final Log log = LogFactory.getLog(RequestBase.class);
-    
+
     protected int reconnectInterval = 1000;
-    
+
     protected RequestBase(TomcatBayeux tb, CometEvent event, JSONObject jsReq) throws JSONException {
         this.tomcatBayeux = tb;
         this.event = event;
@@ -97,7 +97,7 @@ public abstract class RequestBase implem
                 ext.put(key, jext.get(key));
             }//for
         }//end if
-        
+
         if (jsReq.has(Bayeux.SUPP_CONNECTION_TYPE_FIELD)) {
             JSONArray types = jsReq.getJSONArray(Bayeux.SUPP_CONNECTION_TYPE_FIELD);
             suppConnTypes = new String[types.length()];
@@ -116,7 +116,7 @@ public abstract class RequestBase implem
             else if (Bayeux.TRANSPORT_LONG_POLL.equals(conType))
                 desiredConnTypeFlag = ClientImpl.SUPPORT_LONG_POLL;
         }//end if
-        
+
         //due to the fact that the javascript doesn't send up a required field
         //we have to fake it
         suppConnTypesFlag = ClientImpl.SUPPORT_CALLBACK_POLL | ClientImpl.SUPPORT_LONG_POLL;
@@ -154,7 +154,7 @@ public abstract class RequestBase implem
     public CometEvent getEvent() {
         return event;
     }
-    
+
     protected static void deliver(CometEvent event, ClientImpl to) throws IOException, ServletException, BayeuxException {
         JSONArray jarray = getJSONArray(event,true);
         if ( jarray == null ) throw new BayeuxException("No message to send!");
@@ -194,11 +194,11 @@ public abstract class RequestBase implem
                 out.print("*/");
         } else if ( (to.getDesirectConnType() == 0 && to.supportsCallbackPoll()) || to.getDesirectConnType() == ClientImpl.SUPPORT_CALLBACK_POLL) {
             out.print(");");
-        } 
+        }
         out.flush();
         event.getHttpServletResponse().flushBuffer();
 
-        
+
     }
 
     protected static JSONArray getJSONArray(CometEvent event, boolean nullok) {
@@ -221,7 +221,7 @@ public abstract class RequestBase implem
             getJSONArray().put(msg);
         }
     }
-    
+
     protected void flushMessages(ClientImpl client) throws BayeuxException {
         List<Message> msgs = client.takeMessages();
         synchronized (event) {
@@ -242,12 +242,12 @@ public abstract class RequestBase implem
             }
         }
     }
-    
+
     public int process(int prevops) throws BayeuxException {
         event.getHttpServletRequest().setAttribute(CURRENT_REQ_ATTR,this);
         return prevops;
     }
-    
+
     public int getReconnectInterval() {
         return reconnectInterval;
     }

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/RequestFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/RequestFactory.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/RequestFactory.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/RequestFactory.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/TomcatBayeux.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/TomcatBayeux.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/TomcatBayeux.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/TomcatBayeux.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,24 +30,24 @@ import org.apache.cometd.bayeux.Listener
 import org.apache.cometd.bayeux.Message;
 import org.apache.cometd.bayeux.SecurityPolicy;
 /**
- * 
+ *
  * @author Filip Hanik
  * @version 1.0
  */
 public class TomcatBayeux implements Bayeux {
-    
+
 
     protected int reconnectInterval = 5000;
     /**
      * a list of all active clients
      */
     protected HashMap<String,Client> clients = new HashMap<String,Client>();
-    
+
     /**
      * a list of all active channels
      */
     protected LinkedHashMap<String, Channel> channels = new LinkedHashMap<String,Channel>();
-    
+
     /**
      * security policy to be used.
      */
@@ -56,7 +56,7 @@ public class TomcatBayeux implements Bay
      * default client to use when we need to send an error message but don't have a client valid reference
      */
     protected static ClientImpl errorClient = new ClientImpl("error-no-client",false);
-    
+
     /**
      * returns the default error client
      * @return ClientImpl
@@ -64,10 +64,10 @@ public class TomcatBayeux implements Bay
     public static ClientImpl getErrorClient() {
         return errorClient;
     }
-    
+
     protected TomcatBayeux() {
     }
-    
+
     /**
      * should be invoked when the servlet is destroyed or when the context shuts down
      */
@@ -83,11 +83,11 @@ public class TomcatBayeux implements Bay
         }
         return result;
     }
-    
+
     public Channel remove(Channel channel) {
         return channels.remove(channel.getId());
     }
-    
+
     public Client remove(Client client) {
         if (client==null) return null;
         for (Channel ch : getChannels()) {
@@ -99,11 +99,11 @@ public class TomcatBayeux implements Bay
     public Client getClient(String clientId) {
         return clients.get(clientId);
     }
-    
+
     public boolean hasClient(String clientId) {
         return clients.containsKey(clientId);
     }
-    
+
     public List<Client> getClients() {
         return java.util.Arrays.asList(clients.values().toArray(new Client[0]));
     }
@@ -112,7 +112,7 @@ public class TomcatBayeux implements Bay
         return securityPolicy;
     }
 
-    public int getReconnectInterval() { 
+    public int getReconnectInterval() {
         return reconnectInterval;
     }
 
@@ -134,11 +134,11 @@ public class TomcatBayeux implements Bay
         //the JVM, this is a local client
         return newClient(idprefix,listener,true, null);
     }
-    
+
     protected ClientImpl getClientImpl(CometEvent event) {
         return (ClientImpl)event.getHttpServletRequest().getAttribute(ClientImpl.COMET_EVENT_ATTR);
     }
-    
+
     protected void remove(CometEvent event) {
         ClientImpl client = getClientImpl(event);
         if (client!=null) {
@@ -150,7 +150,7 @@ public class TomcatBayeux implements Bay
         if (idprefix==null) idprefix="";
         return idprefix + Arrays.toString(UUIDGenerator.randomUUID(false));
     }
-    
+
     public List<Channel> getChannels() {
         return java.util.Arrays.asList(channels.entrySet().toArray(new Channel[0]));
     }

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaConnectRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaConnectRequest.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaConnectRequest.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaConnectRequest.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -64,7 +64,7 @@ public class MetaConnectRequest extends 
      *  2) The clientId returned by the server after handshake.
      *  3) The desired connectionType (must be one of the server's supported
      *     types returned by handshake response.
-     *  
+     *
      * @return HttpError This method returns null if no errors were found
      */
     public HttpError validate() {
@@ -108,13 +108,13 @@ public class MetaConnectRequest extends 
         } catch (IOException x) {
             throw new BayeuxException(x);
         }
-        
+
         //return immediately if there is no subscriptions
         //so that we can process the next message
-        int result = client.isSubscribed()?1:0; 
+        int result = client.isSubscribed()?1:0;
 
         if (success && client!=null && client.hasMessages()) {
-            //send out messages 
+            //send out messages
             flushMessages(client);
             result = 0; //flush out the messages
         }

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaDisconnectRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaDisconnectRequest.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaDisconnectRequest.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaDisconnectRequest.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -61,7 +61,7 @@ public class MetaDisconnectRequest exten
      * Per section 4.4.1 of the Bayuex spec a connect request must contain:
      *  1) The "/meta/disconnect" channel identifier.
      *  2) The clientId.
-     *  
+     *
      * @return HttpError This method returns null if no errors were found
      */
     public HttpError validate() {

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaHandshakeRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaHandshakeRequest.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaHandshakeRequest.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaHandshakeRequest.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -42,7 +42,7 @@ import org.apache.tomcat.bayeux.*;
 public class MetaHandshakeRequest extends RequestBase implements BayeuxRequest {
 
     protected static HashMap<String,Object> responseTemplate = new HashMap<String,Object>();
-    
+
     static {
         responseTemplate.put(Bayeux.CHANNEL_FIELD,Bayeux.META_HANDSHAKE);
         responseTemplate.put(Bayeux.VERSION_FIELD,"1.0");
@@ -54,7 +54,7 @@ public class MetaHandshakeRequest extend
     public MetaHandshakeRequest(TomcatBayeux tomcatBayeux, CometEvent event, JSONObject jsReq) throws JSONException {
         super(tomcatBayeux, event, jsReq);
     }
-    
+
 
     public String getVersion() { return version; }
     public String getMinimumVersion() { return minVersion; }
@@ -67,7 +67,7 @@ public class MetaHandshakeRequest extend
      *  1) The "/meta/handshake" channel identifier.
      *  2) The version of the protocol supported by the client
      *  3) The client's supported connection types.
-     *  
+     *
      * @return HttpError This method returns null if no errors were found
      */
     public HttpError validate() {

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaSubscribeRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaSubscribeRequest.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaSubscribeRequest.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaSubscribeRequest.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -65,7 +65,7 @@ public class MetaSubscribeRequest extend
      *  2) The clientId.
      *  3) The subscription.  This is the name of the channel of interest,
      *     or a pattern.
-     *  
+     *
      * @return HttpError This method returns null if no errors were found
      */
     public HttpError validate() {

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaUnsubscribeRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaUnsubscribeRequest.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaUnsubscribeRequest.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaUnsubscribeRequest.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -66,7 +66,7 @@ public class MetaUnsubscribeRequest exte
      *  2) The clientId.
      *  3) The subscription.  This is the name of the channel of interest,
      *     or a pattern.
-     *  
+     *
      * @return HttpError This method returns null if no errors were found
      */
     public HttpError validate() {

Modified: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/PublishRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/PublishRequest.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/PublishRequest.java (original)
+++ tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/PublishRequest.java Sat Oct 22 21:29:11 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,7 +45,7 @@ import org.apache.juli.logging.LogFactor
 public class PublishRequest extends RequestBase {
 
     private static final Log log = LogFactory.getLog(PublishRequest.class);
-    
+
     protected static HashMap<String,Object> responseTemplate = new HashMap<String,Object>();
 
     static {
@@ -66,7 +66,7 @@ public class PublishRequest extends Requ
      * Per section 5.1.1 of the Bayuex spec a connect request must contain:
      *  1) The channel identifier of the channel for publication.
      *  2) The data to send.
-     *  
+     *
      * @return HttpError This method returns null if no errors were found
      */
     @Override
@@ -99,7 +99,7 @@ public class PublishRequest extends Requ
         if (error == null) {
             ChannelImpl chimpl = (ChannelImpl)getTomcatBayeux().getChannel(channel,false);
             MessageImpl mimpl = (MessageImpl)getTomcatBayeux().newMessage(client);
-            
+
             try {
                 String[] keys = JSONObject.getNames(msgData);
                 for (int i = 0; i < keys.length; i++) {
@@ -130,9 +130,9 @@ public class PublishRequest extends Requ
         } catch (IOException x) {
             throw new BayeuxException(x);
         }
-        
+
         if (success && client!=null && client.hasMessages()) {
-            //send out messages 
+            //send out messages
             flushMessages(client);
         }
 

Modified: tomcat/trunk/modules/bayeux/test/org/apache/cometd/bayeux/samples/BayeuxStockTicker.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/test/org/apache/cometd/bayeux/samples/BayeuxStockTicker.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/test/org/apache/cometd/bayeux/samples/BayeuxStockTicker.java (original)
+++ tomcat/trunk/modules/bayeux/test/org/apache/cometd/bayeux/samples/BayeuxStockTicker.java Sat Oct 22 21:29:11 2011
@@ -103,15 +103,15 @@ public class BayeuxStockTicker implement
 
         public void run() {
             try {
-                
-                Stock[] stocks = new Stock[] { 
+
+                Stock[] stocks = new Stock[] {
                         new Stock("GOOG", 435.43),
-                        new Stock("YHOO", 27.88), 
+                        new Stock("YHOO", 27.88),
                         new Stock("ASF", 1015.55), };
                 for (Stock s : stocks) {
                     Channel ch = b.getChannel("/stock/"+s.getSymbol(), true);
                     ch.subscribe(c);
-                    
+
                 }
                 Random r = new Random(System.currentTimeMillis());
                 while (run) {
@@ -207,7 +207,7 @@ public class BayeuxStockTicker implement
                 return false;
             }
         }
-        
+
         public String toString(){
             StringBuilder buf = new StringBuilder("STOCK#");
             buf.append(getSymbol());
@@ -218,7 +218,7 @@ public class BayeuxStockTicker implement
             buf.append("#");
             buf.append(String.valueOf(getCnt()));
             return buf.toString();
-         
+
         }
 
         public Object clone() {

Modified: tomcat/trunk/modules/bayeux/test/org/apache/cometd/bayeux/samples/EchoChatClient.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/test/org/apache/cometd/bayeux/samples/EchoChatClient.java?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/test/org/apache/cometd/bayeux/samples/EchoChatClient.java (original)
+++ tomcat/trunk/modules/bayeux/test/org/apache/cometd/bayeux/samples/EchoChatClient.java Sat Oct 22 21:29:11 2011
@@ -29,7 +29,7 @@ import org.apache.cometd.bayeux.Message;
 import org.apache.cometd.bayeux.Channel;
 
 public class EchoChatClient implements ServletContextListener, ServletContextAttributeListener, Listener {
-    
+
     static AtomicInteger counter = new AtomicInteger(0);
     protected int id;
     protected Bayeux b;
@@ -93,7 +93,7 @@ public class EchoChatClient implements S
         public TimestampThread() {
             setDaemon(true);
         }
-        
+
         public void run() {
             while (alive) {
                 try {

Modified: tomcat/trunk/modules/bayeux/webapps/cometd/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/webapps/cometd/WEB-INF/web.xml?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/webapps/cometd/WEB-INF/web.xml (original)
+++ tomcat/trunk/modules/bayeux/webapps/cometd/WEB-INF/web.xml Sat Oct 22 21:29:11 2011
@@ -15,13 +15,13 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<web-app 
-   xmlns="http://java.sun.com/xml/ns/javaee" 
+<web-app
+   xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
-   version="2.5"> 
+   version="2.5">
   <display-name>Cometd Test WebApp</display-name>
-  
+
   <servlet>
     <servlet-name>cometd</servlet-name>
     <servlet-class>org.apache.tomcat.bayeux.BayeuxServlet</servlet-class>
@@ -40,14 +40,14 @@
     <servlet-name>cometd</servlet-name>
     <url-pattern>/cometd/*</url-pattern>
   </servlet-mapping>
-  
+
   <listener>
     <listener-class>org.apache.cometd.bayeux.samples.EchoChatClient</listener-class>
   </listener>
   <listener>
     <listener-class>org.apache.cometd.bayeux.samples.BayeuxStockTicker</listener-class>
   </listener>
-  
+
 </web-app>
 
 

Modified: tomcat/trunk/modules/bayeux/webapps/cometd/examples/simplechat/ticker.html
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/webapps/cometd/examples/simplechat/ticker.html?rev=1187810&r1=1187809&r2=1187810&view=diff
==============================================================================
--- tomcat/trunk/modules/bayeux/webapps/cometd/examples/simplechat/ticker.html (original)
+++ tomcat/trunk/modules/bayeux/webapps/cometd/examples/simplechat/ticker.html Sat Oct 22 21:29:11 2011
@@ -90,14 +90,14 @@ function onMsgEvent(event) {
    pricenode.appendChild(pricelabel);
    changenode.appendChild(changelabel);
 
-   var table = dojo.byId("stocktable");  
-   var rows = table.getElementsByTagName("tr");  
+   var table = dojo.byId("stocktable");
+   var rows = table.getElementsByTagName("tr");
    for(i = 0; i < rows.length; i++){
 	   if (rows[i].bgColor != "gray") {
-	       rows[i].bgColor = "white"; 
+	       rows[i].bgColor = "white";
 	   }
-   }          
-   //manipulate rows 
+   }
+   //manipulate rows
    var rowCurrent = dojo.byId("row."+symbol);
    if (pricechange<=0) {
        rowCurrent.bgColor = "red";



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message