// WebNaming.idl
#pragma prefix "borland.com"
module URLNaming {
exception InvalidURL{string reason;};
exception CommFailure{string reason;};
exception ReqFailure{string reason;};
exception AlreadyExists{string reason;};
abstract interface
Resolver {
// Read Operations
Object
locate(in string url_s)
raises (InvalidURL, CommFailure, ReqFailure);
// Write Operations
void
force_register_url(in string url_s, in Object obj)
raises (InvalidURL, CommFailure, ReqFailure);
void
register_url(in string url_s, in Object obj)
raises (InvalidURL, CommFailure, ReqFailure, AlreadyExists);
};
};
Object servers register objects by binding to the Resolver and then using the
register_url or the
force_register_url method to associate a URL with an object's IOR.
register_url is used to associate a URL with an object's IOR if no prior association exists. Using the
force_register_url method associates a URL with an object's IOR regardless of whether an URL has already been bound to that object. If you use the
register_url method under the same circumstances, an
AlreadyExists exception is raised.
For an example illustrating the server-side use of this feature, see “URL Naming Service examples”. This example uses
force_register_url. For
force_register_url to be successful, the web server must be allowed to issue
HTTP PUT commands.
To get a reference to the Resolver, use the VisiBroker ORB's resolve_initial_references method, as shown in the example.
The ior_file_name is the user-specified file name where the stringified object reference is stored. The suffix of the
ior_file_name must be
.ior if the Gatekeeper will be used instead of an HTTP server. An example using the Gatekeeper and its default port number is as follows:
Client applications do not need to bind to the Resolver, they simply specify the URL when they call the
bind method, as shown in the following code sample. The bind accepts the URL as the object name. If the URL is invalid, an
InvalidURL exception is raised. The
bind method transparently calls
locate() for you.
For an example of how to use locate(), see the following code sample.