summaryrefslogtreecommitdiff
path: root/TAO/CIAO/DAnCE/ciao/NodeApp_CB_Impl.h
blob: 782c2d2348bea6c4fa9e5804f12fdcc6432e2af4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// -*- C++ -*-
// $Id$
//=============================================================================
/**
 *  @file    NodeApp_CB_Impl.h
 *
 *  @author Nanbor Wang <nanbor@cs.wustl.edu>
 *          Tao    Lu   <lu@dre.vanderbilt.edu>
 *
 //===========================================================================*/


#ifndef NODEAPPLICATION_CALLBACK_IMPL_H
#define NODEAPPLICATION_CALLBACK_IMPL_H
#include /**/ "ace/pre.h"

#include "ace/config-all.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "NodeApplication_CallBackS.h"

namespace CIAO
{
  // Forward declaration.
  // class NodeApplicationManager;

  /**
   * @class NodeApplication_Callback_Impl
   *
   * @brief A call back interface for NodeApplication
   * @Note  Here is no need to be thread safe since for every nodeapplication
   *        we will have an unique callback object. --Tao
   */
  class Deployment_svnt_Export NodeApplication_Callback_Impl
    : public virtual POA_CIAO::NodeApplication_Callback,
      public virtual PortableServer::RefCountServantBase
  {
  public:
    friend class NodeApplicationManager_Impl;

    /// Constructor.
    NodeApplication_Callback_Impl (CORBA::ORB_ptr o,
                                   PortableServer::POA_ptr p,
                                   Deployment::NodeApplicationManager_ptr s,
                                   const Deployment::Properties &properties)
      ACE_THROW_SPEC ((CORBA::SystemException));

    // @@ (OO) Since this class is reference counted, please make this
    //         destructor protected to enforce proper memory managment
    //         through the reference counting mechanism (i.e. to
    //         disallow calling operator delete() on an instance of
    //         this class.
    /// Destructor.
    ~NodeApplication_Callback_Impl ();

    /// Get the containing POA.  This operation does *not* increase
    /// the reference count of the POA.
    virtual PortableServer::POA_ptr _default_POA (void);

    /// Record the NodeApplication reference returned by the newly
    /// spawned NodeApplication and give it back a reference to
    /// NodeApplicationManager
    Deployment::NodeApplicationManager_ptr
    register_node_application (Deployment::NodeApplication_ptr na,
                               Deployment::Properties_out properties
                               ACE_ENV_ARG_DECL_WITH_DEFAULTS)
      ACE_THROW_SPEC ((CORBA::SystemException));

  protected:
    Deployment::NodeApplication_ptr get_nodeapp_ref (void);

    CORBA::ORB_var orb_;

    PortableServer::POA_var poa_;

    Deployment::NodeApplicationManager_var nam_;

    Deployment::NodeApplication_var nodeapp_;

    Deployment::Properties_var properties_;
  };
}

#include /**/ "ace/post.h"
#endif /* NODEAPPLICATION_CALLBACK_IMPL_H */