Creating an Object Adapter

You create an object adapter by calling createObjectAdapter on a communicator:

C++
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter(
"GreeterAdapter");
C#
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("GreeterAdapter");
Java
ObjectAdapter adapter = communicator.createObjectAdapter("GreeterAdapter");
JavaScript
const adapter = await communicator.createObjectAdapter("GreeterAdapter");
Python
adapter = communicator.createObjectAdapter("GreeterAdapter")
Swift
let adapter = try communicator.createObjectAdapter("GreeterAdapter")

An object adapter with a non-empty name reads its configuration from the properties prefixed with this name, such as name.Endpoints, the endpoints on which it listens. It requires at least one of these properties. An object adapter with an empty name reads no properties.

An object adapter with a non-empty name reads its configuration from the properties prefixed with this name, such as name.Router, the proxy of a router. It requires at least one of these properties. An object adapter with an empty name reads no properties.

createObjectAdapterWithEndpoints creates an object adapter and sets its endpoints:

C++
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints(
"GreeterAdapter",
"tcp -p 4061");
C#
Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints(
"GreeterAdapter",
"tcp -p 4061");
Java
ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints(
"GreeterAdapter",
"tcp -p 4061");
Python
adapter = communicator.createObjectAdapterWithEndpoints(
"GreeterAdapter",
"tcp -p 4061")
Swift
let adapter = try communicator.createObjectAdapterWithEndpoints(
name: "GreeterAdapter", endpoints: "tcp -p 4061")

An object adapter without endpoints dispatches only collocated invocations and the requests it receives over bidirectional connections.