This example creates a notification-style log. It uses a filter to ensure that only log records which contain a string message are written to the log store.
From this example, you will learn how to:
resolve
resolves initial references to the notify log factory,
narrows it, and lists the logs it contains.
create
is used to create a notify log.
setFilter
sets a filter on the notify log.
connect
connects a supplier to the notify log.
generate
generates a number of log messages
disconnect
is used to disconnect the supplier from the proxy.
disconnect_push_supplier
lets us know when the proxy has
been disconnected.
subscription_change
informs the user when the subscription
type has changed.
This class has only one method, the main
method, and is used to
create a Notify
object and call the methods described above. This class runs the example.
These instructions are based on the Solaris gcc3.2 compiler makefiles.
ACE_ROOT=<TAO_install_dir>; export ACE_ROOT
TAO_ROOT=<TAO_install_dir>; export TAO_ROOT
SHLIB_PATH=$TAO_ROOT/lib; export SHLIB_PATH
LD_LIBRARY_PATH=$TAO_ROOT/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
PATH=$PATH:$TAO_ROOT/bin; export PATH
INSLIB=$TAO_ROOT/lib; export INSLIB
PATH=/usr/local/gcc-3.2/bin:/usr/ccs/bin:$PATH; export PATH
LD_LIBRARY_PATH=/usr/local/gcc-3.2/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
<TAO install dir>/examples/cc
directory.
make
command to run the makefile. This will compile all of the OpenFusion examples.
TAO_ROOT=<TAO_install_dir>
,
where TAO_install_dir
is the location into which you have installed TAO.
<TAO install dir>\examples\cc\cc.dsw
. Double-click on the project file to load
it into
Microsoft Visual C++. When loaded, change the Common project from debug
mode to release mode using the Build | Set Active Configuration menu option.
UNIX: Ensure that the
environment variable LD_LIBRARY_PATH
includes the path to where
the common files and the Notify Log examples files were compiled
(<TAO install dir>/cc/Common
and
<TAO install dir>/cc/Log/notify
):
LD_LIBRARY_PATH=<TAO install dir>/cc/Common:<TAO install dir>/cc/Log/notify:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
Change to the <TAO install dir>/examples/cc/Log/notify
directory.
Windows NT: Start a DOS window. Ensure that your path contains:
<TAO
install dir>\bin;<TAO install dir>\examples\cc\bin
Ensure that the OpenFusion Log Service is running. To run the OpenFusion Log Service you must first install the OpenFusion TCS - JacORB with OpenFusion CORBA Services distribution. This can be obtained from the downloads page by following the OpenFusion CORBA Products software link.
Start the client:
NotifyLogExample -ORBInitRef NotifyLogFactory=file://<OF_INSTALL_DIR>/domains/OpenFusion/localhost/LogService/NotifyLogFactorySingleton/NotifyLogFactorySingleton.ior
(where OF_INSTALL_DIR
is the OpenFusion TCS - JacORB with OpenFusion
CORBA Services installation directory).
The client will write some log messages to the Notify Log and then exit. Use the GUI tools provided for the OpenFusion Log Service to inspect the Log.