BEA Logo BEA BEA Tuxedo Release [Release Number]

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   BEA Tuxedo Doc Home   |   Using CORBA Request-Level Interceptors   |   Previous Topic   |   Next Topic   |   Contents   |   Index

InterceptorSimp Sample Interceptors

 

This topic includes the following sections:

Before trying out the steps described in this chapter, make sure you have completed all the steps described in PersonQuery Sample Application.

 


How the PersonQuery Sample Interceptors Work

The InterceptorSimp sample interceptor shows how the operation in a request passed to an interceptor can be accessed via a RequestContext object. When the InterceptorSimp sample intercepts a request, the interceptor does the following:

Assuming a successful call to the interceptor, the client invocation is passed onto the target object and serviced in the usual way. Thus the InterceptorSimp sample interceptor shows the following:

The InterceptorSimp sample interceptor also shows two different interceptors being defined and registered, but implemented in a single source file. In this example, the client and target interceptors are registered separately, with the client interceptor initialized first.

 


Registering and Running the PersonQuery Interceptors

When you run the makefile that builds the PersonQuery sample application in PersonQuery Sample Application, the entire set of sample interceptors are built as well, including the InterceptorSimp interceptor. This section describes how to register the InterceptorSimp interceptor so that it works with PersonQuery application at run time.

To register and run the InterceptorSimp client and server interceptors:

  1. Change directory to the InterceptorSimp sample directory, where workdirectory represents the name of the directory into which you copied the interceptor sample applications in PersonQuery Sample Application.

    Windows 2000

    > cd <workdirectory>\cxx\simple_cxx

    UNIX

    $ cd <workdirectory>/cxx/simple_cxx

  2. Register the interceptor:

    Windows 2000

    > nmake -f makefile.nt config

    UNIX

    $ make -f makefile.mk config

  3. Boot the CORBA server and run the client:

    Windows 2000

    > cd <workdirectory>\cxx\app_cxx
    > tmboot -y
    > PersonQueryClient

    UNIX

    > cd <workdirectory>/cxx/app_cxx
    > tmboot -y
    > PersonQueryClient

  4. Perform any number of invocations using the PersonQuery client application, using the command syntax described in PersonQuery Sample Application.

  5. Stop the PersonQuery application:
    > tmshutdown -y

 


Examining the Output of the Interceptors

The output from the simple client interceptor is in files named with the following syntax:

InterceptorSimpClientxxxx.out

In the preceding syntax line, xxxx represents the process ID of the executable within which the interceptor ran. For example, there are three InterceptorSimpClientxxx.out files; one each for the following:

The content of each file varies according to how the ORB interacted with the executable. For example, target interceptors run on servers and client interceptors run on clients, so the InterceptorSimpClient log files typically have very little output from the target interceptor, but it has more output from the client interceptor.

 


Unregistering the Interceptors

After you have run the PersonQuery sample application with the InterceptorSimp sample interceptors, you can unregister those interceptors using the following steps:

  1. Shut down all running CORBA applications by entering the following command:
    > tmshutdown -y

  2. Unregister the interceptors.

Unregistering the Interceptors

To unregister the InterceptorSimp client and server interceptors:

  1. Change directory to the InterceptorSimp sample directory, where workdirectory represents the name of the directory into which you copied the interceptor sample applications in PersonQuery Sample Application.

    Windows 2000

    > cd <workdirectory>\cxx\simple_cxx

    UNIX

    $ cd <workdirectory>/cxx/simple_cxx

  2. Unregister the interceptors:

    Windows 2000

    > nmake -f makefile.nt unconfig

    UNIX

    $ make -f makefile.mk unconfig

 

back to top previous page next page