~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to TAO/tests/Portable_Interceptors/Collocated/Dynamic/Client_Task.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
// Client_Task.cpp,v 1.4 2003/12/31 20:25:59 bala Exp
3
 
//
4
 
 
5
 
#include "Client_Task.h"
6
 
#include "testC.h"
7
 
#include "interceptors.h"
8
 
 
9
 
ACE_RCSID(Muxing, Client_Task, "Client_Task.cpp,v 1.4 2003/12/31 20:25:59 bala Exp")
10
 
 
11
 
Client_Task::Client_Task (const char *ior,
12
 
                          CORBA::ORB_ptr corb,
13
 
                          ACE_Thread_Manager *thr_mgr)
14
 
  : ACE_Task_Base (thr_mgr)
15
 
    , input_ (ior)
16
 
    , corb_ (CORBA::ORB::_duplicate (corb))
17
 
 
18
 
{
19
 
}
20
 
 
21
 
int
22
 
Client_Task::svc (void)
23
 
{
24
 
  ACE_TRY_NEW_ENV
25
 
    {
26
 
 
27
 
      CORBA::Object_var object =
28
 
        corb_->string_to_object (input_ ACE_ENV_ARG_PARAMETER);
29
 
      ACE_TRY_CHECK;
30
 
 
31
 
      Test_Interceptors::Visual_var server =
32
 
        Test_Interceptors::Visual::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
33
 
      ACE_TRY_CHECK;
34
 
 
35
 
      if (CORBA::is_nil (server.in ()))
36
 
        {
37
 
          ACE_ERROR_RETURN ((LM_ERROR,
38
 
                             "Object reference <%s> is nil\n",
39
 
                             this->input_),
40
 
                            1);
41
 
        }
42
 
 
43
 
      run_test (server.in () ACE_ENV_ARG_PARAMETER);
44
 
      ACE_TRY_CHECK;
45
 
 
46
 
      server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
47
 
      ACE_TRY_CHECK;
48
 
    }
49
 
  ACE_CATCHANY
50
 
    {
51
 
      ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
52
 
                           "Exception caught:");
53
 
      return 1;
54
 
    }
55
 
  ACE_ENDTRY;
56
 
 
57
 
  return 0;
58
 
 
59
 
}
60
 
 
61
 
 
62
 
void
63
 
Client_Task::run_test (Test_Interceptors::Visual_ptr server
64
 
          ACE_ENV_ARG_DECL)
65
 
{
66
 
  CORBA::Long val =
67
 
    Echo_Client_Request_Interceptor::client_interceptor_check_;
68
 
 
69
 
  server->normal (10 ACE_ENV_ARG_PARAMETER);
70
 
  ACE_CHECK;
71
 
 
72
 
  CORBA::Long one = 1, two = 1;
73
 
  (void) server->calculate (one,
74
 
                            two
75
 
                            ACE_ENV_ARG_PARAMETER);
76
 
  ACE_CHECK;
77
 
 
78
 
  ACE_TRY
79
 
    {
80
 
      (void) server->user (ACE_ENV_SINGLE_ARG_PARAMETER);
81
 
      ACE_TRY_CHECK;
82
 
    }
83
 
  ACE_CATCH (Test_Interceptors::Silly, userex)
84
 
    {
85
 
      ACE_DEBUG ((LM_DEBUG, "Caught Silly\n"));
86
 
    }
87
 
  ACE_ENDTRY;
88
 
  ACE_CHECK;
89
 
 
90
 
  ACE_TRY_EX (SYS)
91
 
    {
92
 
      server->system (ACE_ENV_SINGLE_ARG_PARAMETER);
93
 
      ACE_TRY_CHECK_EX (SYS);
94
 
    }
95
 
  ACE_CATCH (CORBA::INV_OBJREF, sysex)
96
 
    {
97
 
      ACE_DEBUG ((LM_DEBUG, "Caught CORBA::INV_OBJREF\n"));
98
 
    }
99
 
  ACE_ENDTRY;
100
 
  ACE_CHECK;
101
 
 
102
 
  if (Echo_Client_Request_Interceptor::client_interceptor_check_ -
103
 
      val != 10)
104
 
    ACE_ERROR ((LM_ERROR,
105
 
                "(%P|%t) ERROR:Client Interceptors not called"
106
 
                " properly\n"));
107
 
}