summaryrefslogtreecommitdiff
path: root/DAnCE/dance/LocalityManager/Interceptors/Standard_Error.cpp
blob: 863591f3eb5c7e8014ea699b3641b8893f4b7c68 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// $Id$

#include "Standard_Error.h"
#include "dance/Deployment/Deployment_StartErrorC.h"
#include "dance/DAnCE_PropertiesC.h"
#include "dance/DAnCE_Utility.h"
#include "dance/Logger/Log_Macros.h"

namespace DAnCE
{
  // Implementation skeleton constructor
  Standard_Error::Standard_Error (void)
  {
  }

  // Implementation skeleton destructor
  Standard_Error::~Standard_Error (void)
  {
  }

  void
  Standard_Error::configure (const ::Deployment::Properties & )
  {
  }

  void
  Standard_Error::post_install (const ::Deployment::DeploymentPlan &plan,
                                ::CORBA::ULong index,
                                const ::CORBA::Any &,
                                const ::CORBA::Any &exception)
  {
    if (exception.type() != ::CORBA::_tc_null)
      {
        DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR,
                     (LM_ERROR, DLINFO
                      ACE_TEXT ("Standard_Error::post_install - ")
                      ACE_TEXT ("Propagating exception from instance <%C>\n"),
                      plan.instance[index].name.in ()));
        DAnCE::Utility::throw_exception_from_any (exception);
      }
  }

  void
  Standard_Error::post_connect (const ::Deployment::DeploymentPlan &plan,
                                         ::CORBA::ULong connection,
                                         const ::CORBA::Any &exception)
  {
    if (exception.type() != ::CORBA::_tc_null)
      {
        DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR,
                     (LM_ERROR, DLINFO
                      ACE_TEXT ("Standard_Error::post_connect - ")
                      ACE_TEXT ("Propagating exception from connection <%C>\n"),
                      plan.connection[connection].name.in ()));
        DAnCE::Utility::throw_exception_from_any (exception);
      }
  }

  void
  Standard_Error::post_configured (const ::Deployment::DeploymentPlan & plan,
                                            ::CORBA::ULong index,
                                            const ::CORBA::Any &exception )
  {
    if (exception.type() != ::CORBA::_tc_null)
      {
        DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR,
                     (LM_ERROR, DLINFO
                      ACE_TEXT ("Standard_Error::post_configured - ")
                      ACE_TEXT ("Propagating exception from configuring instance <%C>\n"),
                      plan.instance[index].name.in ()));
        DAnCE::Utility::throw_exception_from_any (exception);
      }
  }


  void
  Standard_Error::post_activate (const ::Deployment::DeploymentPlan & plan,
                                 ::CORBA::ULong index,
                                 const ::CORBA::Any & exception)
  {
    if (exception.type() != ::CORBA::_tc_null)
      {
        DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR,
                     (LM_ERROR, DLINFO
                      ACE_TEXT ("Standard_Error::post_activate - ")
                      ACE_TEXT ("Propagating exception from activation of instance <%C>\n"),
                      plan.instance[index].name.in ()));
        DAnCE::Utility::throw_exception_from_any (exception);
      }
  }


  void
  Standard_Error::post_passivate (const ::Deployment::DeploymentPlan & plan,
                                  ::CORBA::ULong index,
                                  const ::CORBA::Any & exception)
  {
    if (exception.type() != ::CORBA::_tc_null)
      {
        DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR,
                     (LM_ERROR, DLINFO
                      ACE_TEXT ("Standard_Error::post_passivate - ")
                      ACE_TEXT ("Propagating exception from passivation of instance <%C>\n"),
                      plan.instance[index].name.in ()));
        DAnCE::Utility::throw_exception_from_any (exception);
      }
  }


  void
  Standard_Error::post_remove (const ::Deployment::DeploymentPlan & plan,
                               ::CORBA::ULong index,
                               const ::CORBA::Any & exception)
  {
    if (exception.type() != ::CORBA::_tc_null)
      {
        DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR,
                     (LM_ERROR, DLINFO
                      ACE_TEXT ("Standard_Error::post_remove - ")
                      ACE_TEXT ("Propagating exception from removal of instance <%C>\n"),
                      plan.instance[index].name.in ()));
        DAnCE::Utility::throw_exception_from_any (exception);
      }
  }
 }

extern "C"
{
  ::DAnCE::DeploymentInterceptor_ptr
  create_DAnCE_Standard_Error (void)
  {
    return new DAnCE::Standard_Error ();
  }
}