Proxies are created as a side-effect of using the servant activation operations, but the life cycle of proxies is completely independent from that of servants. The ObjectAdapter interface provides several operations for creating a proxy for an object, regardless of whether a servant is currently activated for that object's identity:

{zcode:slice}
module Ice {
    local interface ObjectAdapter {
        // ...

        Object* createProxy(Identity id);
        Object* createDirectProxy(Identity id);
        Object* createIndirectProxy(Identity id);

        // ...
    };
};
{zcode}

These operations are described below:

In contrast to createProxy, createIndirectProxy does not use the replica group ID. Therefore, the returned proxy always refers to a specific replica.

After using one of the operations discussed above to create a proxy, you will receive a proxy that is configured by default for twoway invocations. If you require the proxy to have a different configuration, you can use the proxy factory methods to create a new proxy with the desired configuration. As an example, the code below demonstrates how to configure the proxy for oneway invocations:

{zcode:cpp}
Ice::ObjectAdapterPtr adapter = ...;
Ice::Identity id = ...;
Ice::ObjectPrx proxy = adapter->createProxy(id)->ice_oneway();
{zcode}

You can also instruct the object adapter to use a different default proxy configuration by setting the property name.ProxyOptions. For example, the following property causes the object adapter to return proxies that are configured for oneway invocations by default:

{zcode}
MyAdapter.ProxyOptions=-o
{zcode}
See Also