The new NetAccessor API has already been discussed in a previous tech talk.
In 25 words or less, it allows you to plug in a handler for http:// and
ftp:// based XML entities and get them into the parser. You have to
implement the NetAccessor API and a related BinInputStream derivative, and
you can parse socket based entities.

I previously indicated that to do this, you must recompile the system and
have your per-platform code create and return the desired type of
NetAccessor when the platform independent init code asks you to. However,
since the accessor object is just stored in a public static,
XMLPlatformUtils::fgNetAccesor if memory serves, you can actually just call
XMLPlatform::Initialize(), then create your desired NetAcessor in your
code, and just point fgNetAccessor at it. At that point, the parser will
use your accesssor object.

So you can effectively just install it from your own code at run time,
using our official binary drop. This makes it a lot more flexible. You can
still of course rebuild it for your platform and have the per-platform code
create one. This will insure that the right one gets installed, without any
action on the part of the end user of the parser instance.

Note that, since the accessor object is shared within the process (its a
static member), you should be careful to provide any synchronization
required when its asked to create a new input stream. For the most part,
this won't require any synchronization, since it just requires creating a
new input stream instance over a newly created socket. So, to avoid undue
overhead, the calling code in the XMLURL class does assume it must
synchronize calls. So, if your implementation is stateful in any way, you
must provide the required synchronization.

----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
[EMAIL PROTECTED]


Reply via email to