Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / TransportCurrent / lib / Server_Request_Interceptor.cpp
blob2e79dc339769a3e3aa04a211b7f582d3b92f01c1
1 // -*- C++ -*-
2 #include "ace/Log_Msg.h"
4 #include "Server_Request_Interceptor.h"
5 #include "Server_ORBInitializer.h"
7 namespace Test
9 Server_Request_Interceptor::Server_Request_Interceptor (const char* orbid, TEST test)
10 : request_count_ (0)
11 , orb_id_ (::CORBA::string_dup (orbid))
12 , test_ (test)
16 Server_Request_Interceptor::~Server_Request_Interceptor ()
20 void
21 Server_Request_Interceptor::test_transport_current (const ACE_TCHAR* amethod)
23 CORBA::String_var name (this->name ());
24 ACE_DEBUG ((LM_DEBUG,
25 ACE_TEXT ("%s (%P|%t) Test accessing Transport Current from %s\n"),
26 name.in (),
27 amethod));
29 ++this->request_count_;
31 if (TAO_debug_level >=1)
32 ACE_DEBUG ((LM_DEBUG,
33 ACE_TEXT ("%s (%P|%t) Getting the ORB\n"),
34 name.in ()));
36 int tmpargc = 0;
37 ACE_TCHAR **argv = 0;
38 CORBA::ORB_var orb = CORBA::ORB_init (tmpargc,
39 argv,
40 this->orb_id_.in ());
41 if (TAO_debug_level >=1)
42 ACE_DEBUG ((LM_DEBUG,
43 ACE_TEXT ("%s (%P|%t) Resolving the TC\n"),
44 name.in ()));
46 CORBA::Object_var tcobject =
47 orb->resolve_initial_references ("TAO::Transport::Current");
49 // Run the test function
50 (*this->test_) (orb.in ());
52 ACE_DEBUG ((LM_DEBUG,
53 ACE_TEXT ("%s (%P|%t) Success - Transport Current from %s\n"),
54 name.in (),
55 amethod));
58 /// queries the status of the test
59 bool
60 Server_Request_Interceptor::self_test ()
62 return true;
66 char *
67 Server_Request_Interceptor::name ()
69 return CORBA::string_dup ("SRI ");
72 void
73 Server_Request_Interceptor::destroy ()
77 void
78 Server_Request_Interceptor::receive_request_service_contexts (PortableInterceptor::ServerRequestInfo_ptr)
80 test_transport_current (ACE_TEXT ("receive_request_service_contexts"));
83 void
84 Server_Request_Interceptor::receive_request (PortableInterceptor::ServerRequestInfo_ptr)
86 test_transport_current (ACE_TEXT ("receive_request"));
89 void
90 Server_Request_Interceptor::send_reply (PortableInterceptor::ServerRequestInfo_ptr)
92 test_transport_current (ACE_TEXT ("send_reply"));
95 void
96 Server_Request_Interceptor::send_exception (PortableInterceptor::ServerRequestInfo_ptr)
98 test_transport_current (ACE_TEXT ("send_exception"));
101 void
102 Server_Request_Interceptor::send_other (PortableInterceptor::ServerRequestInfo_ptr)
104 test_transport_current (ACE_TEXT ("send_other"));
106 } /* namespace Test */