Object Adapters

版权声明:本文为博主原创文章,允许转载,转载请注明出处。 https://blog.csdn.net/KnightOnHourse/article/details/80674690

Creating an Object Adapter

module Ice {
    local interface ObjectAdapter {
        string getName();
        Communicator getCommunicator();

        // ...
    };

    local interface Communicator {
        ObjectAdapter createObjectAdapter(string name);
        ObjectAdapter createObjectAdapterWithEndpoints(string name, string endpoints);
        ObjectAdapter createObjectAdapterWithRouter(string name, Router* rtr);

        // ...
    };
};

Servant Activation and Deactivation

module Ice {
    local interface ObjectAdapter {
        // ...

        Object* add(Object servant, Identity id);
        Object* addWithUUID(Object servant);
        Object  remove(Identity id);
        Object  find(Identity id);
        Object  findByProxy(Object* proxy);

        // ...
    };
};

Object Adapter State Transitions

module Ice {
    local interface ObjectAdapter {
        // ...

        void activate();
        void hold();
        void waitForHold();
        void deactivate();
        void waitForDeactivate();
        void isDeactivated();
        void destroy();

        // ...
    };
};

Timeouts in Object Adapter Endpoints

MyAdapter.Endpoints=tcp -p 9999 -t 5000

Discovering Object Adapter Endpoints

module Ice {
    local interface ObjectAdapter {
        // ...

        EndpointSeq getEndpoints();
        EndpointSeq getPublishedEndpoints();

        // ...
    };
};

The Current Object

module Ice {
    local dictionary<string, string> Context;

    enum OperationMode { Normal, \Idempotent };

    local struct Current {
        ObjectAdapter   adapter;
        Connection      con;
        Identity        id;
        string          facet;
        string          operation;
        OperationMode   mode;
        Context         ctx;
        int             requestId;
        EncodingVersion encoding;
    };
};






展开阅读全文

没有更多推荐了,返回首页