These can be seen as a set of callbacks that the caller must provide to the URL Connection. We have grouped these callbacks together as methods in an interface, called the Net Context. This interface provides the per-connection context required for the netlib to work.
We imagine that there will be several types that implement this interface: one for each front-end, perhaps one for each front-end for mail/news windows, a ``null'' context used internally (by, e.g., the image library), and one or more used in server situations. I would guess that there would be one instance per window, but the details of this are up to the callers.
Note that there is no such thing as a Net Context Group. Never was, never will be.
package netscape.net; import netscape.jmc.*; import netscape.types.*; import netscape.url.URL; public abstract interface NC { // popups public abstract boolean confirm(TextMessage m) throws Exception; public abstract String prompt(TextMessage m, String d) throws Exception; public abstract String getPassword(TextMessage m) throws Exception; // registerCallback is needed for multithreading // public abstract void registerCallback(PREventQueue queue, Callback callback, Object arg) throws Exception; // Instructions to the front end to go do something. Legacy. public abstract void doRemoteHost(int url_type, String host, String port, String username) throws Exception; public abstract void setRefreshURLTimer(int seconds, URL url) throws Exception; // Dynamic observation points public abstract void observe(String name, Observer proc, Object addArg) throws Exception; public abstract void notify(String name, int message, Object notifyArg) throws Exception; } |
The C signature of this method is:
The C signature of this method is:
The C signature of this method is:
As this method can be troublesome, and as the now-forseen clients of the netlib do not necessarily need the old asynchronous semantics, this method has been elided for now.
The C signature of this method is:
The C signature of this method is:
The C signature of this method is:
The C signature of this method is:
#include "NC.h" jbool NC_confirm(NC *self, struct TextMessage a, JMCException **e); const char *NC_prompt(NC *self, struct TextMessage a, const char *b, JMCException **e); const char *NC_getPassword(NC *self, struct TextMessage a, JMCException **e); void NC_doRemoteHost(NC *self, jint url_type, const char *host, const char *port, const char *username, JMCException **e); void NC_setRefreshURLTimer(NC *self, jint seconds, URL *url, JMCException **e); void NC_observe(NC *self, const char *name, XP_ObserverProc proc, void *addArg, JMCException **e); void NC_notify(NC *self, const char *name, jint message, void *notifyArg, JMCException **e); /* methods inherited from base JMC object interface */ void *NC_getInterface(NC *self, JMCInterfaceID id, JMCException **e); void NC_addRef(NC *self, JMCException **e); void NC_release(NC *self, JMCException **e); jint NC_hashCode(NC *self, JMCException **e); void *NC_clone(NC *self, JMCException **e); const char *NC_toString(NC *self, JMCException **e); void NC_finalize(NC *self, JMCException **e); |