Best way to increment value in cluster?  something like ReflectionUpdater?

I have objects stored in my cluster and I wonder what the fastest way to increment an integer member variable is, both atomically and non-atomically?
Thanks,
Andrew

Hi Andrew,
For example:
import com.tangosol.util.Base;
import com.tangosol.util.processor.NumberIncrementor;
import com.tangosol.net.CacheFactory;
import com.tangosol.net.NamedCache;
import java.io.Serializable;
public class Main extends Base implements Serializable
    int m_iValue;
    public int getValue()
        return m_iValue;
    public void setValue(int iValue)
        m_iValue = iValue;
    public String toString()
        return "Main[iValue=" + m_iValue + "]";
    public static void main(String[] asArg)
        try
            NamedCache cache = CacheFactory.getCache("test");
            Object oKey = "foo";
            cache.put(oKey, new Main());
            System.out.println(cache.get(oKey));
            cache.invoke(oKey, new NumberIncrementor("Value", makeInteger(1), false));
            System.out.println(cache.get(oKey));           
        catch (Throwable oops)
            err(oops);
        finally
            CacheFactory.shutdown();
    }Regards,
Dimitri

Similar Messages

  • What is the best way to connect a firewall cluster to a VPC domain

    Hi All
    Can anyone help me decide what is the best way to connect a firewall cluster to a VDC running in a pair of N7K's which is a VPC domain?  
    Can I configure a VLAN interface on each VDC and use HSRP?  I was planning on presenting one 10GB cable from each VDC to each firewall.  Would this work OK?  HSRP traffic will go across the VPC peer link correct?
    thanks all

    No, but the one caveat is vpc orphan ports. If the vpc link between the nexus switches fails for any reason, all the vpc ports on the vpc secondary switch will be forced down. So it's recommended to connect single port devices to the primary vpc switch so the connections stay up. But if you're ok with that, then I don't see any problems.
    You have a few options, one would be to run a separate link between your nexus switches for non-vpc vlans. These vlans would not be allowed over the vpc peer-link, or forwarded out vpc's.
    See here page 49 :
    http://www.cisco.com/c/dam/en/us/td/docs/switches/datacenter/sw/design/vpc_design/vpc_best_practices_design_guide.pdf

  • The best way to insert values in a Nested Table

    Hi!
    I want to insert values from a SQL-query in a Nested Table.What's the best way to do it?
    In addition,the only way that I've found is doing a query and when I've got the query result I insert it into the Nested Table.For instance:
    FOR cur_row IN (SELECT id,nstreet from example Where id=3) LOOP
    --here I'm inserting the values of the query in the nested table.
    -- VarNestedTable is a Nested Table of Row_Type.
    --Row_Type is an object with two fields:Id,Nstreet
    VarNestedTable.extend;
    VarNestedTable(Coincidents.Last):= Row_type(cur_row.id,cur_row.nstreet);
    END LOOP;

    How to Use Tables: Creating a Table Model.
    very bad example:
    class DataObject {
    String name, age, numberOfMonkeys;
    class DOTableModel extends AbstractTableModel {
      final String[] COLUMN_HEADER = { "Name", "Age", Monkeys" };
      List dataObjects;
      public String getColumnName(int column)  {
         return COLUMN_HEADER[ column ];
      public int getRowCount() {
        return dataObjects.size();
      public int getColumnCount() {
         return COLUMN_HEADER.size();
      public Object getValueAt(int row, int column) {
         DataObject do = dataObject.get( row );
         switch( column ) {
           case 0: return do.name;
           case 1: return do.age;
           case 2: return do.numberOfMonkeys;
    }

  • Best Way To Set values In Items

    Hello,
    I have a two database items and dynamically I would like to assign values to those items.
    What is the best way of accomplishing this task?
    Is there any SET property available or I need to like
    block_name.item_name :='Value'
    Regards

    You can use COPY built-in to perform dynamically assign values to different items.

  • Best way to swap values between 2 lists?

    I want tne user to be able to view s seperate lists of strings ( Via a dropdown combo, a scrollpane or similar ) and allow them to remove a value from one list and swap it over into another list and vice versa.
    What is the best way to implement this?

    Sorry, I should have been more specific. It's on a
    GUI, User is presented with 2 lists/tables of values
    and can select one or more on the first list and
    "move/pop" them over to the other list with a button
    click.?
    Well what can I say, remove it from list/table A and add the deleted item in list/table B.
    If you could post some code where you can show you're trying to do this, but failed, then perhaps you'd a more concrete answer.
    JList examples from the Javaalmanac:
    http://www.google.com/custom?domains=exampledepot.com&q=JList&sa=Google+Search&sitesearch=exampledepot.com&client=pub-6001183370374757&forid=1&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A1%3B&hl=en
    JTable examples from the Javaalmanac:
    http://www.google.com/custom?hl=en&ie=ISO-8859-1&oe=ISO-8859-1&safe=off&client=pub-6001183370374757&cof=FORID%3A1%3BGL%3A1%3BLBGC%3A336699%3BLC%3A%230000ff%3BVLC%3A%23663399%3BGFNT%3A%230000ff%3BGIMP%3A%230000ff%3BDIV%3A%23336699%3B&domains=exampledepot.com&q=JTable&btnG=Search&sitesearch=exampledepot.com
    JList tutorial from Sun:
    http://java.sun.com/docs/books/tutorial/uiswing/components/list.html
    JTable tutorial from Sun:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • Best way for lookup values

    I have a country abbreviation being passed as a parameter and want to know what the best way to do a look up in a view object that maps country codes to full country names if all I want to do is display that value on a report. Can anyone point me on the right track for the best way to do this?
    Thanks

    Hi,
    You can create a static VO where you can define the following parameters:
    ID:
    LookupType:
    LookupCode:
    LookupValue:
    In this, you can define LookupCode as Country Code and LookupValue as County Value. ID is the key attribute.
    And, in the VO from which you are getting the Country, go in the Edit LOV and under UI hints, put ID, LookupType, LookupCode under Available and LookupValue under Selected.
    hope it helps.

  • Best way to pass values btwn servlets?

    i have to pass multiple values from one servlet to the next, when the user submits a form.
    i don't know how many, or even the names of the parameters until the user submits the form.
    right now, i send them as hidden fields when the form is submitted.
    in the receiveing servlet, i dump them into a hashtable usng httpUtils.parse QueryString, and then parse them out of the hashtable.
    is there a better way?
    TIA,
    Scott Murray

    DrClap,
    Yes, I am working with a single user.
    Last night I reworked it as follows, dumping the parameters into a Properties object, which is easier to work with than a hashtable (at least it is for me):
    Properties props = new Properties();
    Enumeration paramNames = req.getParameterNames();
    while (paramNames.hasMoreElements()) {
    String name = (String) paramNames.nextElement();
    String[] values = req.getParameterValues(name);
    props.setProperty (name, values[0]);
    The trick is that I don't know in advance the names or how many parameters are being received; I marked them on the sending page with different prefixes (@@@, ###, $$$) so as I parse thru the Properties object, I can determine what type of parameter it is.
    Is there a better object to use than the Properties object? My ultimate goal is to have something similar to a ResultSet that I can search and step thru multiple times.
    Thanks for you time and expertise,
    Scott Murray

  • Who Column - What is best way to put value in who columns

    Hi,
    I have a custom concurrent program that is inserting values in a custom database table. Now I have to update that table to enter *'who columns'*. I have updated table but now get confused when I need to enter values in those 'who columns'.
    Now I have two option: 1) change package body used by concurrent program to insert values of who column. 2) put trigger on the table to put who columns values on insert/update
    Now my question is that which is better and standard option in EBS and why????
    Do we have already existing 'who trigger' in EBS that I can reuse???
    Please help me to find answer.
    Thanks,
    Faried

    Hi Faried,
    It is always suggested to avoid triggers wherever possible. Its easy to implement the logic of updating who columns in the concurrent program and you will have one less thing (trigger) to maintain.
    As far as a prebuilt who trigger is concerned, there isn't anything available for a pl/sql program. If you are coding a custom form through which you want to update a who column of a table, there is a standard api (FND_STANDARD.SET_WHO), that comes from template.fmb which takes care of updating the who columns. However, for a custom concurrent program, there isnt anything like that. You will just have to add these columns in your insert/update statements.
    Thanks
    Vijay

  • Best way to make a burn out effect like in this film?

    I am trying to figure out how to make the same kind of film burn out effect like this short film has in the beginning.
    Check out the beginning of this short film. The yellow/red burn outs that are on the first couple of clips, what is the easiest way to make them in Motion (or FCP)?
    I've been fumbling a bit with the "Cool" emitter in Motion, but can't get the same feel.
    Please give me some tips, if you can.
    Oh and here is a link for the short film I am referring to:
    http://frenchquarterfeatures.com/movies/eighteen_seconds.640.mov
    Thanks in advance...

    The effect emulates fogging of the film, as if someone opened the camera before the film had been taken up onto the reel or into the magazine.
    I'd download that clip, convert it to a useable format and play with keying filters till I got mostly the flashes. Then I'd start adding masked layers and shapes to fill in the rest or to cover up residual hunks of the film's stars. Precompose or render. This will give you a place to start. Use it to blend in a moving red-yellow image.
    Or look at ARTBEATS site and see what they've got for film burn effects (not Ken Burns effects). I'll be tthta's where this filmmaker got his/hers.
    bogiesan

  • I want to create a TTL pulse. The stepper motor I'm trying to control responds to a high to low edge, when the low pulse width is greater than 0.5 microsecon​ds. What is the best way to go about creating a pulse like this?

    I'm using the NI PCI-6025E card connected to an SCB-100 wiring peripheral. I'm programming the DAQ card using LabVIEW 6.0.2 on a win95 box.
    My first attempt has yielded some surprising results.
    I created a vi with a single while loop set to true. Within that while loop is a two frame sequence. Both frames use the "Write to Digital Line.vi".
    The first frame sets the line in wire to false.
    The second frame sets the line in wire to true.
    The device channel on both frames has been set to my user defined channel nam
    e -> clock.
    clock --> sets the DIO0 channel to be digital write out.
    Using an oscilloscope and some wires I hook ground to the SCB-100's digital ground and I hook the probe to the DIO0 channel. What I see are two different pulses alternating between one another. One has a pulse width of 5ms and the other has a pulse width of about 50ms. You seem to get a grouping of one type of pulse followed by a grouping of the other type of pulse.
    Obviously this is very strange and not what I want. It is also far too slow. So I'd like to know if anyone knows how to do this properly. Remember I only need a low pulse width of 0.5 microseconds.
    Thanks,
    Any help or guidance would be much appreciated.
    Scott

    Scott,
    You don't need to use a digital line to create a TTL pulse. The PCI-6025E has two onboard general purpose counters. You can use one of these counters to create a single pulse of the desired pulse width. For an example of how to program the counters on your board, refer to LabVIEW's Search Examples>>I/O Interfaces>>Counters>>Pulse Generation>>DAQ-STC based.
    The advantage of using a counter over the digital line is that it allows you to control the timing of the pulse through hardware and not software. Thus, it is inherently faster, and the timing resolution is more accurate. The counter will count down an internal 20 MHz timebase to create the pulse delay and the pulse width.
    For more information on the hardware capabilities of your board, you can refe
    r to the User Manual online at www.ni.com/manuals.
    Hope this helps.
    Regards,
    Erin

  • What is the best way to export my project to view like a regular movie?

    Please Help

    This should get you pointed in the right direction:
    http://forums.adobe.com/thread/729526
    Because you're new to After Effects, I strongly recommend that you start here to learn After Effects: http://adobe.ly/bjBT3P

  • Best way of removing color from image

    Hey Adobe Community,
    I'm Aaron. I have this image here: https://www.dropbox.com/s/zjpjq5mf8t02pn9/chimera1-Recovered.jpg
    What I'm trying to do is create an outline for a pattern, something like the hot dog in the pattern here: https://m1.behance.net/rendition/modules/59556275/disp/36d76e9e0f33274e8a75ea77fd69b731.jp g
    Anyone know if this is possible and what is the best way of doing it? I'd like to keep the outline throughout the whole design of the chimera. Doesn't matter how tedious , I just need some ideas.

    I know of no good way to do this in Photoshop.
    The quickest way I know is to place the original photo in Illustrator, reduce the opacity of it somewhat, and use the pen tool on another layer to draw what you want. Depending on the nature of the image, it can be tedious, but you don't mind that.  :+)
    Good luck.

  • Best way to sync iphone and ipod touch

    I have had an ipod touch for some time and have just got an iphone. Ideally I want to keep the ipod touch for music, games etc and use the phone purely for internet, phone etc and maybe a couple of cd's on there. Is there a best way to sync them both - ie something I should make sure I tick when I set up the iphone or will it handle it automatically.
    Thanks
    nick

    iTunes on your computer will keep them separate. I have 2 iPhones and 1 iPod Touch all syncing to the same computer, with different playlists, apps, contact groups, etc., on each of the devices.

  • How to auto increment values in an XSL

    Hi all,
    Is there any way to increment values in an XSL in the Jdeveloper.

    Hi David,
    Check out implementing any of following BADIs.
    ECRM_ISU_BPSEARCH
    CRM_IC_BP_SEARCH
    BUS_LOCA_HIDE_SEARCH
    CRM_ORDERADM_SCENARI
    CRM_ORDER_FIELDCHECK
    Thanks,
    Faisal

  • Best way to create slide show with last photo having links

    What are some of the best ways to create a slide show (more like a season greeting flash) with the last photo having links and buttons for the viewer to click?
    I already have the code for the slide show. What I need now is how do I reference or point to a keyframe that contains the last slide as the background with buttons and hyperlinks? Perhaps, I also need a way to not showing this slide until the last? How do I do that? This last slide with buttons and links are on it's own layer.
    The other route would be to create the buttons and hyperlinks in the AS3 code instead of design time. If so, how do I do on the last slide?

    What are some of the best ways to create a slide show (more like a season greeting flash) with the last photo having links and buttons for the viewer to click?
    I already have the code for the slide show. What I need now is how do I reference or point to a keyframe that contains the last slide as the background with buttons and hyperlinks? Perhaps, I also need a way to not showing this slide until the last? How do I do that? This last slide with buttons and links are on it's own layer.
    The other route would be to create the buttons and hyperlinks in the AS3 code instead of design time. If so, how do I do on the last slide?

Maybe you are looking for

  • Search and replace strings in a file while ignoring substrings

    Hi: I have a java program that searches and replaces strings in a file. It makes a new copy of the file, searches for a string in the copy, replaces the string and renames the new copy to the original file, thereafter deleting the copy. Now searching

  • Problem with CD-Rom Mount point ( Oracle 8.1.5 for Linux )

    I try to create database using dbassist ( copy from CD method But I receive error message about "Can not detect CD-ROM'. Where should I use as my CD-Rom muont point ? null

  • Change item category of a GL account

    Hi All, We need to change the item category of a G/L account from 04000-cash account to 01000-Balance sheet account. While configuring this, I got a warning message which indicates that problems may occur in the target system after the transport. Ple

  • [SOLVED] Cannot mount usb (as normal user)

    Hello I'm facing this problem for the first time, but can't tell if it came after an update or an unexpected reboot (light went out). I'm using latest kde (4.9.2?), and the latest kernel, Linux gantz 3.6.6-1-ARCH #1 SMP PREEMPT Mon Nov 5 11:57:22 CET

  • Central System Monitoring Issue

    Dears, I have configured system Monitoring but when i go in DSWP-> solution Monitring->System Monitoring. Then after monitoring Daily tasks are getting done and get invisible from the list and get unavailable but but after performing monitoring of  h