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


Chapter 5 Using the Example Code : ASListener

ASListener
Overview
The ASListener example creates a listener for a space. The listener callback is invoked whenever a put, take, expire, seed, or unseed event occurs for an entry in the space. The listener callback displays information about the event that caused it to be invoked.
The ASListener example does not create any entries in the space. Therefore you should run ASOperations to create the space and put data into it so you will have something which triggers the ASListener example. he space and put data into it so you will have something in the space to “browse.” See ASOperations for more specific information on running ASOperations.
The ASListener example recognizes the following additional command line arguments:
-filter “” | _string where: “”=no filter (default)
-distribution_scope all | seeded (default: all)
-timescope snapshot | all | new | new_events (default: new)
Starting ASListener
The following examples describe how to invoke ASListener for each of the API sets.
Java Invocation
java tools.ASListener -metaspace examplems -member_name listener
C Invocation
ASListener -metaspace examplems -member_name listener
.NET Invocation
ASListener -metaspace examplems -member_name listener
Starting ASListener with Security
The following example shows the command line options that you can use when starting ASListener to have it join the security domain exdomain:
-member_name listener -discovery tcp://127.0.0.1:50000 -security_token exdomain_token.txt
These command line options start ASListener 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 ASListener
By varying the additional command line arguments of the ASListener example, you can affect the behavior of ASListener. For example, to cause ASListener to display all entries added to the space, start ASListener with the following additional command line option:
-timescope all

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