diff options
31 files changed, 902 insertions, 58 deletions
diff --git a/TAO/docs/interceptors.html b/TAO/docs/interceptors.html index 18348877633..05f52723cfb 100644 --- a/TAO/docs/interceptors.html +++ b/TAO/docs/interceptors.html @@ -339,14 +339,23 @@ module PortableInterceptor mechanism since they can't be stringified and registered via <CODE>-ORBInitRef</CODE> ORB option. <li>Basically, all <CODE>ORBInitInfo</CODE> methods have been - implemented except <CODE>allocate_slot_id</CODE> and - <CODE>codec_factory</CODE>. + implemented except <CODE>allocate_slot_id</CODE>. <li>Implemented most of the remaining <CODE>ClientRequestInfo</CODE>, <CODE>ServerRequestInfo</CODE> and <CODE>IORInfo</CODE> methods. <li>Added support for the <CODE>PortableInterceptor::ForwardRequest</CODE> exception on both the client and server sides. + <li>Implemented the <CODE>IOP::CodecFactory</CODE> and the CDR + encapsulation <CODE>IOP::Codec</CODE> objects. The CDR + encapsulation <CODE>Codec</CODE> is useful for embedding data in + an <CODE>octet</CODE> sequence that conforms to the CDR + encapsulation rules. For example, it could be used to marshal + data into the <CODE>octet</CODE> sequence that is part of an + <CODE>IOP::ServiceContext</CODE> or an + <CODE>IOP::TaggedComponent</CODE>. This means that it could + compliment the IOR interceptor support, and the service context + manipulation support found in request interceptors. </ul> <hr><P> @@ -358,15 +367,6 @@ module PortableInterceptor chain. <li>Implement the <CODE>PortableInterceptor::Current</CODE> interface. Useful for passing data between interceptors. - <li>Implement the <CODE>CodecFactory</CODE> interface, and an - accompanying CDR encapsulation <CODE>Codec</CODE>. - Implementations of each are almost ready and should be available - soon. The CDR encapsulation <CODE>Codec</CODE> is useful for - embedding data in an <CODE>octet</CODE> sequence that conforms - to the CDR encapsulation rules. For example, it could be used - to create the <CODE>octet</CODE> sequence that is part of an - <CODE>IOP::TaggedComponent</CODE>. This means that it could - compliment the IOR interceptor support. <li>The <CODE>send_poll</CODE> request interception point implementation will most likely be deferred until TII is supported in TAO. @@ -385,12 +385,10 @@ module PortableInterceptor <hr><P> <H3><a name="ref">References</a></H3> <UL> - <LI><p><a href="ftp://ftp.omg.org/pub/docs/orbos/99-12-02.pdf"> - 99-12-02</a> Portable Interceptors -- Joint Revised - Submission.</p> - <LI><p><a href="ftp://ftp.omg.org/pub/docs/orbos/99-12-14.zip"> - 99-12-14</a> Portable Interceptors related IDL files (in zip - format.) </p> + <LI><A +HREF="ftp://ftp.omg.org/pub/docs/ptc/00-04-05.pdf">ptc/2000-04-05</A> +Portable Interceptors -- final published draft</LI> + </UL> <hr> diff --git a/TAO/tests/Codec/Codec.dsw b/TAO/tests/Codec/Codec.dsw new file mode 100644 index 00000000000..e486960cebe --- /dev/null +++ b/TAO/tests/Codec/Codec.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "Codec Client"=.\client.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/Codec/Makefile b/TAO/tests/Codec/Makefile new file mode 100644 index 00000000000..ec6d0f7f3ce --- /dev/null +++ b/TAO/tests/Codec/Makefile @@ -0,0 +1,50 @@ +#---------------------------------------------------------------------------- +# $Id$ +#---------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +ifndef TAO_ROOT + TAO_ROOT = $(ACE_ROOT)/TAO +endif # ! TAO_ROOT + +LDLIBS = -lTAO + +IDL_FILES = test +IDL_SRC = testC.cpp +BIN = client + +SRC = $(addsuffix .cpp, $(BIN) $(IDL_SRC) + +CLIENT_OBJS = \ + client.o \ + testC.o + +TAO_IDLFLAGS += -Ge 1 + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU + +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU +include $(TAO_ROOT)/taoconfig.mk + +#---------------------------------------------------------------------------- +# Local targets +#---------------------------------------------------------------------------- + +.PRECIOUS: $(foreach ext, $(IDL_EXT), test$(ext)) + +client: $(addprefix $(VDIR),$(CLIENT_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(TAO_CLNT_LIBS) $(POSTLINK) + +realclean: clean + -$(RM) $(foreach ext, $(IDL_EXT), test$(ext)) diff --git a/TAO/tests/Codec/Makefile.bor b/TAO/tests/Codec/Makefile.bor new file mode 100644 index 00000000000..6023060755a --- /dev/null +++ b/TAO/tests/Codec/Makefile.bor @@ -0,0 +1,7 @@ +# +# Makefile for building the Codec test executables +# + +MAKEFILES = client.bor + +!include <$(ACE_ROOT)\include\makeinclude\recurse.bor> diff --git a/TAO/tests/Codec/README b/TAO/tests/Codec/README new file mode 100644 index 00000000000..f2619024adc --- /dev/null +++ b/TAO/tests/Codec/README @@ -0,0 +1,33 @@ +# $Id$ + +This test verifies that CodecFactory and CDR encapsulation Codec +support is working properly. + +It does so by encoding a structure into an octet sequence, decoding +into a new instance of the structure from the octet sequence, and then +comparing the contents of the two structures. + +Run the test as follows: + + $ perl run_test.pl + +Expected output follows: + +==== Running Codec test +Testing CDR encapsulation Codec encode()/decode() +================================================= +Original Extracted +-------- --------- +I need a standing ovation! I need a standing ovation! +-3427 -3427 +I'm Batman. I'm Batman. + +Testing CDR encapsulation Codec encode_value()/decode_value() +============================================================= +Original Extracted +-------- --------- +I need a standing ovation! I need a standing ovation! +-3427 -3427 +I'm Batman. I'm Batman. + +Codec test passed. diff --git a/TAO/tests/Codec/client.bor b/TAO/tests/Codec/client.bor new file mode 100644 index 00000000000..f5762c05e4d --- /dev/null +++ b/TAO/tests/Codec/client.bor @@ -0,0 +1,35 @@ +# +# Makefile for building the Codec test client +# + +NAME = client + +TAO_IDL = $(CORE_BINDIR)\tao_idl -I../.. -g $(CORE_BINDIR)\gperf.exe -Ge 1 + +OBJFILES = \ + $(OBJDIR)\testC.obj \ + $(OBJDIR)\client.obj + +CFLAGS = \ + $(ACE_CFLAGS) \ + $(TAO_CFLAGS) + +LIBFILES = \ + $(ACE_LIB) \ + $(TAO_LIB) + +IDLFILES = \ + $(IDLDIR)\test.idl + +CPPDIR = . + +IDLDIR = . + +!include <$(ACE_ROOT)\include\makeinclude\build_exe.bor> + +# +# IDL Build rules +# + +$(IDLDIR)\testC.cpp: $(IDLDIR)\test.idl + $(TAO_IDL) $** diff --git a/TAO/tests/Codec/client.cpp b/TAO/tests/Codec/client.cpp new file mode 100644 index 00000000000..568c1d1409e --- /dev/null +++ b/TAO/tests/Codec/client.cpp @@ -0,0 +1,153 @@ +// -*- C++ -*- + +#include "tao/IOPC.h" +#include "testC.h" + +ACE_RCSID (Codec, + client, + "$Id$") + +int +verify_data (Foo::Bar *original, Foo::Bar *extracted) +{ + ACE_DEBUG ((LM_DEBUG, + "Original\t\t\tExtracted\n" + "--------\t\t\t---------\n" + "%s\t%s\n" + "%d\t\t\t\t%d\n" + "%s\t\t\t%s\n\n", + original->A.in (), extracted->A.in (), + original->B, extracted->B, + original->C.in (), extracted->C.in ())); + + if (ACE_OS_String::strcmp (original->A, extracted->A) != 0 + || original->B != extracted->B + || ACE_OS_String::strcmp (original->C, extracted->C) != 0) + -1; + + return 0; +} + +int +main (int argc, char *argv[]) +{ + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "my_orb", ACE_TRY_ENV); + ACE_TRY_CHECK; + + // Obtain a reference to the CodecFactory. + CORBA::Object_var obj = + orb->resolve_initial_references ("CodecFactory", + ACE_TRY_ENV); + ACE_TRY_CHECK; + + IOP::CodecFactory_var codec_factory = + IOP::CodecFactory::_narrow (obj.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + + // ---------------------------------------------------------- + + // Set up a structure that contains information necessary to + // create a GIOP 1.1 CDR encapsulation Codec. + IOP::Encoding encoding; + encoding.format = IOP::ENCODING_CDR_ENCAPS; + encoding.major_version = 1; + encoding.minor_version = 1; + + // Obtain the CDR encapsulation Codec. + IOP::Codec_var codec = + codec_factory->create_codec (encoding, ACE_TRY_ENV); + ACE_TRY_CHECK; + + // ---------------------------------------------------------- + + // Test values to be placed in the test structure. + const char A[] = "I need a standing ovation!"; + CORBA::Long B = -3427; + const char C[] = "I'm Batman."; + + // Create the structure to be encoded. + Foo::Bar value; + value.A = CORBA::string_dup (A); + value.B = B; + value.C = CORBA::string_dup (C); + + CORBA::Any data; + data <<= value; + + // ---------------------------------------------------------- + + CORBA::OctetSeq_var encoded_data; + CORBA::Any_var decoded_data; + Foo::Bar *extracted_value; + + // Encode the structure into an octet sequence using the CDR + // enscapsulation Codec. + + ACE_DEBUG ((LM_DEBUG, + "Testing CDR encapsulation Codec encode()/decode()\n" + "=================================================\n")); + + // Start out with the encode() method, i.e. the one that + // includes the TypeCode in the CDR encapsulation. + encoded_data = codec->encode (data, ACE_TRY_ENV); + ACE_TRY_CHECK; + + // Extract the data from the octet sequence. + decoded_data = codec->decode (encoded_data, ACE_TRY_ENV); + ACE_TRY_CHECK; + + decoded_data.in() >>= extracted_value; + + // Verify that the extracted data matches the data that was + // originally encoded into the octet sequence. + if (::verify_data (&value, extracted_value) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "ERROR: Data extracted using " + "IOP::Codec::decode() does not match " + "original data.\n"), + -1); + + ACE_DEBUG ((LM_DEBUG, + "Testing CDR encapsulation Codec " + "encode_value()/decode_value()\n" + "================================" + "=============================\n")); + + // Now use the encode_value() method, i.e. the one that does + // *not* include the TypeCode in the CDR encapsulation. + encoded_data = codec->encode_value (data, ACE_TRY_ENV); + ACE_TRY_CHECK; + + // Extract the data from the octet sequence. + decoded_data = codec->decode_value (encoded_data, + Foo::_tc_Bar, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + decoded_data.in() >>= extracted_value; + + // Verify that the extracted data matches the data that was + // originally encoded into the octet sequence. + if (::verify_data (&value, extracted_value) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "ERROR: Data extracted using " + "IOP::Codec::decode_value() does not match " + "original data.\n"), + -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Codec test:"); + return -1; + } + ACE_ENDTRY; + + ACE_DEBUG ((LM_DEBUG, "Codec test passed.\n")); + + return 0; +} diff --git a/TAO/tests/Codec/client.dsp b/TAO/tests/Codec/client.dsp new file mode 100644 index 00000000000..13780b22983 --- /dev/null +++ b/TAO/tests/Codec/client.dsp @@ -0,0 +1,204 @@ +# Microsoft Developer Studio Project File - Name="Codec Client" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=Codec Client - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "client.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "client.mak" CFG="Codec Client - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Codec Client - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Codec Client - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Codec Client - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../.." /I "../.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 tao.lib ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\ace" /libpath:"..\..\tao"
+
+!ELSEIF "$(CFG)" == "Codec Client - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../.." /I "../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 taod.lib aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\ace" /libpath:"..\..\tao"
+
+!ENDIF
+
+# Begin Target
+
+# Name "Codec Client - Win32 Release"
+# Name "Codec Client - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter ".cpp"
+# Begin Source File
+
+SOURCE=.\client.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\testC.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h"
+# Begin Source File
+
+SOURCE=.\testC.h
+# End Source File
+# End Group
+# Begin Group "IDL Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\test.idl
+
+!IF "$(CFG)" == "Codec Client - Win32 Release"
+
+# PROP Ignore_Default_Tool 1
+USERDEP__TEST_="..\..\..\bin\Release\tao_idl.exe"
+# Begin Custom Build - Invoking TAO_IDL Compiler
+InputPath=.\test.idl
+InputName=test
+
+BuildCmds= \
+ ..\..\..\bin\Release\tao_idl -Ge 1 $(InputName).idl
+
+"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "Codec Client - Win32 Debug"
+
+USERDEP__TEST_="..\..\..\bin\tao_idl.exe"
+# Begin Custom Build - Invoking TAO_IDL Compiler
+InputPath=.\test.idl
+InputName=test
+
+BuildCmds= \
+ ..\..\..\bin\tao_idl -Ge 1 $(InputName).idl
+
+"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Inline Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\testC.i
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/TAO/tests/Codec/run_test.pl b/TAO/tests/Codec/run_test.pl new file mode 100755 index 00000000000..c4dcd2082cb --- /dev/null +++ b/TAO/tests/Codec/run_test.pl @@ -0,0 +1,28 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# -*- perl -*- +# $Id$ + +unshift @INC, '../../../bin'; +require Process; +require ACEutils; +use Cwd; + +$cwd = getcwd(); +ACE::checkForTarget($cwd); + +print STDERR "\n\n==== Running Codec test\n"; + +$codec = Process::Create ($EXEPREFIX."client".$EXE_EXT); + +$pid = $codec->TimedWait (15); +if ($pid == -1) { + print STDERR "ERROR: Codec timed out\n"; + $codec->Kill (); $codec->TimedWait (1); + + exit 1; +} + +exit 0; diff --git a/TAO/tests/Codec/test.idl b/TAO/tests/Codec/test.idl new file mode 100644 index 00000000000..e9cca6b0397 --- /dev/null +++ b/TAO/tests/Codec/test.idl @@ -0,0 +1,25 @@ +// -*- IDL -*- + +//============================================================================= +/** + * @file test.idl + * + * $Id$ + * + * "test" IDL interface for the Codec test. + * + * @author Ossama Othman <ossama@uci.edu> + */ +//============================================================================= + +module Foo +{ + + struct Bar + { + string A; + long B; + string C; + }; + +}; diff --git a/TAO/tests/Portable_Interceptors/Benchmark/interceptors.cpp b/TAO/tests/Portable_Interceptors/Benchmark/interceptors.cpp index ea7074f458c..937fca29e1b 100644 --- a/TAO/tests/Portable_Interceptors/Benchmark/interceptors.cpp +++ b/TAO/tests/Portable_Interceptors/Benchmark/interceptors.cpp @@ -40,6 +40,12 @@ Vault_Client_Request_Interceptor::name (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) } void +Vault_Client_Request_Interceptor::destroy (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Vault_Client_Request_Interceptor::send_poll ( PortableInterceptor::ClientRequestInfo_ptr TAO_ENV_ARG_DECL_NOT_USED) @@ -186,6 +192,12 @@ Vault_Server_Request_Interceptor::name (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) } void +Vault_Server_Request_Interceptor::destroy (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Vault_Server_Request_Interceptor::receive_request_service_contexts ( PortableInterceptor::ServerRequestInfo_ptr TAO_ENV_ARG_DECL_NOT_USED) @@ -313,6 +325,13 @@ Vault_Client_Request_Context_Interceptor::name ( } void +Vault_Client_Request_Context_Interceptor::destroy ( + TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Vault_Client_Request_Context_Interceptor::send_poll ( PortableInterceptor::ClientRequestInfo_ptr TAO_ENV_ARG_DECL_NOT_USED) @@ -431,6 +450,13 @@ Vault_Server_Request_Context_Interceptor::name ( } void +Vault_Server_Request_Context_Interceptor::destroy ( + TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Vault_Server_Request_Context_Interceptor::receive_request_service_contexts( PortableInterceptor::ServerRequestInfo_ptr TAO_ENV_ARG_DECL_NOT_USED) @@ -523,6 +549,13 @@ Vault_Client_Request_Dynamic_Interceptor::name ( } void +Vault_Client_Request_Dynamic_Interceptor::destroy ( + TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Vault_Client_Request_Dynamic_Interceptor::send_poll ( PortableInterceptor::ClientRequestInfo_ptr TAO_ENV_ARG_DECL_NOT_USED) @@ -673,6 +706,13 @@ Vault_Server_Request_Dynamic_Interceptor::name ( } void +Vault_Server_Request_Dynamic_Interceptor::destroy ( + TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Vault_Server_Request_Dynamic_Interceptor::receive_request ( PortableInterceptor::ServerRequestInfo_ptr ri TAO_ENV_ARG_DECL) @@ -803,6 +843,13 @@ Vault_Client_Request_NOOP_Interceptor::name (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) } void +Vault_Client_Request_NOOP_Interceptor::destroy ( + TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Vault_Client_Request_NOOP_Interceptor::send_poll ( PortableInterceptor::ClientRequestInfo_ptr TAO_ENV_ARG_DECL_NOT_USED) @@ -900,6 +947,13 @@ Vault_Server_Request_NOOP_Interceptor::name (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) } void +Vault_Server_Request_NOOP_Interceptor::destroy ( + TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Vault_Server_Request_NOOP_Interceptor::receive_request ( PortableInterceptor::ServerRequestInfo_ptr TAO_ENV_ARG_DECL_NOT_USED) diff --git a/TAO/tests/Portable_Interceptors/Benchmark/interceptors.h b/TAO/tests/Portable_Interceptors/Benchmark/interceptors.h index 4b16f78b58c..7a077f925d3 100644 --- a/TAO/tests/Portable_Interceptors/Benchmark/interceptors.h +++ b/TAO/tests/Portable_Interceptors/Benchmark/interceptors.h @@ -37,9 +37,11 @@ public: virtual char * name (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -88,6 +90,9 @@ public: ACE_THROW_SPEC ((CORBA::SystemException)); // Canonical name of the interceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, @@ -136,9 +141,11 @@ public: virtual char * name (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -187,6 +194,9 @@ public: ACE_THROW_SPEC ((CORBA::SystemException)); // Canonical name of the interceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, @@ -236,9 +246,11 @@ public: virtual char * name (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -287,6 +299,9 @@ public: ACE_THROW_SPEC ((CORBA::SystemException)); // Canonical name of the interceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, @@ -336,9 +351,11 @@ public: virtual char * name (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -387,6 +404,9 @@ public: ACE_THROW_SPEC ((CORBA::SystemException)); // Canonical name of the interceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, diff --git a/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp b/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp index 7f8a65aa7ed..093a0497204 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp +++ b/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp @@ -42,6 +42,12 @@ Echo_Client_Request_Interceptor::name (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) } void +Echo_Client_Request_Interceptor::destroy (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Echo_Client_Request_Interceptor::send_poll ( PortableInterceptor::ClientRequestInfo_ptr TAO_ENV_ARG_DECL_NOT_USED @@ -217,6 +223,12 @@ Echo_Server_Request_Interceptor::name (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) } void +Echo_Server_Request_Interceptor::destroy (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Echo_Server_Request_Interceptor::receive_request_service_contexts ( PortableInterceptor::ServerRequestInfo_ptr TAO_ENV_ARG_DECL_NOT_USED) @@ -315,7 +327,7 @@ Echo_Server_Request_Interceptor::send_reply ( (result_any.in ()) >>= result; ACE_DEBUG ((LM_DEBUG, - "The result of calculate is %d + %d = %d\n", + "The result of calculate is %d + %d = %d\n", param1, param2, result)); diff --git a/TAO/tests/Portable_Interceptors/Dynamic/interceptors.h b/TAO/tests/Portable_Interceptors/Dynamic/interceptors.h index 0d59493a60a..fccabebecf0 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/interceptors.h +++ b/TAO/tests/Portable_Interceptors/Dynamic/interceptors.h @@ -35,9 +35,11 @@ public: virtual char * name (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void send_poll ( PortableInterceptor::ClientRequestInfo_ptr TAO_ENV_ARG_DECL_WITH_DEFAULTS @@ -96,6 +98,18 @@ public: ACE_THROW_SPEC ((CORBA::SystemException)); // Canonical name of the interceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void receive_request_service_contexts ( + PortableInterceptor::ServerRequestInfo_ptr + TAO_ENV_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + PortableInterceptor::ForwardRequest + )); + virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, @@ -109,15 +123,6 @@ public: TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::ForwardRequest)); - - virtual void receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr - TAO_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException, - PortableInterceptor::ForwardRequest - )); virtual void send_other ( PortableInterceptor::ServerRequestInfo_ptr diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.cpp index c5bcd77cf94..c180e9e2067 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.cpp +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.cpp @@ -26,6 +26,12 @@ Client_Request_Interceptor::name ( } void +Client_Request_Interceptor::destroy (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Client_Request_Interceptor::send_request ( PortableInterceptor::ClientRequestInfo_ptr ri TAO_ENV_ARG_DECL) diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h index aa2dceb45f2..4696ede0d9c 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h @@ -69,6 +69,9 @@ public: virtual char * name (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void send_request ( PortableInterceptor::ClientRequestInfo_ptr ri TAO_ENV_ARG_DECL_WITH_DEFAULTS) diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.cpp index ddda2fc0c5b..bddb54c8614 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.cpp @@ -11,7 +11,7 @@ ACE_RCSID (ForwardRequest, #include "Server_Request_Interceptor.h" Server_ORBInitializer::Server_ORBInitializer (void) - : server_interceptor_ (0) + : server_interceptor_ () { } @@ -31,8 +31,9 @@ Server_ORBInitializer::post_init ( { TAO_ENV_ARG_DEFN; + PortableInterceptor::ServerRequestInterceptor_ptr interceptor; // Install the server request interceptor. - ACE_NEW_THROW_EX (this->server_interceptor_, + ACE_NEW_THROW_EX (interceptor, Server_Request_Interceptor, CORBA::NO_MEMORY ( CORBA::SystemException::_tao_minor_code ( @@ -41,18 +42,19 @@ Server_ORBInitializer::post_init ( CORBA::COMPLETED_NO)); ACE_CHECK; - PortableInterceptor::ServerRequestInterceptor_var - server_interceptor = this->server_interceptor_; + this->server_interceptor_ = interceptor; - info->add_server_request_interceptor (server_interceptor.in () + info->add_server_request_interceptor (interceptor TAO_ENV_ARG_PARAMETER); ACE_CHECK; } -Server_Request_Interceptor * +PortableInterceptor::ServerRequestInterceptor_ptr Server_ORBInitializer::server_interceptor (void) { - return this->server_interceptor_; + return + PortableInterceptor::ServerRequestInterceptor::_duplicate ( + this->server_interceptor_.in ()); } #endif /* TAO_HAS_INTERCEPTORS == 1 */ diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.h index 5172f660f17..7b0320caf55 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.h +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.h @@ -61,13 +61,13 @@ public: /// Return the created server request interceptor. Only valid after /// post_init(), i.e. ORB_init(), has been called. - Server_Request_Interceptor *server_interceptor (void); + PortableInterceptor::ServerRequestInterceptor_ptr server_interceptor (void); private: /// Pointer to the server request interceptor. ORB is responsible /// for storage. - Server_Request_Interceptor *server_interceptor_; + PortableInterceptor::ServerRequestInterceptor_var server_interceptor_; }; #if defined(_MSC_VER) && (_MSC_VER >= 1200) diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.cpp index cc5df510bab..8d1e4681401 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.cpp +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.cpp @@ -15,6 +15,9 @@ Server_Request_Interceptor::Server_Request_Interceptor (void) Server_Request_Interceptor::~Server_Request_Interceptor (void) { + ACE_DEBUG ((LM_DEBUG, + "******* IN ~Server_Request_Interceptor ******\n")); + CORBA::release (this->obj_[0]); CORBA::release (this->obj_[1]); } @@ -44,6 +47,12 @@ Server_Request_Interceptor::name (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) } void +Server_Request_Interceptor::destroy (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Server_Request_Interceptor::receive_request_service_contexts ( PortableInterceptor::ServerRequestInfo_ptr ri TAO_ENV_ARG_DECL) diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.h index 5e888a0e412..dc9fb709d2b 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.h +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.h @@ -22,7 +22,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableInterceptorC.h" +#include "ServerRequestInterceptorC.h" #include "tao/LocalObject.h" #if defined(_MSC_VER) @@ -55,21 +55,23 @@ * See the README file for test details. */ class Server_Request_Interceptor - : public virtual PortableInterceptor::ServerRequestInterceptor, + : public virtual ForwardRequestTest::ServerRequestInterceptor, public virtual TAO_Local_RefCounted_Object { public: - /// Constructorl + /// Constructor. Server_Request_Interceptor (void); /// Destructor. ~Server_Request_Interceptor (void); /// Set the references to which requests will be forwarded. - void forward_references (CORBA::Object_ptr obj1, - CORBA::Object_ptr obj2, - CORBA::Environment &ACE_TRY_ENV); + virtual void forward_references (CORBA::Object_ptr obj1, + CORBA::Object_ptr obj2, + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()) + ACE_THROW_SPEC ((CORBA::SystemException)); /** * @name Methods Required by the Server Request Interceptor @@ -84,6 +86,9 @@ public: virtual char * name (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void receive_request_service_contexts ( PortableInterceptor::ServerRequestInfo_ptr ri TAO_ENV_ARG_DECL_WITH_DEFAULTS) diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/server.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/server.cpp index ee0cac207b7..9eadd3a9241 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/server.cpp +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/server.cpp @@ -75,7 +75,9 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; CORBA::Object_var poa_object = - orb->resolve_initial_references ("RootPOA"); + orb->resolve_initial_references ("RootPOA", ACE_TRY_ENV); + ACE_TRY_CHECK; + if (CORBA::is_nil (poa_object.in ())) ACE_ERROR_RETURN ((LM_ERROR, " (%P|%t) Unable to initialize the POA.\n"), @@ -154,12 +156,23 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; // Set the forward references in the server request interceptor. - Server_Request_Interceptor *server_interceptor = - temp_initializer->server_interceptor (); + PortableInterceptor::ServerRequestInterceptor_var + server_interceptor = temp_initializer->server_interceptor (); - server_interceptor->forward_references (obj1.in (), - obj2.in (), - ACE_TRY_ENV); + ForwardRequestTest::ServerRequestInterceptor_var interceptor = + ForwardRequestTest::ServerRequestInterceptor::_narrow ( + server_interceptor.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (CORBA::is_nil (interceptor.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) Could not obtain reference to " + "server request interceptor.\n"), + -1); + + interceptor->forward_references (obj1.in (), + obj2.in (), + ACE_TRY_ENV); ACE_TRY_CHECK; // Write each IOR to a file. @@ -189,6 +202,12 @@ main (int argc, char *argv[]) orb->run (ACE_TRY_ENV); ACE_TRY_CHECK; + root_poa->destroy (1, 1, ACE_TRY_ENV); + ACE_TRY_CHECK; + + orb->destroy (ACE_TRY_ENV); + ACE_TRY_CHECK; + ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n")); } ACE_CATCHANY diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/server.dsp b/TAO/tests/Portable_Interceptors/ForwardRequest/server.dsp index f57acf02934..9b62f6e83fc 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/server.dsp +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/server.dsp @@ -101,6 +101,10 @@ SOURCE=.\Server_Request_Interceptor.cpp # End Source File
# Begin Source File
+SOURCE=.\ServerRequestInterceptorC.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\test_i.cpp
# End Source File
# Begin Source File
@@ -125,6 +129,10 @@ SOURCE=.\Server_Request_Interceptor.h # End Source File
# Begin Source File
+SOURCE=.\ServerRequestInterceptorC.h
+# End Source File
+# Begin Source File
+
SOURCE=.\test_i.h
# End Source File
# Begin Source File
@@ -141,6 +149,89 @@ SOURCE=.\testS_T.h # PROP Default_Filter ".idl"
# Begin Source File
+SOURCE=.\ServerRequestInterceptor.idl
+
+!IF "$(CFG)" == "ForwardRequest Server - Win32 Release"
+
+USERDEP__SERVE="..\..\..\..\bin\Release\tao_idl.exe"
+# Begin Custom Build
+InputPath=.\ServerRequestInterceptor.idl
+InputName=ServerRequestInterceptor
+
+BuildCmds= \
+ ..\..\..\..\bin\Release\tao_idl -Ge 1 -I ..\..\.. -DCORBA3 $(InputName).idl
+
+"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "ForwardRequest Server - Win32 Debug"
+
+USERDEP__SERVE="..\..\..\..\bin\tao_idl.exe"
+# Begin Custom Build
+InputPath=.\ServerRequestInterceptor.idl
+InputName=ServerRequestInterceptor
+
+BuildCmds= \
+ ..\..\..\..\bin\tao_idl -Ge 1 -I ..\..\.. -DCORBA3 $(InputName).idl
+
+"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\test.idl
!IF "$(CFG)" == "ForwardRequest Server - Win32 Release"
@@ -229,6 +320,10 @@ BuildCmds= \ # PROP Default_Filter ".i"
# Begin Source File
+SOURCE=.\ServerRequestInterceptorC.i
+# End Source File
+# Begin Source File
+
SOURCE=.\testC.i
# End Source File
# Begin Source File
diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.cpp index c1ed912b164..44300e7e2b5 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.cpp +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.cpp @@ -13,6 +13,12 @@ test_i::test_i (CORBA::Short num, { } +test_i::~test_i (void) +{ + ACE_DEBUG ((LM_DEBUG, + "Servant destructor invoked.\n")); +} + CORBA::Short test_i::number (CORBA::Environment &) ACE_THROW_SPEC ((CORBA::SystemException)) diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.h b/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.h index 0498d1a778e..261f380aba6 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.h +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.h @@ -33,6 +33,9 @@ public: test_i (CORBA::Short num, CORBA::ORB_ptr orb); + /// Destructor. + ~test_i (void); + /// Return the number assigned to this object. virtual CORBA::Short number (CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.cpp b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.cpp index f8ead94c273..f583ef93960 100644 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.cpp +++ b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.cpp @@ -16,6 +16,12 @@ FOO_ClientRequestInterceptor::name ( } void +FOO_ClientRequestInterceptor::destroy (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void FOO_ClientRequestInterceptor::send_request ( PortableInterceptor::ClientRequestInfo_ptr ri TAO_ENV_ARG_DECL) diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.h b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.h index f9238e40361..6dd2180d9de 100644 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.h +++ b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.h @@ -57,10 +57,13 @@ public: * methods required for all client request interceptors. */ //@{ - /// Return the name of this ClientRequestinterceptor. + /// Return the name of this ClientRequestInterceptor. virtual char * name (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void send_request ( PortableInterceptor::ClientRequestInfo_ptr ri TAO_ENV_ARG_DECL_WITH_DEFAULTS) diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.cpp b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.cpp index 9382f62e4de..975e89e0d64 100644 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.cpp +++ b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.cpp @@ -3,7 +3,9 @@ #include "FOO_IORInterceptor.h" #include "testC.h" -ACE_RCSID (IORInterceptor, FOO_IORInterceptor, "$Id$") +ACE_RCSID (IORInterceptor, + FOO_IORInterceptor, + "$Id$") char * FOO_IORInterceptor::name (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) @@ -13,6 +15,12 @@ FOO_IORInterceptor::name (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) } void +FOO_IORInterceptor::destroy (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void FOO_IORInterceptor::establish_components ( PortableInterceptor::IORInfo_ptr info TAO_ENV_ARG_DECL) diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.h b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.h index e44a38ddee7..b828827ef6f 100644 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.h +++ b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.h @@ -59,6 +59,10 @@ public: virtual char * name (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); + /// Cleanup resources acquired by this IORInterceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + /// Add the tagged components to the IOR. virtual void establish_components ( PortableInterceptor::IORInfo_ptr info diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp index 3b79baa7eac..2376a251a28 100644 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp @@ -45,6 +45,12 @@ Echo_Client_Request_Interceptor::name (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) } void +Echo_Client_Request_Interceptor::destroy (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Echo_Client_Request_Interceptor::send_poll ( PortableInterceptor::ClientRequestInfo_ptr TAO_ENV_ARG_DECL_NOT_USED) @@ -225,6 +231,12 @@ Echo_Server_Request_Interceptor::name (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) } void +Echo_Server_Request_Interceptor::destroy (TAO_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void Echo_Server_Request_Interceptor::receive_request_service_contexts ( PortableInterceptor::ServerRequestInfo_ptr ri TAO_ENV_ARG_DECL) diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.h b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.h index 6fd281721b9..a9fad3502c8 100644 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.h +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.h @@ -40,9 +40,11 @@ public: virtual char * name (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -98,6 +100,9 @@ public: ACE_THROW_SPEC ((CORBA::SystemException)); // Canonical name of the interceptor. + virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri TAO_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, diff --git a/TAO/tests/README b/TAO/tests/README index e89d9835358..e955d64a30a 100644 --- a/TAO/tests/README +++ b/TAO/tests/README @@ -30,6 +30,11 @@ how to run the following tests: This directory contains several tests for the CDR stream class. + . Codec + + This test verifies that CodecFactory and CDR encapsulation + Codec support is working properly. + . Collocation This program performs a series of sanity check on the @@ -46,7 +51,7 @@ how to run the following tests: A simple test for the DSI/DII gateway support. TAO can optimize some demarshaling/marshaling and data copying in the implementation of DSI/DII based gateways. - + . DynAny_Test Tests TAO's DynAny feature, which allows composition and @@ -64,7 +69,7 @@ how to run the following tests: This tests the methods work_pending() and perform_work() methods of the orb. - . Explosed_Policies + . Exposed_Policies This directory contains a test case used to verify that the client exposed policies get embedded correctly in the IOR |