You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2008/12/05 16:57:46 UTC
svn commit: r723775 [1/5] - in /tomcat/trunk: java/org/apache/juli/
modules/bayeux/ modules/bayeux/java/org/apache/cometd/bayeux/
modules/bayeux/java/org/apache/tomcat/bayeux/
modules/bayeux/java/org/apache/tomcat/bayeux/request/
modules/bayeux/test/or...
Author: markt
Date: Fri Dec 5 07:57:43 2008
New Revision: 723775
URL: http://svn.apache.org/viewvc?rev=723775&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46247
svn property patches for trunk
Patch provided be sebb at a.o
Modified:
tomcat/trunk/java/org/apache/juli/AsyncFileHandler.java (props changed)
tomcat/trunk/modules/bayeux/build.xml (props changed)
tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Bayeux.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Channel.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Client.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/DataFilter.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Listener.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Message.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/SecurityPolicy.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxException.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxRequest.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxServlet.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/ChannelImpl.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/ClientImpl.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/HttpError.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/MessageImpl.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/RequestBase.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/RequestFactory.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/TomcatBayeux.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaConnectRequest.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaDisconnectRequest.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaHandshakeRequest.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaSubscribeRequest.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/MetaUnsubscribeRequest.java (contents, props changed)
tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/request/PublishRequest.java (contents, props changed)
tomcat/trunk/modules/bayeux/test/org/apache/cometd/bayeux/samples/BayeuxStockTicker.java (contents, props changed)
tomcat/trunk/modules/bayeux/test/org/apache/cometd/bayeux/samples/EchoChatClient.java (contents, props changed)
tomcat/trunk/modules/bayeux/webapps/cometd/WEB-INF/web.xml (contents, props changed)
tomcat/trunk/modules/bayeux/webapps/cometd/examples/simplechat/ticker.html (contents, props changed)
tomcat/trunk/modules/bayeux/webapps/cometd/index.html (contents, props changed)
tomcat/trunk/modules/jdbc-pool/doc/changelog.xml (props changed)
tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/AbstractCreateStatementInterceptor.java (props changed)
tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/ConnectionState.java (contents, props changed)
tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java (contents, props changed)
tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java (props changed)
tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/BorrowWaitTest.java (props changed)
tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/SimplePOJOExample.java (props changed)
tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/StatementFinalizerTest.java (props changed)
tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestConnectionState.java (props changed)
tomcat/trunk/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TwoDataSources.java (props changed)
tomcat/trunk/res/META-INF/LICENSE (contents, props changed)
tomcat/trunk/res/META-INF/NOTICE (contents, props changed)
tomcat/trunk/res/procrun/amd64/tomcat6.exe (props changed)
tomcat/trunk/res/procrun/amd64/tomcat6w.exe (props changed)
tomcat/trunk/res/procrun/ia64/tomcat6.exe (props changed)
tomcat/trunk/res/procrun/ia64/tomcat6w.exe (props changed)
tomcat/trunk/res/procrun/tomcat6.exe (props changed)
tomcat/trunk/res/procrun/tomcat6w.exe (props changed)
Propchange: tomcat/trunk/java/org/apache/juli/AsyncFileHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tomcat/trunk/modules/bayeux/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
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=723775&r1=723774&r2=723775&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 Fri Dec 5 07:57:43 2008
@@ -1,242 +1,242 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cometd.bayeux;
-
-import java.util.List;
-
-/** Bayeux Interface.<br/>
- * This interface represents the server side API for the Bayeux messaging protocol.
- * Bayeux is a simple subscribe/publish/receive methodology, not far from JMS, but much simplified.<br/>
- * It is used both by the actual implementation and by server side clients.<br/>
- * Server side clients use this to create, retrieve and subscribe to channels.
- * Server side clients are represented, just like remote clients, through the Client interface.
- * <br/>
- * The Bayeux implementations is intended to be thread safe and multiple threads may simultaneously call Bayeux methods.
- * <br/>
- * The Bayeux object, is the starting point for any cometd application relying on the Bayeux object.
- * Dependent on the container, the Bayeux object will be stored in the <code>javax.servlet.ServletContext</code> object
- * as an attribute under the name <code>Bayeux.DOJOX_COMETD_BAYEUX</code><br/>
- * To retrieve this object, one would simply call<br/>
- * <code>Bayeux bx = (Bayeux)getServletContext().getAttribute(Bayeux.DOJOX_COMETD_BAYEUX);
- * <br/><br/>
- * The Bayeux protocol is pretty straight forward and includes a bunch of messaging that is not needed to be known to clients,
- * both server side and remote clients.
- * This object gets initialized by a container dependent servlet, and the servlet then handles all Bayeux communication from the client.
- * Remote messsages are delivered to channels, and to server side clients using the <code>Listener</code> interface.<br/>
- * <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*/
- public static final String META_SLASH="/meta/";
- /**Meta definitions for channels - connect message*/
- public static final String META_CONNECT="/meta/connect";
- /**Meta definitions for channels - client messsage*/
- public static final String META_CLIENT="/meta/client";
- /**Meta definitions for channels - disconnect messsage*/
- public static final String META_DISCONNECT="/meta/disconnect";
- /**Meta definitions for channels - handshake messsage*/
- public static final String META_HANDSHAKE="/meta/handshake";
- /**Meta definitions for channels - ping messsage*/
- public static final String META_PING="/meta/ping";
- /**Meta definitions for channels - reconnect messsage
- * @deprecated
- */
- public static final String META_RECONNECT="/meta/reconnect";
- /**Meta definitions for channels - status messsage*/
- public static final String META_STATUS="/meta/status";
- /**Meta definitions for channels - subscribe messsage*/
- public static final String META_SUBSCRIBE="/meta/subscribe";
- /**Meta definitions for channels - unsubscribe messsage*/
- public static final String META_UNSUBSCRIBE="/meta/unsubscribe";
- /*Field names inside Bayeux messages*/
- /**Field names inside Bayeux messages - clientId field*/
- public static final String CLIENT_FIELD="clientId";
- /**Field names inside Bayeux messages - data field*/
- public static final String DATA_FIELD="data";
- /**Field names inside Bayeux messages - channel field*/
- public static final String CHANNEL_FIELD="channel";
- /**Field names inside Bayeux messages - id field*/
- public static final String ID_FIELD="id";
- /**Field names inside Bayeux messages - error field*/
- public static final String ERROR_FIELD="error";
- /**Field names inside Bayeux messages - timestamp field*/
- public static final String TIMESTAMP_FIELD="timestamp";
- /**Field names inside Bayeux messages - transport field*/
- public static final String TRANSPORT_FIELD="transport";
- /**Field names inside Bayeux messages - advice field*/
- public static final String ADVICE_FIELD="advice";
- /**Field names inside Bayeux messages - successful field*/
- public static final String SUCCESSFUL_FIELD="successful";
- /**Field names inside Bayeux messages - subscription field*/
- public static final String SUBSCRIPTION_FIELD="subscription";
- /**Field names inside Bayeux messages - ext field*/
- public static final String EXT_FIELD="ext";
- /**Field names inside Bayeux messages - connectionType field*/
- public static final String CONNECTION_TYPE_FIELD="connectionType";
- /**Field names inside Bayeux messages - version field*/
- public static final String VERSION_FIELD="version";
- /**Field names inside Bayeux messages - minimumVersion field*/
- public static final String MIN_VERSION_FIELD="minimumVersion";
- /**Field names inside Bayeux messages - supportedConnectionTypes field*/
- public static final String SUPP_CONNECTION_TYPE_FIELD="supportedConnectionTypes";
- /**Field names inside Bayeux messages - json-comment-filtered field*/
- public static final String JSON_COMMENT_FILTERED_FIELD="json-comment-filtered";
- /**Field names inside Bayeux messages - reconnect field*/
- public static final String RECONNECT_FIELD = "reconnect";
- /**Field names inside Bayeux messages - interval field*/
- public static final String INTERVAL_FIELD = "interval";
- /**Field values inside Bayeux messages - retry response*/
- public static final String RETRY_RESPONSE = "retry";
- /**Field values inside Bayeux messages - handshake response*/
- public static final String HANDSHAKE_RESPONSE = "handshake";
- /**Field values inside Bayeux messages - none response*/
- public static final String NONE_RESPONSE = "none";
- /**Service channel names-starts with*/
- public static final String SERVICE="/service";
- /**Service channel names-trailing slash*/
- public static final String SERVICE_SLASH="/service/";
- /*Transport types*/
- /**Transport types - long polling*/
- public static final String TRANSPORT_LONG_POLL="long-polling";
- /**Transport types - callback polling*/
- public static final String TRANSPORT_CALLBACK_POLL="callback-polling";
- /**Transport types - iframe*/
- public static final String TRANSPORT_IFRAME="iframe";
- /**Transport types - flash*/
- public static final String TRANSPORT_FLASH="flash";
- /** ServletContext attribute name used to obtain the Bayeux object */
- public static final String DOJOX_COMETD_BAYEUX="dojox.cometd.bayeux";
- /*http field names*/
- /**http helpers - text/json content type*/
- public static final String JSON_CONTENT_TYPE="text/json";
- /**http helpers - parameter name for json message*/
- public static final String MESSAGE_PARAMETER="message";
- /**http helpers - name of the jsonp parameter*/
- public static final String JSONP_PARAMETER="jsonp";
- /**http helpers - default name of the jsonp callback function*/
- public static final String JSONP_DEFAULT_NAME="jsonpcallback";
-
- /*--Client----------------------------------------------------------- */
- /**
- * Creates a new server side client. This method is to be invoked
- * by server side objects only. You cannot create a remote client by using this method.
- * A client represents an entity that can subscribe to channels and publish and receive messages
- * through these channels
- * @param idprefix String - the prefix string for the id generated, can be null
- * @param listener Listener - a callback object to be called when messages are to be delivered to the new client
- * @return Client - returns an implementation of the client interface.
- */
- public Client newClient(String idprefix, Listener listener);
-
- /**
- * retrieve a client based on an ID. Will return null if the client doesn't exist.
- * @param clientid String
- * @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>.
- * @param clientId String
- * @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
- * and remove it from the list.
- * @param client Client
- * @return Client - returns the client that was removed, or null if no client was removed.
- */
- public Client remove(Client client);
-
-
- /*--Channel---------------------------------------------------------- */
- /**
- * Returns the channel for a given channel id.
- * If the channel doesn't exist, and the <code>create</code> parameter is set to true,
- * the channel will be created and added to the list of active channels.<br/>
- * 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,
- * 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>
- */
- public List<Channel> getChannels();
-
- /**
- * Removes a channel from the Bayeux object.
- * This will also unsubscribe all the clients currently subscribed to the
- * the channel.
- * @param channel Channel - the channel to be removed
- * @return Channel - returns the channel that was removed, or null if no channel was removed.
- */
- public Channel remove(Channel channel);
-
- /**
- * returns true if a channel with the given channelId exists.
- * <br/>Same as executing <code>Bayeux.getChannel(channelId,false)!=null</code>
- * @param channelId String
- * @return boolean - true if the channel exists.
- */
- public boolean hasChannel(String channelId);
-
- /* --Message---------------------------------------------------------- */
- /**
- * Creates a new message to be sent by a server side client.
- * @return Message - returns a new Message object, that has a unique id.
- */
- public Message newMessage(Client from);
-
-
- /*--Security policy----------------------------------------------------------- */
- /**
- * Returns the security policy associated with this Bayeux session
- * @return SecurityPolicy
- */
- public SecurityPolicy getSecurityPolicy();
-
- /**
- * Sets the security policy to be used in this Bayeux session
- * @param securityPolicy SecurityPolicy
- */
- public void setSecurityPolicy(SecurityPolicy securityPolicy);
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cometd.bayeux;
+
+import java.util.List;
+
+/** Bayeux Interface.<br/>
+ * This interface represents the server side API for the Bayeux messaging protocol.
+ * Bayeux is a simple subscribe/publish/receive methodology, not far from JMS, but much simplified.<br/>
+ * It is used both by the actual implementation and by server side clients.<br/>
+ * Server side clients use this to create, retrieve and subscribe to channels.
+ * Server side clients are represented, just like remote clients, through the Client interface.
+ * <br/>
+ * The Bayeux implementations is intended to be thread safe and multiple threads may simultaneously call Bayeux methods.
+ * <br/>
+ * The Bayeux object, is the starting point for any cometd application relying on the Bayeux object.
+ * Dependent on the container, the Bayeux object will be stored in the <code>javax.servlet.ServletContext</code> object
+ * as an attribute under the name <code>Bayeux.DOJOX_COMETD_BAYEUX</code><br/>
+ * To retrieve this object, one would simply call<br/>
+ * <code>Bayeux bx = (Bayeux)getServletContext().getAttribute(Bayeux.DOJOX_COMETD_BAYEUX);
+ * <br/><br/>
+ * The Bayeux protocol is pretty straight forward and includes a bunch of messaging that is not needed to be known to clients,
+ * both server side and remote clients.
+ * This object gets initialized by a container dependent servlet, and the servlet then handles all Bayeux communication from the client.
+ * Remote messsages are delivered to channels, and to server side clients using the <code>Listener</code> interface.<br/>
+ * <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*/
+ public static final String META_SLASH="/meta/";
+ /**Meta definitions for channels - connect message*/
+ public static final String META_CONNECT="/meta/connect";
+ /**Meta definitions for channels - client messsage*/
+ public static final String META_CLIENT="/meta/client";
+ /**Meta definitions for channels - disconnect messsage*/
+ public static final String META_DISCONNECT="/meta/disconnect";
+ /**Meta definitions for channels - handshake messsage*/
+ public static final String META_HANDSHAKE="/meta/handshake";
+ /**Meta definitions for channels - ping messsage*/
+ public static final String META_PING="/meta/ping";
+ /**Meta definitions for channels - reconnect messsage
+ * @deprecated
+ */
+ public static final String META_RECONNECT="/meta/reconnect";
+ /**Meta definitions for channels - status messsage*/
+ public static final String META_STATUS="/meta/status";
+ /**Meta definitions for channels - subscribe messsage*/
+ public static final String META_SUBSCRIBE="/meta/subscribe";
+ /**Meta definitions for channels - unsubscribe messsage*/
+ public static final String META_UNSUBSCRIBE="/meta/unsubscribe";
+ /*Field names inside Bayeux messages*/
+ /**Field names inside Bayeux messages - clientId field*/
+ public static final String CLIENT_FIELD="clientId";
+ /**Field names inside Bayeux messages - data field*/
+ public static final String DATA_FIELD="data";
+ /**Field names inside Bayeux messages - channel field*/
+ public static final String CHANNEL_FIELD="channel";
+ /**Field names inside Bayeux messages - id field*/
+ public static final String ID_FIELD="id";
+ /**Field names inside Bayeux messages - error field*/
+ public static final String ERROR_FIELD="error";
+ /**Field names inside Bayeux messages - timestamp field*/
+ public static final String TIMESTAMP_FIELD="timestamp";
+ /**Field names inside Bayeux messages - transport field*/
+ public static final String TRANSPORT_FIELD="transport";
+ /**Field names inside Bayeux messages - advice field*/
+ public static final String ADVICE_FIELD="advice";
+ /**Field names inside Bayeux messages - successful field*/
+ public static final String SUCCESSFUL_FIELD="successful";
+ /**Field names inside Bayeux messages - subscription field*/
+ public static final String SUBSCRIPTION_FIELD="subscription";
+ /**Field names inside Bayeux messages - ext field*/
+ public static final String EXT_FIELD="ext";
+ /**Field names inside Bayeux messages - connectionType field*/
+ public static final String CONNECTION_TYPE_FIELD="connectionType";
+ /**Field names inside Bayeux messages - version field*/
+ public static final String VERSION_FIELD="version";
+ /**Field names inside Bayeux messages - minimumVersion field*/
+ public static final String MIN_VERSION_FIELD="minimumVersion";
+ /**Field names inside Bayeux messages - supportedConnectionTypes field*/
+ public static final String SUPP_CONNECTION_TYPE_FIELD="supportedConnectionTypes";
+ /**Field names inside Bayeux messages - json-comment-filtered field*/
+ public static final String JSON_COMMENT_FILTERED_FIELD="json-comment-filtered";
+ /**Field names inside Bayeux messages - reconnect field*/
+ public static final String RECONNECT_FIELD = "reconnect";
+ /**Field names inside Bayeux messages - interval field*/
+ public static final String INTERVAL_FIELD = "interval";
+ /**Field values inside Bayeux messages - retry response*/
+ public static final String RETRY_RESPONSE = "retry";
+ /**Field values inside Bayeux messages - handshake response*/
+ public static final String HANDSHAKE_RESPONSE = "handshake";
+ /**Field values inside Bayeux messages - none response*/
+ public static final String NONE_RESPONSE = "none";
+ /**Service channel names-starts with*/
+ public static final String SERVICE="/service";
+ /**Service channel names-trailing slash*/
+ public static final String SERVICE_SLASH="/service/";
+ /*Transport types*/
+ /**Transport types - long polling*/
+ public static final String TRANSPORT_LONG_POLL="long-polling";
+ /**Transport types - callback polling*/
+ public static final String TRANSPORT_CALLBACK_POLL="callback-polling";
+ /**Transport types - iframe*/
+ public static final String TRANSPORT_IFRAME="iframe";
+ /**Transport types - flash*/
+ public static final String TRANSPORT_FLASH="flash";
+ /** ServletContext attribute name used to obtain the Bayeux object */
+ public static final String DOJOX_COMETD_BAYEUX="dojox.cometd.bayeux";
+ /*http field names*/
+ /**http helpers - text/json content type*/
+ public static final String JSON_CONTENT_TYPE="text/json";
+ /**http helpers - parameter name for json message*/
+ public static final String MESSAGE_PARAMETER="message";
+ /**http helpers - name of the jsonp parameter*/
+ public static final String JSONP_PARAMETER="jsonp";
+ /**http helpers - default name of the jsonp callback function*/
+ public static final String JSONP_DEFAULT_NAME="jsonpcallback";
+
+ /*--Client----------------------------------------------------------- */
+ /**
+ * Creates a new server side client. This method is to be invoked
+ * by server side objects only. You cannot create a remote client by using this method.
+ * A client represents an entity that can subscribe to channels and publish and receive messages
+ * through these channels
+ * @param idprefix String - the prefix string for the id generated, can be null
+ * @param listener Listener - a callback object to be called when messages are to be delivered to the new client
+ * @return Client - returns an implementation of the client interface.
+ */
+ public Client newClient(String idprefix, Listener listener);
+
+ /**
+ * retrieve a client based on an ID. Will return null if the client doesn't exist.
+ * @param clientid String
+ * @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>.
+ * @param clientId String
+ * @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
+ * and remove it from the list.
+ * @param client Client
+ * @return Client - returns the client that was removed, or null if no client was removed.
+ */
+ public Client remove(Client client);
+
+
+ /*--Channel---------------------------------------------------------- */
+ /**
+ * Returns the channel for a given channel id.
+ * If the channel doesn't exist, and the <code>create</code> parameter is set to true,
+ * the channel will be created and added to the list of active channels.<br/>
+ * 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,
+ * 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>
+ */
+ public List<Channel> getChannels();
+
+ /**
+ * Removes a channel from the Bayeux object.
+ * This will also unsubscribe all the clients currently subscribed to the
+ * the channel.
+ * @param channel Channel - the channel to be removed
+ * @return Channel - returns the channel that was removed, or null if no channel was removed.
+ */
+ public Channel remove(Channel channel);
+
+ /**
+ * returns true if a channel with the given channelId exists.
+ * <br/>Same as executing <code>Bayeux.getChannel(channelId,false)!=null</code>
+ * @param channelId String
+ * @return boolean - true if the channel exists.
+ */
+ public boolean hasChannel(String channelId);
+
+ /* --Message---------------------------------------------------------- */
+ /**
+ * Creates a new message to be sent by a server side client.
+ * @return Message - returns a new Message object, that has a unique id.
+ */
+ public Message newMessage(Client from);
+
+
+ /*--Security policy----------------------------------------------------------- */
+ /**
+ * Returns the security policy associated with this Bayeux session
+ * @return SecurityPolicy
+ */
+ public SecurityPolicy getSecurityPolicy();
+
+ /**
+ * Sets the security policy to be used in this Bayeux session
+ * @param securityPolicy SecurityPolicy
+ */
+ public void setSecurityPolicy(SecurityPolicy securityPolicy);
+
}
\ No newline at end of file
Propchange: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Bayeux.java
------------------------------------------------------------------------------
svn:eol-style = native
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=723775&r1=723774&r2=723775&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 Fri Dec 5 07:57:43 2008
@@ -1,103 +1,103 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-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.
- * A channel is created by calling the <code>Bayeux.getChannel(channelId,true)</code> method.
- * A channel can be created either server side by invoking the getChannel, or client side
- * by using the /meta/subscribe message without a wildcard.
- * @author Greg Wilkins
- * @author Filip Hanik
- */
-public interface Channel
-{
- /**
- * Returns the id for this channel. The id is unique within bayeux session.
- * @return String - will never be null.
- */
- 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>
- * @param data - the message to be published, can not be null.
- */
- 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.
- */
- public Client unsubscribe(Client subscriber);
-
- /**
- * 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
- * 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.
- * @param filter Filter
- * @return Filter - null if no filter was removed otherwise it returns the filter that was removed.
- */
- public DataFilter removeFilter(DataFilter filter);
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+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.
+ * A channel is created by calling the <code>Bayeux.getChannel(channelId,true)</code> method.
+ * A channel can be created either server side by invoking the getChannel, or client side
+ * by using the /meta/subscribe message without a wildcard.
+ * @author Greg Wilkins
+ * @author Filip Hanik
+ */
+public interface Channel
+{
+ /**
+ * Returns the id for this channel. The id is unique within bayeux session.
+ * @return String - will never be null.
+ */
+ 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>
+ * @param data - the message to be published, can not be null.
+ */
+ 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.
+ */
+ public Client unsubscribe(Client subscriber);
+
+ /**
+ * 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
+ * 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.
+ * @param filter Filter
+ * @return Filter - null if no filter was removed otherwise it returns the filter that was removed.
+ */
+ public DataFilter removeFilter(DataFilter filter);
}
\ No newline at end of file
Propchange: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Channel.java
------------------------------------------------------------------------------
svn:eol-style = native
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=723775&r1=723774&r2=723775&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 Fri Dec 5 07:57:43 2008
@@ -1,91 +1,91 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-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
- * 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,
- * 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>
- * </nl>
- * @author Greg Wilkins
- * @author Filip Hanik
- */
-public interface Client
-{
- /**
- * Returns a unique id for this client. The id is unique within this Bayeux session.
- * @return String - will not be null
- */
- public String getId();
-
- /**
- * 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
- * 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
- * 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
- * filtered or published to a channel.
- * @param message
- */
- public void deliver(Message[] message);
-
- /**
- * @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.
- */
- 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();
-
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+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
+ * 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,
+ * 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>
+ * </nl>
+ * @author Greg Wilkins
+ * @author Filip Hanik
+ */
+public interface Client
+{
+ /**
+ * Returns a unique id for this client. The id is unique within this Bayeux session.
+ * @return String - will not be null
+ */
+ public String getId();
+
+ /**
+ * 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
+ * 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
+ * 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
+ * filtered or published to a channel.
+ * @param message
+ */
+ public void deliver(Message[] message);
+
+ /**
+ * @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.
+ */
+ 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
Propchange: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Client.java
------------------------------------------------------------------------------
svn:eol-style = native
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=723775&r1=723774&r2=723775&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 Fri Dec 5 07:57:43 2008
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-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
- * {@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.
- * The second scenario is when a local client invokes {@link Channel#publish(Message)} directly in the local JVM.
- * @author Greg Wilkins
- * @author Filip Hanik
- *
- */
-public interface DataFilter
-{
- /**
- * Runs a message through the filter. Filtering can only modify an existing object, it can not replace it.
- * @param data Message - the message to be filtered, may not be null
- */
- public void filter(Message data);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+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
+ * {@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.
+ * The second scenario is when a local client invokes {@link Channel#publish(Message)} directly in the local JVM.
+ * @author Greg Wilkins
+ * @author Filip Hanik
+ *
+ */
+public interface DataFilter
+{
+ /**
+ * Runs a message through the filter. Filtering can only modify an existing object, it can not replace it.
+ * @param data Message - the message to be filtered, may not be null
+ */
+ public void filter(Message data);
+}
Propchange: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/DataFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
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=723775&r1=723774&r2=723775&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 Fri Dec 5 07:57:43 2008
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-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.
- * This callback object, implementing the Listener interface, is used to deliver messages to local, in JVM, clients.
- * @author Greg Wilkins
- * @author Filip Hanik
- *
- */
-public interface Listener
-{
- /**
- * This method is called when the client is removed (explicitly or from a timeout)
- * @param timeout - true if the client was removed from a timeout
- * 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
- */
- public void deliver(Message[] msg);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+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.
+ * This callback object, implementing the Listener interface, is used to deliver messages to local, in JVM, clients.
+ * @author Greg Wilkins
+ * @author Filip Hanik
+ *
+ */
+public interface Listener
+{
+ /**
+ * This method is called when the client is removed (explicitly or from a timeout)
+ * @param timeout - true if the client was removed from a timeout
+ * 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
+ */
+ public void deliver(Message[] msg);
+}
Propchange: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Listener.java
------------------------------------------------------------------------------
svn:eol-style = native
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=723775&r1=723774&r2=723775&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 Fri Dec 5 07:57:43 2008
@@ -1,68 +1,68 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-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
- */
-public interface Message extends Map<String,Object>
-{
- /**
- * Returns a reference to the client that sent this message
- * @return Client - may be null
- */
- public Client getClient();
- /**
- * Returns a reference to the channel that this message was published throuhg
- * @return Channel - may be null
- */
- public Channel getChannel();
- /**
- * Returns the unique id of this message
- * @return String
- */
- public String getId();
-
- /**
- * 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
- */
- public long getCreationTime();
-}
-
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+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
+ */
+public interface Message extends Map<String,Object>
+{
+ /**
+ * Returns a reference to the client that sent this message
+ * @return Client - may be null
+ */
+ public Client getClient();
+ /**
+ * Returns a reference to the channel that this message was published throuhg
+ * @return Channel - may be null
+ */
+ public Channel getChannel();
+ /**
+ * Returns the unique id of this message
+ * @return String
+ */
+ public String getId();
+
+ /**
+ * 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
+ */
+ public long getCreationTime();
+}
+
+
Propchange: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/Message.java
------------------------------------------------------------------------------
svn:eol-style = native
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=723775&r1=723774&r2=723775&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 Fri Dec 5 07:57:43 2008
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cometd.bayeux;
-
-/**
- * @author Greg Wilkins
- */
-public interface SecurityPolicy
-{
- boolean canHandshake(Message message);
- boolean canCreate(Client client,String channel,Message message);
- boolean canSubscribe(Client client,String channel,Message messsage);
- boolean canPublish(Client client,String channel,Message messsage);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cometd.bayeux;
+
+/**
+ * @author Greg Wilkins
+ */
+public interface SecurityPolicy
+{
+ boolean canHandshake(Message message);
+ boolean canCreate(Client client,String channel,Message message);
+ boolean canSubscribe(Client client,String channel,Message messsage);
+ boolean canPublish(Client client,String channel,Message messsage);
+}
Propchange: tomcat/trunk/modules/bayeux/java/org/apache/cometd/bayeux/SecurityPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
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=723775&r1=723774&r2=723775&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 Fri Dec 5 07:57:43 2008
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tomcat.bayeux;
-/**
- *
- * @author Filip Hanik
- * @version 1.0
- */
-public class BayeuxException extends Exception {
- public BayeuxException() {
- super();
- }
-
- public BayeuxException(String message) {
- super(message);
- }
-
- public BayeuxException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public BayeuxException(Throwable cause) {
- super(cause);
- }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tomcat.bayeux;
+/**
+ *
+ * @author Filip Hanik
+ * @version 1.0
+ */
+public class BayeuxException extends Exception {
+ public BayeuxException() {
+ super();
+ }
+
+ public BayeuxException(String message) {
+ super(message);
+ }
+
+ public BayeuxException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public BayeuxException(Throwable cause) {
+ super(cause);
+ }
}
\ No newline at end of file
Propchange: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxException.java
------------------------------------------------------------------------------
svn:eol-style = native
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=723775&r1=723774&r2=723775&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 Fri Dec 5 07:57:43 2008
@@ -1,54 +1,54 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tomcat.bayeux;
-
-import org.apache.tomcat.bayeux.HttpError;
-
-/**
- * An interface that defines methods for managing Bayeux request meta
- * messages.
- *
- * @author Guy A. Molinari
- * @author Filip Hanik
- * @version 0.9
- */
-public interface BayeuxRequest {
-
- public static final String LAST_REQ_ATTR = "org.apache.cometd.bayeux.last_request";
- public static final String CURRENT_REQ_ATTR = "org.apache.cometd.bayeux.current_request";
- public static final String JSON_MSG_ARRAY = "org.apache.cometd.bayeux.json_msg_array";
-
- /**
- * 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
- * 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.
- */
- public int process(int prevops) throws BayeuxException;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tomcat.bayeux;
+
+import org.apache.tomcat.bayeux.HttpError;
+
+/**
+ * An interface that defines methods for managing Bayeux request meta
+ * messages.
+ *
+ * @author Guy A. Molinari
+ * @author Filip Hanik
+ * @version 0.9
+ */
+public interface BayeuxRequest {
+
+ public static final String LAST_REQ_ATTR = "org.apache.cometd.bayeux.last_request";
+ public static final String CURRENT_REQ_ATTR = "org.apache.cometd.bayeux.current_request";
+ public static final String JSON_MSG_ARRAY = "org.apache.cometd.bayeux.json_msg_array";
+
+ /**
+ * 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
+ * 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.
+ */
+ public int process(int prevops) throws BayeuxException;
+}
Propchange: tomcat/trunk/modules/bayeux/java/org/apache/tomcat/bayeux/BayeuxRequest.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org