Ice Reference Documentation | ||
---|---|---|
<<< Previous | Slice Documentation | Next >>> |
local interface |
The central object in Ice. One or more communicators can be instantiated for an Ice application. Communicator instantiation is language specific, and not specified in Slice code.
::Freeze::Connection::getCommunicator, ObjectAdapter::getCommunicator, ::IceBox::Service::start
Add a servant factory to this communicator.
Create a new object adapter.
Create a new object adapter with endpoints.
Destroy the communicator.
Find a servant factory registered with this communicator.
Flush any pending batch requests for this communicator.
Get the currently-set default context.
Get the default locator this communicator.
Get the default router this communicator.
Get the logger for this communicator.
Get the plug-in manager for this communicator.
Get the properties for this communicator.
Get the statistics callback object for this communicator.
Convert a proxy into a string.
Remove a servant factory from this communicator.
Set a default context on this communicator.
Set a default Ice locator for this communicator.
Set a default router for this communicator.
Set the logger for this communicator.
Set the statistics callback object for this communicator.
Shuts down this communicator's server functionality, including the deactivation of all object adapters.
Convert a string into a proxy.
Wait until this communicator's server functionality has shut down completely.
void addObjectFactory( |
Add a servant factory to this communicator. Installing a
factory with an id for which a factory is already registered
throws AlreadyRegisteredException
.
When unmarshaling an Ice object, the Ice run-time reads the
most-derived type id off the wire and attempts to create an
instance of the type using a factory. If no instance is created,
either because no factory was found, or because all factories
returned nil, the object is sliced to the next most-derived type
and the process repeats. If no factory is found that can create an
instance, the Ice run-time throws NoObjectFactoryException
.
The following order is used to locate a factory for a type:
The Ice run-time looks for a factory registered specifically for the type.
If no instance has been created, the Ice run-time looks for the default factory, which is registered with an emtpy type id.
If no instance has been created by any of the preceding steps, the Ice run-time looks for a factory that may have been statically generated by the language mapping for non-abstract classes.
The factory to add.
The type id for which the factory can create instances, or an empty string for the default factory.
|
Create a new object adapter. The endpoints for the object adapter are taken from the property name.Endpoints.
The object adapter name.
The new object adapter.
|
Create a new object adapter with endpoints. This method sets the property name.Endpoints, and then calls createObjectAdapter. It is provided as a convenience function.
The object adapter name.
The endpoints for the object adapter.
The new object adapter.
void destroy(); |
Destroy the communicator. This operation calls shutdown implicitly. Calling destroy cleans up memory, and shuts down this communicator's client functionality. Subsequent calls to destroy are ignored.
|
Find a servant factory registered with this communicator.
The type id for which the factory can create instances, or an empty string for the default factory.
The servant factory, or null if no servant factory was found for the given id.
void flushBatchRequests(); |
Flush any pending batch requests for this communicator. This causes all batch requests that were sent via proxies obtained via this communicator to be sent to the server.
Context getDefaultContext(); |
Get the currently-set default context.
The currently established default context. If no default context is currently set, getDefaultContext returns an empty context.
|
Get the default locator this communicator.
The default locator for this communicator.
|
Get the default router this communicator.
The default router for this communicator.
|
Get the logger for this communicator.
This communicator's logger.
|
Get the plug-in manager for this communicator.
This communicator's plug-in manager.
|
Get the properties for this communicator.
This communicator's properties.
|
Get the statistics callback object for this communicator.
This communicator's statistics callback object.
string proxyToString(Object* obj); |
Convert a proxy into a string.
The proxy to convert into a string.
The "stringified" proxy.
void removeObjectFactory(string id); |
Remove a servant factory from this communicator. Removing an id
for which no factory is registered throws NotRegisteredException
.
The type id for which the factory can create instances, or an empty string for the default factory.
void setDefaultContext(Context ctx); |
Set a default context on this communicator. Once set, all proxies that do not explicitly override the context on a per-proxy or per-invocation basis send this context with every invocation. To clear a context, call setContext with an empty context.
The default context to be set.
void setDefaultLocator( |
Set a default Ice locator for this communicator. All newly created proxy and object adapters will use this default locator. To disable the default locator, null can be used. Note that this operation has no effect on existing proxies or object adapters.
![]() | You can also set a locator for an individual proxy by calling the operation ice_locator on the proxy, or for an object adapter by calling the operation setLocator on the object adapter. |
The default locator to use for this communicator.
void setDefaultRouter( |
Set a default router for this communicator. All newly created proxies will use this default router. To disable the default router, null can be used. Note that this operation has no effect on existing proxies.
![]() | You can also set a router for an individual proxy by calling the operation ice_router on the proxy. |
The default router to use for this communicator.
void setLogger( |
Set the logger for this communicator.
The logger to use for this communicator.
void setStats( |
Set the statistics callback object for this communicator.
The statistics callback object to use for this communicator.
void shutdown(); |
Shuts down this communicator's server functionality, including
the deactivation of all object adapters. (Attempts to use
a deactivated object adapter raise ObjectAdapterDeactivatedException
.)
Subsequent calls to shutdown are ignored.
![]() | After shutdown returns, no new requests are processed. However, requests that have been started before shutdown was called might still be active. You can use waitForShutdown to wait for the completion of all requests. |
Object* stringToProxy(string str); |
Convert a string into a proxy. For example,
MyCategory/MyObject:tcp -h some_host -p
10000 creates a proxy that refers to the Ice object
having an identity with a name "MyObject" and a category
"MyCategory", with the server running on host "some_host", port
10000. If the string does not parse correctly, the operation
throws ProxyParseException
.
The string to convert into a proxy.
The proxy.
void waitForShutdown(); |
Wait until this communicator's server functionality has shut down completely. Calling shutdown initiates shutdown, and waitForShutdown only returns when all outstanding requests have completed. A typical use of this operation is to call it from the main thread, which then waits until some other thread calls shutdown. After shutdown is complete, the main thread returns and can do some cleanup work before it finally calls destroy to also shut down the client functionality, and then exits the application.
<<< Previous | Home | Next >>> |
Ice::CollocationOptimizationException | Up | Ice::CommunicatorDestroyedException |