A system and method for facilitating exposing a resource over a protocol is provided.
The system includes a class factory that holds identifiers associated with determining
which, if any, registered listener object creator should be employed to create
a listener object. The listener object implements an abstract network protocol
base class. The listener object is employed to abstract details of exposing a resource
over a protocol and to provide a byte stream interface to communications occurring
over the protocol, while removing protocol specific code from a server program.
The method includes creating an instance of a listener object from a source of
registered protocol handlers based on a request to expose a resource over a protocol
and using a base class API to communicate over the protocol through the listener object.