ObjectAdapter Local Interface
An object adapter is an instance of the local interface
ObjectAdapter operations behave as follows:
getNameoperation returns the name of the adapter as passed to one of the communicator operations
getCommunicatoroperation returns the communicator that was used to create the adapter.
Note that there are other operations in the
ObjectAdapter interface; we will explore these throughout the remainder of this discussion.
Object Adapter Factory Operations
You create an object adapter by calling one of several operations on
These Communicator operations behave as follows:
createObjectAdaptercreates a new object adapter associated with this communicator. Each object adapter is associated with zero or more transport endpoints. Typically, an object adapter has a single transport endpoint.
An object adapter can also offer multiple endpoints. If so, these endpoints each lead to the same set of objects and represent alternative means of accessing these objects. This is useful, for example, if a server is behind a firewall but must offer access to its objects to both internal and external clients; by binding the adapter to both the internal and external interfaces, the objects implemented in the server can be accessed via either interface.
An object adapter can also have no endpoint at all. In that case, the adapter can only be reached via collocated invocations originating from the same communicator as is used by the adapter.
An application normally needs to configure an object adapter with endpoints or a router. Calling
createObjectAdapterwith a non-empty value for
namemeans the new object adapter will check the communicator's configuration for properties, using its name as prefix, including:
createObjectAdapter raises an exception if neither is defined and name is not empty.
createObjectAdapterWithEndpointsallows you to specify the object adapter's endpoints directly, overriding any setting for
name.Endpoints. Typically, you should use
createObjectAdapterin preference to
createObjectAdapterWithEndpoints. Doing so keeps transport-specific information, such as host names and port numbers, out of the source code and allows you to reconfigure the application by changing a property (and so avoid recompilation when a transport endpoint needs to be changed).
createObjectAdapterWithRouteraccepts a router proxy and overrides
createObjectAdapterWithRoutercreates a routed object adapter that allows clients to receive callbacks from servers that are behind a router.