summaryrefslogtreecommitdiff
path: root/modules/CIAO/connectors/AMI_CCM/AMI/AMI_internal_i.cpp
blob: e7e8d6d612d8a76d7c7452472ddad82348749512 (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
// $Id$

#include "AMI_internal_i.h"

AMI_internal_i::AMI_internal_i (CORBA::ORB_ptr orb, ::CCM_AMI::AMI_foo_ptr foo_receiver)
  : orb_ (CORBA::ORB::_duplicate (orb)),
    foo_receiver_ (::CCM_AMI::AMI_foo::_duplicate (foo_receiver))
{
}

CORBA::Long
AMI_internal_i::asynch_foo (const char * in_str,
                 CORBA::String_out out_str)
{
  try
    {
      printf ("AMI CORBA :\tReceived string <%s>. Try passing it to the Receiver component\n", in_str);
      CORBA::Long result = foo_receiver_->foo (CORBA::string_dup (in_str), out_str);
      return result;
    }
  catch (CCM_AMI::InternalError& ex)
    {
      printf ("!!!!! INTERNAL EXCEPTION -> re-throwing\n");
      throw INTERNAL_CCM_AMI::InternalError (ex.id, CORBA::string_dup  (ex.error_string));
    }
  catch (...)
   {
     printf ("!!!!! UNKNOWN EXCEPTION\n");
      throw CCM_AMI::InternalError (43, "UNKNOWN");
   }
}

void
AMI_internal_i::shutdown (void)
{
  printf ("AMI CORBA :\tShutting down\n");
  this->orb_->shutdown (0);
}