Author: fhanik
Date: Thu Oct 11 13:09:05 2007
New Revision: 583941
URL: http://svn.apache.org/viewvc?rev=583941&view=rev
Log:
modify to be more similar to java.nio package, good for developers who are
familiar with that interface
Modified:
tomcat/sandbox/gdev6x/java/org/apache/catalina/CometEvent.java
tomcat/sandbox/gdev6x/java/org/apache/catalina/connector/CometEventImpl.java
Modified: tomcat/sandbox/gdev6x/java/org/apache/catalina/CometEvent.java
URL:
http://svn.apache.org/viewvc/tomcat/sandbox/gdev6x/java/org/apache/catalina/CometEvent.java?rev=583941&r1=583940&r2=583941&view=diff
==============================================================================
--- tomcat/sandbox/gdev6x/java/org/apache/catalina/CometEvent.java (original)
+++ tomcat/sandbox/gdev6x/java/org/apache/catalina/CometEvent.java Thu Oct 11
13:09:05 2007
@@ -202,29 +202,23 @@
/**
* Registers the Comet connection with the container for IO and event
notifications.
- * The different notifications are defined by the
+ * Each time this method is invoked, the operations are reset to the
operations parameter value.
+ * To unregister an operation, simple do interestOps(interestOps() &
(~CometOperation.OP_WRITE))
* @param operations
* @throws IllegalStateException - if you are trying to register with a
socket that already is registered
* or if the operation you are trying to register is invalid.
* @see #EventType
* @see #CometOperation
*/
- public void register(int operations) throws IllegalStateException;
+ public void interestOps(int operations) throws IllegalStateException;
/**
- * Unregisters Comet operations for this CometConnection
- * @param operations CometOperation[]
- * @throws IllegalStateException
- */
- public void unregister(int operations) throws IllegalStateException;
-
- /**
* Returns what the current IO notifications that the Comet
* connection is registered for.
* @return integer representing registered operations
- * @see #register(int)
+ * @see #interestOps(int)
*/
- public int getRegisteredOps();
+ public int interestOps();
/**
* Returns true if the Comet connection is blocking or non blocking and
you can write
Modified:
tomcat/sandbox/gdev6x/java/org/apache/catalina/connector/CometEventImpl.java
URL:
http://svn.apache.org/viewvc/tomcat/sandbox/gdev6x/java/org/apache/catalina/connector/CometEventImpl.java?rev=583941&r1=583940&r2=583941&view=diff
==============================================================================
---
tomcat/sandbox/gdev6x/java/org/apache/catalina/connector/CometEventImpl.java
(original)
+++
tomcat/sandbox/gdev6x/java/org/apache/catalina/connector/CometEventImpl.java
Thu Oct 11 13:09:05 2007
@@ -155,23 +155,18 @@
this.blocking = bool.get();
}
- public void register(int operations) throws IllegalStateException {
+ public void interestOps(int operations) throws IllegalStateException {
//add it to the registered set
- cometOperations = cometOperations | operations;
+ cometOperations = operations;
request.action(ActionCode.ACTION_COMET_REGISTER,
translate(cometOperations));
}
- public void unregister(int operations) throws IllegalStateException {
- //remove from the registered set
- cometOperations = cometOperations & (~operations);
- request.action(ActionCode.ACTION_COMET_REGISTER,
translate(cometOperations));
- }
public boolean isBlocking() {
return blocking;
}
- public int getRegisteredOps() {
+ public int interestOps() {
return cometOperations;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]