Results 1 to 2 of 2

Thread: Servant auto life cycle

  1. #1
    LAstakhov's Avatar
    LAstakhov is offline Registered User
    Name: Leonid Astakhov
    Organization: Kaspersky Lab
    Project: AVP
    Join Date
    Mar 2008
    Posts
    8

    Thumbs up Servant auto life cycle

    Hi guys!

    Here is a problem brief:

    I have a server side operation:

    interface IJobManager
    {
    IJob* Add( JobItem item ) throws JobException;
    ....
    }

    when this method is called by a client I need to create a new servant instance, activate it with an adapter and return a proxy to the client.

    Then somehow I need to know that client has destroyed a proxy and no longer need a servant to be active. So I need to destroy my servant instance.
    Ice documentation addresses this problem and suggests to use a special method destroy() inside IJobManager interface. Clients are calling destroy() when they no longer need the object.

    Question: is there any easier way for clients to use some kind of self-destructing objects. Something like:

    class IJobSmartProxy
    {
    public:

    IJobSmartProxy ( const IJobProxy& p ): m_Proxy ( p ) {}
    ~IJobSmartProxy () { m_Proxy->destroy(); }

    private:

    IJobProxy m_Proxy;

    }

    ?

    Best regards, Leo

  2. #2
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    Please have a look at the article "The Grim Reaper" in Issue 3 of Connections for a solution to your problem.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Life Cycle Problems
    By RonnieDay in forum Help Center
    Replies: 4
    Last Post: 03-30-2011, 11:42 AM
  2. Freeze does not set log auto remove flag properly
    By rGlory in forum Bug Reports
    Replies: 1
    Last Post: 06-01-2010, 07:01 PM
  3. Visual Studio Plugin, Auto Generate code
    By Nisd in forum Comments
    Replies: 1
    Last Post: 07-31-2009, 11:34 AM
  4. Replies: 5
    Last Post: 01-09-2009, 11:17 PM
  5. Life cycle operations coment
    By xdm in forum Help Center
    Replies: 1
    Last Post: 05-13-2006, 03:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •