UCFR: the URL Connection Factory Registry

This is the basic protocol registry. There will probably be one instance if this per client invocation. When a URL Connection Factory is created (at, e.g., client startup time, or DLL load time) it can register itself in the proffered registry. The registry class supports a method to create a URL Connection; it does this by searching its data for a protocol handler registered for the provided URL's protocol, then passing off into that URL Connection Factory's URL Connection creation method.


This class is defined in java, and is compiled with JMC. The C syntax is included in each method description, and is summarised below.

import netscape.url.URL;

public abstract class UCFR {
  public UCFR() throws Exception {};

  public abstract void registerFactory(UCF factory) throws Exception;
  public abstract UCF findFactory(String name) throws Exception;
  public abstract void deregisterFactory(String name) throws Exception;
  public abstract String listFactories() throws Exception;

  public abstract UC createUC(URL url, NC nc) throws Exception;

Interface Methods

Inherited Methods

This class inherits the usual JMC base methods.

C interface

#include "UCFR.h"

UCFR *UCFRFactory_Create(JMCException **e);

void UCFR_registerFactory(UCFR *self, UCF *factory, JMCException **e);
UCF *UCFR_findFactory(UCFR *self, const char *name, JMCException **e);
void UCFR_deregisterFactory(UCFR *self, const char *name, JMCException **e);
const char *UCFR_listFactories(UCFR *self, JMCException **e);
UC *UCFR_createUC(UCFR *self, URL *url, NC *nc, JMCException **e);

/* methods inherited from base JMC object interface */
void *UCFR_getInterface(UCFR *self, JMCInterfaceID id, JMCException **e);
void UCFR_addRef(UCFR *self, JMCException **e);
void UCFR_release(UCFR *self, JMCException **e);
jint UCFR_hashCode(UCFR *self, JMCException **e);
void *UCFR_clone(UCFR *self, JMCException **e);
const char *UCFR_toString(UCFR *self, JMCException **e);
void UCFR_finalize(UCFR *self, JMCException **e);

Written by Frederick at 18:33 17.03.1997.