Listening to specific keys...

So I currently am going something that was suggested to me earlier for listening on a .NET client for changes on a Tangosol Cache and it's working great. Now I want to go one step further and begin to listen to some specific items in the cache, and not the whole general cache, and I have some questions...
First off, my current listener section looks like this:
cacheListener = new WindowsFormsCacheListener(this);
cacheListener.EntryInserted += new CacheEventHandler(CacheAdd);
cacheListener.EntryUpdated += new CacheEventHandler(CacheUpdate);
cacheListener.EntryDeleted += new CacheEventHandler(CacheRemoved);
theCache.AddCacheListener(cacheListener);
Now I need to see additions to the cache, but I would like to listen to updates only for those things that I subscribe to. So, my question is this: If I change my code to looking something like this:
cacheListener = new WindowsFormsCacheListener(this);
cacheListener.EntryInserted += new CacheEventHandler(CacheAdd);
cacheListener.EntryUpdated += new CacheEventHandler(CacheUpdate);
cacheListener.EntryDeleted += new CacheEventHandler(CacheRemoved);
theCache.AddCacheListener(cacheListener, key1, false);
theCache.AddCacheListener(cacheListener, key2, false);
theCache.AddCacheListener(cacheListener, keyN, false);
will I still get events when something is added to the cache that I have not subscribed to? Or should I not specify a CacheEventHandler for addition to things I know to be in the cache and I want to listen to, and apply JUST a CacheEventHandler to the cache as a whole for when something is added, and just determine whether I want to listen to that new entry, or not... such as:
cacheAdditionListener = new WindowsFormsCacheListener(this);
cacheAdditionListener.EntryInserted += new CacheEventHandler(CacheAdd);
theCache.AddCacheListener(cacheAdditionListener);
cacheListener = new WindowsFormsCacheListener(this);
cacheListener.EntryUpdated += new CacheEventHandler(CacheUpdate);
cacheListener.EntryDeleted += new CacheEventHandler(CacheRemoved);
theCache.AddCacheListener(cacheListener, key1, false);
theCache.AddCacheListener(cacheListener, key2, false);
theCache.AddCacheListener(cacheListener, keyN, false);
Any clarification will be helpful, and thank you!
Edit: Made the code sections bold for easy reading

Hi Kevek,
How do you determine whether or not an item added to the cache is of interest to your application? If you can programatically describe the "shape" of interesting items, you can use the IFilter-based AddMapListener methods to register interest in all items that match a given IFilter. See:
http://wiki.tangosol.com/display/COHNET33/Configuration+and+Usage#ConfigurationandUsage-IObservableCache
For example, the following code will register an ICacheListener which will receive heavy events pertaining to any item keyed by a string that starts with "key":
cache.AddCacheListener(listener, new LikeFilter("getKey", "key%"), false);
Regards,
Jason

Similar Messages

  • Huge performance differences between a map listener for a key and filter

    Hi all,
    I wanted to test different kind of map listener available in Coherence 3.3.1 as I would like to use it as an event bus. The result was that I found huge performance differences between them. In my use case, I have data which are time stamped so the full key of the data is the key which identifies its type and the time stamp. Unfortunately, when I had my map listener to the cache, I only know the type id but not the time stamp, thus I cannot add a listener for a key but for a filter which will test the value of the type id. When I launch my test, I got terrible performance results then I tried a listener for a key which gave me much better results but in my case I cannot use it.
    Here are my results with a Dual Core of 2.13 GHz
    1) Map Listener for a Filter
    a) No Index
    Create (data always added, the key is composed by the type id and the time stamp)
    Cache.put
    Test 1: Total 42094 millis, Avg 1052, Total Tries 40, Cache Size 80000
    Cache.putAll
    Test 2: Total 43860 millis, Avg 1096, Total Tries 40, Cache Size 80000
    Update (data added then updated, the key is only composed by the type id)
    Cache.put
    Test 3: Total 56390 millis, Avg 1409, Total Tries 40, Cache Size 2000
    Cache.putAll
    Test 4: Total 51734 millis, Avg 1293, Total Tries 40, Cache Size 2000
    b) With Index
    Cache.put
    Test 5: Total 39594 millis, Avg 989, Total Tries 40, Cache Size 80000
    Cache.putAll
    Test 6: Total 43313 millis, Avg 1082, Total Tries 40, Cache Size 80000
    Update
    Cache.put
    Test 7: Total 55390 millis, Avg 1384, Total Tries 40, Cache Size 2000
    Cache.putAll
    Test 8: Total 51328 millis, Avg 1283, Total Tries 40, Cache Size 2000
    2) Map Listener for a Key
    Update
    Cache.put
    Test 9: Total 3937 millis, Avg 98, Total Tries 40, Cache Size 2000
    Cache.putAll
    Test 10: Total 1078 millis, Avg 26, Total Tries 40, Cache Size 2000
    Please help me to find what is wrong with my code because for now it is unusable.
    Best Regards,
    Nicolas
    Here is my code
    import java.io.DataInput;
    import java.io.DataOutput;
    import java.io.IOException;
    import java.util.HashMap;
    import java.util.Map;
    import com.tangosol.io.ExternalizableLite;
    import com.tangosol.net.CacheFactory;
    import com.tangosol.net.NamedCache;
    import com.tangosol.util.Filter;
    import com.tangosol.util.MapEvent;
    import com.tangosol.util.MapListener;
    import com.tangosol.util.extractor.ReflectionExtractor;
    import com.tangosol.util.filter.EqualsFilter;
    import com.tangosol.util.filter.MapEventFilter;
    public class TestFilter {
          * To run a specific test, just launch the program with one parameter which
          * is the test index
         public static void main(String[] args) {
              if (args.length != 1) {
                   System.out.println("Usage : java TestFilter 1-10|all");
                   System.exit(1);
              final String arg = args[0];
              if (arg.endsWith("all")) {
                   for (int i = 1; i <= 10; i++) {
                        test(i);
              } else {
                   final int testIndex = Integer.parseInt(args[0]);
                   if (testIndex < 1 || testIndex > 10) {
                        System.out.println("Usage : java TestFilter 1-10|all");
                        System.exit(1);               
                   test(testIndex);               
         @SuppressWarnings("unchecked")
         private static void test(int testIndex) {
              final NamedCache cache = CacheFactory.getCache("test-cache");
              final int totalObjects = 2000;
              final int totalTries = 40;
              if (testIndex >= 5 && testIndex <= 8) {
                   // Add index
                   cache.addIndex(new ReflectionExtractor("getKey"), false, null);               
              // Add listeners
              for (int i = 0; i < totalObjects; i++) {
                   final MapListener listener = new SimpleMapListener();
                   if (testIndex < 9) {
                        // Listen to data with a given filter
                        final Filter filter = new EqualsFilter("getKey", i);
                        cache.addMapListener(listener, new MapEventFilter(filter), false);                    
                   } else {
                        // Listen to data with a given key
                        cache.addMapListener(listener, new TestObjectSimple(i), false);                    
              // Load data
              long time = System.currentTimeMillis();
              for (int iTry = 0; iTry < totalTries; iTry++) {
                   final long currentTime = System.currentTimeMillis();
                   final Map<Object, Object> buffer = new HashMap<Object, Object>(totalObjects);
                   for (int i = 0; i < totalObjects; i++) {               
                        final Object obj;
                        if (testIndex == 1 || testIndex == 2 || testIndex == 5 || testIndex == 6) {
                             // Create data with key with time stamp
                             obj = new TestObjectComplete(i, currentTime);
                        } else {
                             // Create data with key without time stamp
                             obj = new TestObjectSimple(i);
                        if ((testIndex & 1) == 1) {
                             // Load data directly into the cache
                             cache.put(obj, obj);                         
                        } else {
                             // Load data into a buffer first
                             buffer.put(obj, obj);                         
                   if (!buffer.isEmpty()) {
                        cache.putAll(buffer);                    
              time = System.currentTimeMillis() - time;
              System.out.println("Test " + testIndex + ": Total " + time + " millis, Avg " + (time / totalTries) + ", Total Tries " + totalTries + ", Cache Size " + cache.size());
              cache.destroy();
         public static class SimpleMapListener implements MapListener {
              public void entryDeleted(MapEvent evt) {}
              public void entryInserted(MapEvent evt) {}
              public void entryUpdated(MapEvent evt) {}
         public static class TestObjectComplete implements ExternalizableLite {
              private static final long serialVersionUID = -400722070328560360L;
              private int key;
              private long time;
              public TestObjectComplete() {}          
              public TestObjectComplete(int key, long time) {
                   this.key = key;
                   this.time = time;
              public int getKey() {
                   return key;
              public void readExternal(DataInput in) throws IOException {
                   this.key = in.readInt();
                   this.time = in.readLong();
              public void writeExternal(DataOutput out) throws IOException {
                   out.writeInt(key);
                   out.writeLong(time);
         public static class TestObjectSimple implements ExternalizableLite {
              private static final long serialVersionUID = 6154040491849669837L;
              private int key;
              public TestObjectSimple() {}          
              public TestObjectSimple(int key) {
                   this.key = key;
              public int getKey() {
                   return key;
              public void readExternal(DataInput in) throws IOException {
                   this.key = in.readInt();
              public void writeExternal(DataOutput out) throws IOException {
                   out.writeInt(key);
              public int hashCode() {
                   return key;
              public boolean equals(Object o) {
                   return o instanceof TestObjectSimple && key == ((TestObjectSimple) o).key;
    }Here is my coherence config file
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <caching-scheme-mapping>
              <cache-mapping>
                   <cache-name>test-cache</cache-name>
                   <scheme-name>default-distributed</scheme-name>
              </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>          
              <distributed-scheme>
                   <scheme-name>default-distributed</scheme-name>
                   <backing-map-scheme>
                        <class-scheme>
                             <scheme-ref>default-backing-map</scheme-ref>
                        </class-scheme>
                   </backing-map-scheme>
              </distributed-scheme>
              <class-scheme>
                   <scheme-name>default-backing-map</scheme-name>
                   <class-name>com.tangosol.util.SafeHashMap</class-name>
              </class-scheme>
         </caching-schemes>
    </cache-config>Message was edited by:
    user620763

    Hi Robert,
    Indeed, only the Filter.evaluate(Object obj)
    method is invoked, but the object passed to it is a
    MapEvent.<< In fact, I do not need to implement EntryFilter to
    get a MapEvent, I could get the same result (in my
    last message) by writting
    cache.addMapListener(listener, filter,
    true)instead of
    cache.addMapListener(listener, new
    MapEventFilter(filter) filter, true)
    I believe, when the MapEventFilter delegates to your filter it always passes a value object to your filter (old or new), meaning a value will be deserialized.
    If you instead used your own filter, you could avoid deserializing the value which usually is much larger, and go to only the key object. This would of course only be noticeable if you indeed used a much heavier cached value class.
    The hashCode() and equals() does not matter on
    the filter class<< I'm not so sure since I noticed that these methods
    were implemented in the EqualsFilter class, that they
    are called at runtime and that the performance
    results are better when you add them
    That interests me... In what circumstances did you see them invoked? On the storage node before sending an event, or upon registering a filtered listener?
    If the second, then I guess the listeners are stored in a hash-based map of collections keyed by a filter, and indeed that might be relevant as in that case it will cause less passes on the filter for multiple listeners with an equalling filter.
    DataOutput.writeInt(int) writes 4 bytes.
    ExternalizableHelper.writeInt(DataOutput, int) writes
    1-5 bytes (or 1-6?), with numbers with small absolute
    values consuming less bytes.Similar differences exist
    for the long type as well, but your stamp attribute
    probably will be a large number...<< I tried it but in my use case, I got the same
    results. I guess that it must be interesting, if I
    serialiaze/deserialiaze many more objects.
    Also, if Coherence serializes an
    ExternalizableLite object, it writes out its
    class-name (except if it is a Coherence XmlBean). If
    you define your key as an XmlBean, and add your class
    into the classname cache configuration in
    ExternalizableHelper.xml, then instead of the
    classname, only an int will be written. This way you
    can spare a large percentage of bandwidth consumed by
    transferring your key instance as it has only a small
    number of attributes. For the value object, it might
    or might not be so relevant, considering that it will
    probably contain many more attributes. However, in
    case of a lite event, the value is not transferred at
    all.<< I tried it too and in my use case, I noticed that
    we get objects nearly twice lighter than an
    ExternalizableLite object but it's slower to get
    them. But it is very intersting to keep in mind, if
    we would like to reduce the network traffic.
    Yes, these are minor differences at the moment.
    As for the performance of XMLBean, it is a hack, but you might try overriding the readExternal/writeExternal method with your own usual ExternalizableLite implementation stuff. That way you get the advantages of the xmlbean classname cache, and avoid its reflection-based operation, at the cost of having to extend XMLBean.
    Also, sooner or later the TCMP protocol and the distributed cache storages will also support using PortableObject as a transmission format, which enables using your own classname resolution and allow you to omit the classname from your objects. Unfortunately, I don't know when it will be implemented.
    >
    But finally, I guess that I found the best solution
    for my specific use case which is to use a map
    listener for a key which has no time stamp, but since
    the time stamp is never null, I had just to check
    properly the time stamp in the equals method.
    I would still recommend to use a separate key class, use a custom filter which accesses only the key and not the value, and if possible register a lite listener instead of a heavy one. Try it with a much heavier cached value class where the differences are more pronounced.
    Best regards,
    Robert

  • Customer-Specific Key Figure and MCI3 analysis report

    Hi,
    We have created a "Customer-Specific Key Figures" in customizing and mapped the key with value category. But this new defined key figure is not available in the report MCI3.
    How to get this figure in the analysis report MCI3 etc , i.e. how to update the information structure S115.
    Regards

    Hello,
    You have to develope the new programme using that info structure and update that new value field in your customising logic programe .
    Regards,
    Rakesh

  • Assigning instruments to specific keys on a USB keyboard

    Is there a way to assign certain instruments to specific keys on a USB keyboard?
    I use an M-Audio Keystation 49e USB keyboard. It works fine, but I have no experience with MIDI and don't know what the "advanced functions" button on the keyboard allows me to do, although I'm sure with some pointers I can figure it out.
    (Some weeks back xs4ls recommended the JamPack 3 with the Studio Toolkit. Thanks for that recommendation. The stuff really improves upon the stock drumkit software instruments. But in the Studio Toolkit, certain instruments I might like to use together are often located more octaves apart than I can play at one time. The regular kits are generally organized on the keyboard such that I can play them "live" just like I do my actual drumset. This is how I prefer to lay down my drum parts. I'm also interested in assigning drum sounds from a various software kits to save as my own custom kit, if possible.)

    GB3 has a "programmable keyboard" feature that isn't as slick as the stock instruments, but it's better than nothing! (one of the good features of GB3)
    I found a bunch of old Qbert (the video game) noises on line, and created my own instrument with those. Pretty sweet.
    X
    p.s.
    Happy you liked the suggestion. I wish I could take credit for making the Jam Pack......

  • Listening for any key to be pressed?

    I'm writing a small text-based program and when Task #1 finishes,
    it prompts for the user to press any key.
    If any key is pressed, the program proceeds to Task #2 and when it finishes the user needs to press any key again. And so on...
    So how can I listen if any key has been pressed or not?
    Can somebody give me some pointers to some examples dealing with this and which class I should look at?
    Any help would be appreciated.

    your class needs to implement KeyListener, and define 3 methods
    keyPressed
    keyTyped
    and
    keyReleased.
    you will also need some counter to know when to do task 1, task 2 etc.
    so it would look like:
    public class Whatever extends Something implements KeyListener {
         private static int counter = 1;
         public static void main(String[] args) {
         public static void task1() {
              some code
              counter++;
         public static void task2() {
              some code
              counter++;
         public void keyTyped(KeyEvent e) {
              switch(counter) {
                   case 1: task1(); break;
                   case 2: task2(); break;
         public void keyPressed(KeyEvent e) {
         public void KeyReleased(KeyEvent e) {
    }hope this helps!
    Tom

  • Application specific key-value pairs in jndi.properties

    Hello,
    Can I specify my application specific key-value pair in jndi.properties?
    I tried something like this
    java.naming.factory.initial=.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://localhost:7001
    myVar=myVal
    When i tried looking up "myVar" from my client program, I got an error.
    The other parameters like weblogic.jndi.WLInitialContextFactory are picked up.
    Anyhelp will be appreciated
    Vasim

    We have a similar problem.
    We would like to configure our PROVIDER_URL for a specific web application - not
    for the entire server. Since the URL should be different in development, test
    and production environments, we would prefer to just set it in the deployment
    descriptor. And we have a lot of code that just uses
    ctx = new InitialContext();
    when looking up EJBs, queues etc.
    Actually, to take the problem one step further, it should be expected that later
    we will have EJB's deployed on different machines/clusters - so we will actually
    need specific urls for each EJB.
    Is there a good way to do this? Or will we have to custom-develop our own jndi
    configuration standard using application parameters to set which JNDI provider
    each EJB should be looked up with?
    Alternativaely, can we "import" the JNDI trees of the app server in the JNDI tree
    of the web servers?
    So, how should we go about this?
    Robert Patrick <[email protected]> wrote:
    Vasim wrote:
    Hi Robert,
    You are right. But The object "myVar" which I am trying to look upis not in
    the JNDI tree nor am I interesed in binding it . But my requirementis that
    I have one application specific variable which I am trying to lookup and I
    dont want to have a separare config file for this..and hence the question..So, put the properties you want in the jndi.properties file and load
    the properties
    file from your code by doing something like this:
    Properties props = new Properties();
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    if (cl == null)
    cl = System.getSystemClassLoader();
    InputStream is = cl.getResourceAsStream("jndi.properties");
    props.load(is);
    Personally, I would not use this file and would create an application-specific
    file
    or, as Daniel suggested, define your properties as a System property
    and use
    System.getProperty("myVar").
    btw, is jndi.properties only for those objects which are bound to jnditree?
    jndi.properties is only used for creating the JNDI InitialContext. The
    whole idea
    of this file is that in remote client code (without the jndi.properties
    file), you
    need to do something like this to tell the JNDI classes how to connect
    to the JNDI
    provider:
    Properties props = new Properties();
    props.put(Context.PROVIDER_URL, "t3://myservername:7001");
    props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    InitialContext ctx = new InitialContext(props);
    but inside the server, you only need to do this because the server is
    the provider
    and already knows how to connect to itself:
    InitialContext ctx = new InitialContext();
    Therefore, the jndi.properties file allows you to externalize this property-setting
    code that sets up the properties to be passed to the InitialContext constructor
    so
    that the remote client code can now look exactly like the code inside
    the server.
    The InitialContext constructor will look for this jndi.properties file
    in your
    classpath and load it to get the necessary configuration information
    to determine
    how to connect to the JNDI provider.
    Hope this helps,
    Robert

  • Application specific key-value pair in jndi.properties

    Hello,
    Can I specify my application specific key-value pair in jndi.properties?
    I tried something like this
    java.naming.factory.initial=.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://localhost:7001
    myVar=myVal
    When i tried looking up "myVar" from my client program, I got an error.
    The other parameters like weblogic.jndi.WLInitialContextFactory are picked up.
    Anyhelp will be appreciated
    Vasim

    Hello,
    Can I specify my application specific key-value pair in jndi.properties?
    I tried something like this
    java.naming.factory.initial=.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://localhost:7001
    myVar=myVal
    When i tried looking up "myVar" from my client program, I got an error.
    The other parameters like weblogic.jndi.WLInitialContextFactory are picked up.
    Anyhelp will be appreciated
    Vasim

  • WAD question: fix each chart series to a specific key figure

    Hi All,
    I hope you can help.
    In WAD is it possible to fix each series in a chart to a specific key figure from the data provider (query)?
    We need to be able to do this because the opening position of our query has a number of hidden key figures, that are displayed later in navigation.
    Without being able to fix the series to key figures, in the opening view some key figures are appearing as columns rather than lines and vice versa.
    Thanks and regards
    IM

    Thanks for your help, Pcrao.
    My scenario is:
    I have 15 key figures in the columns of my query (data provider).
    The first 12 of these KFs are to be displayed as bars (columns) and the last 3 as lines in the chart of my web query.
    I can set this no problem in WAD.
    But my problem is that because a number of my key figures are set as hide in the query designer (to be unhidden later in navigation) the last three KF's are displaying (incorrectly) as bars until I unhide all KF's in the navigation.
    In other words, it seems to me that I need to fix each series in the chart editing to a specific key figure. But I don't know how.
    Thanks again and regards
    IM

  • Suppress specific key beeing processed

    Hi,
    does anybody now an elegant way of suppressing a specific key? In my case I dont wont the CAPS LOCK Key beeing processed in such way that it is switched on or off. Pressing the Key should be completly ingnored and this should work Application wide not only for one component.
    Any Ideas?
    Thanks.

    If your key is not registered to generate an event I don't see the problem.
    However if what you want is that the key should be completely disabled ie. the caps lock light on your keyboard doesn't turn on then this should probably be done in native code (if it is possible that is without breaking your keyboard :-) ) because I don't think Java can handle such low level tasks...
    By the way are you using? java.awt.event.KeyListener or javax.swing.KeyStroke?
    The latter avoids switch case statements to determine what key has been pressed (if I remember correctly).
    Thanks,
    Nikolas.

  • Card specific keys

    My card implements the mutual authentication. For that purpose the external application and the card must share the set of secret keys. The first key is relevant for encryption and the other for the MAC calculation. At this point I am putting these keys on the card during the personalization. These keys are the same for all cards. Now I am thinking is this secure enough. I read that it is recommended to use derived (card specific) keys such that only one card is affected if a key is compromised. How can I calculate the card specific keys? If I will have this, then if someone finds out the initial secret keys and the algorithm how the card specific keys are made, then the card is again compromised. Right?

    You said that the random key is more secure way. You mean that during the personalization I can generate random key on the card. The operating system takes care of the security of such object. But, this random key has to be shared with the external party which is communicating with the card. Both of them need it in order to establish the secure channel. At some point it has to be extracted and given to the terminal side. Right? Or the random key has to be generated on the perso dll during the personalization. Then the outside world has to have some kind of lookup table in which the relation token serial number, random key has to be stored and before executing the mutual authenticate method, the external party has to for the particular token serial number extract its random key. What if the secure channel has to be made from the middleware API that is installed on the user’s PC. If the lookup table is stored somewhere like HSM it is impossible use case because the user’s PC is located in his home. With random keys, each key would be generated at perso time and injected into the card manager with PUT KEY over a secure channel. You could use the unique card identifier as the label for the key in the HSM so there is no lookup table. You could use the same data you would use to diversify a key since it should also be unique. I am assuming you have some way of having a connection back to a HSM from the middleware? If not, this model sounds worrying to me. If you have your keys exposed to every client client then you are opening up a security risk. You can assume the client machine is secure.
    You said:
    It is easier to secure a single set of master keys (and rotate as required) that are used like this than a master key that is shared
    I did not understand how this will work. In case of mutual authenticate method. The external party is using one master secret key from the set of secret key set. When the command comes to the card, the card has to verify it. But how the card knows with which key the message is encrypted.If you have keys in a HSM you need some way of knowing what key to use. You could map cards to a master key. Some security organisations recommendations on key rotation and usage policies which are designed to limit the exposure of sensitive keys. It adds overhead but you gain additional security (if a key is compromised only a limited number of your cards are compromised).
    Cheers,
    Shane

  • Open RegEdit to a Specific Key

    I have searched and tried various solutions (vbs, bat), but none seem to work properly.  I am simply looking for a script (or technique) that will enable me to open RegEdit on a specific key.  It will be used on WinXP and Win7 machines (x86 and
    x64).
    Any help is appreciated.

    use reg.exe to set the LastKey value, then open regedit.
    reg add hkcu\software\microsoft\windows\currentversion\applets\regedit /v lastkey /d "My Computer\HKEY_CURRENT_USER\Software
    \Microsoft\Windows\CurrentVersion\Applets\Regedit"
    start regedit.exe
    Change the bit after the /d to whichever key you want to open to.
    If you're not sure how to format the string, then open regedit, go to the key you want to open to, then close regedit. Run the reg query below to get the exact string.
    reg query hkcu\software\microsoft\windows\currentversion\applets\regedit /v lastkey

  • Getting a Behavior class to respond to specific key presses

    Hello,
    My Problem is this:
    I have a keyboard behavior class which extends the behavior class, i want the behavior to wakeupOn a specific key press, ie KeyEvent.VK_UP, however, the class will only seem to respond to the the KEY_PRESSED, KEY_RELEASED and KEY_TYPED variables.
    Any help on how to get the behavior to wake up on specific key presses would be gratefull.
    Paul

    The normal event model, as far as I can tell, is to wake up on keypressed and then check which key it was that has been pressed and respond accordingly.

  • Listener for Unique Key in coherence Cache

    Hi Experts,
    I am using Oracle Coherence in one of my project and I am facing a Performance issue .Here is my scenario,
    Thie is my Coherence cache structure
    UniqueKey         <Hive data>
    D1                     Hive Data1         
    D2                     Hive Data2
    D3                     Hive Data3
    Each Unique Key is for user Session. My application is a single Sign on with multiple applications involved.
    The Coherence cache can be updated by any application/sub applications. When ever there is a change in my a user hive Data I need to update. My current implementation is
    I get all the data (Map) from the Coherence Cache (Named Cache).
    Look for the specific user's key
    Hence there is a performance issue when ever i retrieve/set the hive data
    Is there a default Listener/methodology which I can use in Oracle Coherence ?

    Thanks Jonathan for your timely response will look into the Map event, but just a quick question
    Map<Object, Map<Object, Object>> updateUserData = (HashMap) namedCache.get(uniqueKey);
    So this is how i retrieve the user data from the NamedCache. What it returns is a Map .....and any change to this current daykey is what the user is worry about.
    The addListener() on the ObservableMap will  start to listen on any event happening at the all key in the namedCache.I am looking for something like a listener/logic which looks only the for this uniqueKey for this user session.
    Will look into the Map Event in detail.
    Thanks Again,
    Sarath

  • Vb 2012 use regex to substitute specific key words with specific replacements

    I am creating a VB 2012 application in which I have a two-dimensional array containing a collection of specific (but case-insensitive) key words with their replacement words.  I also have a very large series of String variables which I read sequentially
    from a .CSV file.
    What I want to do is to efficiently parse each String variable searching for any occurrence(s) of the Key words held in the array and substituting with their replacement.
    I know I can use "standard" VB code to do this but my instinct tells me that using Regular Expressions might be far more efficient.
    Never having attempted to use Regular Expressions before, but having just spent several hours attempting to research the subject online, I know I need some help, please.
    Any advice or guidance will be gratefully received.
    Paul J

    Hello,
    The 'Suggestions and Feedback for the Forums' forum is to give users a voice on Forums. Users can give suggestions for improvements or vote up suggestions and know that the Forums team is listening.
    I'd ask in the
    Visual Basic .Net Language forum on MSDN.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Organizing and listening to specific playlists completely..

    I want to listen to my music by folder/genre. As in if I have a classic rock folder/playlist, I want to be able to select that "folder" on my ipod and listen to all the music I have denoted as "classic rock" then maybe move onto "pop" folder and listen to all the music that I have loaded as pop. I don't like how my ipod randomly plays/chooses the music I listen to.. The first song might be rock, the next pop, and so on. Can anyone please tell me how to organize and listen to my music by folder or genre.
    When I download my music it gets assigned a specific name, usually with numbers. I know that it's for example a 38 special song, so I put into my classic rock folder on itunes. When I turn on my ipod and go to my classic rock folder, the song is not there.
      Windows XP  

    iTunes organizes songs into folders by Artist -> Album
    Do you mean it is in a playlist you created in the Source on the left side of iTunes?
    If you want to play a specific Genre, on the iPod select Music -> Genre, select the one you want and press pplay.

Maybe you are looking for

  • HP Laserjet Printer and Vista

    I bought a new HP color LaserJet Pro MFP M277dw yesterday.  I took it home and hooked it up and tried to run the setup disk on my HP laptop with Windows Vista.  The disk said it was not compatible with Vista.  The existing software on my computer I'v

  • Using text in FCPX bringing my system to a crawl

    I have the latest and greatest iMac with the fastest graphics card and 32 GBs of RAM, but since the last update any time I place text on the timeline my system slows to a crawl. I'm using the company font (Bliss 2), which has never caused me problems

  • HT201269 how can i restore my iPad?

    how can i restore my iPad?

  • IPhoto 6 Not ready for primetime

    I've had it with iPhoto 6! The program seems to have been released before it was ready. . . I've had numerous problems that have caused me to lose work and have made my entire system seem unstable (hello spinning beach ball!). The first problems occu

  • Safari 3.1.2 'unexpectedly' quits more than 3.1.1 (report attached)

    So, after trying every fix here for 3.1.1 w/ no success and patiently waiting for 3.1.2 in hopes of fixes, and then repeating same after installing 3.1.2, I'm nearly computer-induced hari-kari. Today I've been given the boot four times, three of them