diff options
author | Mark Spruiell <mes@zeroc.com> | 2001-11-16 20:57:30 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2001-11-16 20:57:30 +0000 |
commit | 2ac5213d0c761977903dd75f39e7960a897281ea (patch) | |
tree | 6296bb8991ef7d4b079fe6365b2c897a1f7f721b /java/src/IceInternal/EventHandler.java | |
parent | minor fixes (diff) | |
download | ice-2ac5213d0c761977903dd75f39e7960a897281ea.tar.bz2 ice-2ac5213d0c761977903dd75f39e7960a897281ea.tar.xz ice-2ac5213d0c761977903dd75f39e7960a897281ea.zip |
intial check-in
Diffstat (limited to 'java/src/IceInternal/EventHandler.java')
-rw-r--r-- | java/src/IceInternal/EventHandler.java | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/java/src/IceInternal/EventHandler.java b/java/src/IceInternal/EventHandler.java new file mode 100644 index 00000000000..e9c9f3d352c --- /dev/null +++ b/java/src/IceInternal/EventHandler.java @@ -0,0 +1,69 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +package IceInternal; + +abstract class EventHandler +{ + // + // Returns true if the event handler belongs to the server-side of + // an application. Client-side otherwise. + // + abstract boolean server(); + + // + // Return true if read() must be called before calling message(). + // + abstract boolean readable(); + + // + // Read data via the event handler. May only be called if + // readable() returns true. + // + abstract void read(Ice.Stream is); + + // + // A complete message has been received. + // + abstract void message(Ice.Stream stream); + + // + // Signal exception during reading or unmarshaling. + // + abstract void exception(Ice.LocalException ex); + + // + // Will be called if the event handler is finally + // unregistered. (Calling unregister() does not unregister + // immediately.) + // + abstract void finished(); + + // + // Try to destroy the event handler. Returns false if the event + // handler cannot be destroyed because it is in use, or true + // otherwise. + // + abstract boolean tryDestroy(); + + protected + EventHandler(Instance instance) + { + _instance = instance; + _stream = new StreamI(instance); + } + + protected Instance _instance; + + // + // The _stream data member is for use by ThreadPool only + // + Ice.Stream _stream; +} |