Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 5 Using the Example Code : SpaceDefMonitor

SpaceDefMonitor
Overview
The SpaceDefMonitor example creates a SpaceDefListener for a metaspace. The listener callback is invoked whenever a space is defined or dropped from the metaspace. The listener callback displays information about the event that caused it to be invoked.
SpaceDefMonitor is only interested in events that affect the definition of spaces in a metaspace. If SpaceDefMonitor connects to a metaspace with existing spaces, it displays information about those spaces when it first starts up, and then displays information about spaces as they are defined in or dropped from the metaspace.
Starting SpaceDefMonitor
The following examples show how to invoke SpaceDefMonitor for each of the API sets.
Java Invocation
java tools.SpaceDefMonitor -metaspace examplems -member_name sdmonitor
C Invocation
SpaceDefMonitor -metaspace examplems -member_name sdmonitor
.NET Invocation
AS_HOME/examples/dotnet/SpaceDefMonitor.exe -metaspace examplems -member_name sdmonitor
Starting SpaceDefMonitor with Security
The following example shows the command line options that you can use when starting SpaceDefMonitor to have it join the security domain exdomain.
-member_name sdmonitor -discovery tcp://127.0.0.1:50000 -security_token exdomain_token.txt
These command line options start SpaceDefMonitor using the default metaspace named ms and allow it to connect to a security domain controller that has been started using the example security policy file example_policy.txt.
Using SpaceDefMonitor
To see output from SpaceDefMonitor, start SpaceDefMonitor, and then start other example programs that define new spaces, such as ASChat or ASOperations to see what is displayed when each program starts up. Exit all example programs, then start up the Admin CLI and enter the following:
as-admin> connect name “examplems” membername “admin”
as-admin> show spaces
For each space displayed by show spaces, do the following and watch what is displayed in the SpaceDefMonitor command window:
as-admin> drop “ASChat”
as-admin> drop “myspace”
as-admin> quit
Enter quit in the SpaceDefMonitor command window to exit the program.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved