From 6ee369b67f04d226b3558349d569e01bc0b427cd Mon Sep 17 00:00:00 2001 From: fhanik Date: Thu, 10 May 2007 15:24:51 +0000 Subject: [PATCH] Add in getters Also change name from pluralis to CometOperation git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@536888 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/CometEvent.java | 19 +++++++++++++++++-- .../org/apache/catalina/connector/CometEventImpl.java | 10 +++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/java/org/apache/catalina/CometEvent.java b/java/org/apache/catalina/CometEvent.java index 362831e45..0eb838628 100644 --- a/java/org/apache/catalina/CometEvent.java +++ b/java/org/apache/catalina/CometEvent.java @@ -184,12 +184,19 @@ public interface CometEvent { throws IOException, IllegalStateException; /** + * Returns the configuration for this Comet connection + * @return CometConfiguration[] + * @see #configure(CometConfiguration...) + */ + public CometConfiguration[] getConfiguration(); + + /** * OP_CALLBACK - receive a CALLBACK event from the container * OP_READ - receive a READ event when the connection has data to be read * OP_WRITE - receive a WRITE event when the connection is able to receive data to be written * @see #register(CometOperations) */ - public enum CometOperations {OP_CALLBACK, OP_READ, OP_WRITE}; + public enum CometOperation {OP_CALLBACK, OP_READ, OP_WRITE}; /** * Registers the Comet connection with the container for IO notifications. @@ -199,10 +206,18 @@ public interface CometEvent { * @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. */ - public void register(CometOperations... operations) + public void register(CometOperation... operations) throws IOException, IllegalStateException; /** + * Returns what the current IO notifications that the Comet + * connection is registered for. + * @return CometOperations[] + * @see #register(CometOperations...) + */ + public CometOperation[] getRegisteredOps(); + + /** * Returns true if the Comet connection is blocking or non blocking and you can write * without blocking data to the response * @return boolean - true if you can write to the response diff --git a/java/org/apache/catalina/connector/CometEventImpl.java b/java/org/apache/catalina/connector/CometEventImpl.java index 4321de963..b87773731 100644 --- a/java/org/apache/catalina/connector/CometEventImpl.java +++ b/java/org/apache/catalina/connector/CometEventImpl.java @@ -134,9 +134,17 @@ public class CometEventImpl implements CometEvent { throw new UnsupportedOperationException(); } - public void register(CometEvent.CometOperations... operations) + public void register(CometEvent.CometOperation... operations) throws IOException, IllegalStateException { throw new UnsupportedOperationException(); } + + public CometConfiguration[] getConfiguration() { + throw new UnsupportedOperationException(); + } + + public CometOperation[] getRegisteredOps() { + throw new UnsupportedOperationException(); + } } -- 2.11.0