Thoughts on adding ConcurrentMap methods to StoredMap?

as far as i can tell, StoredMap has the potential to implement the extra methods in the jdk 1.5 ConcurrentMap interface. Database already has a putNoOverwrite method which would be the implementation of putIfAbsent. Personally, however, i am more interested in the other methods, all of which basically do their work only if the current value matches a given old value. this enables safe concurrent updates to a StoredMap even outside of transactions, basically using an optimistic scenario:
- read existing key,value (hold no locks)
- copy current value and modify the copy
- write modified value only if current value matches what is now in the database (this line within the context of a RMW lock)
any idea if this could be incorporated in the je codebase anytime soon? i may end up implementing it in our codebase, although the je api is not easy to extend as most classes/useful methods are package protected (arg!).

hey,
just wanted to follow up on this a little. after using the concurrent implementation for a while (with transactions enabled), i experimented with extending the api to add a "transaction-like" extension to the concurrentmap api. this basically blends the concurrentmap api with the option of better performance when transactions are enabled in the underlying bdb. there are three methods added, which basically allow for "locking" a given key and "committing" or "rolling back" the updates as appropriate (if transactions are not enabled, the new methods are largely no-ops, and you get normal concurrent map behavior). thought i'd post the new code in case you were interested in providing this facility to other users (or, you could just stick with the original version posted above).
Example usage:
Object key;
try {
  Object value = map.getForUpdate(key);
  // ... run concurrent ops on value ...
  map.replace(key, value, newValue);
  map.completeUpdate(key);
} finally {
  map.closeUpdate(key);
}New implementation:
public class StoredConcurrentMap extends StoredMap
  private final ThreadLocal<UpdateState> _updateState =
    new ThreadLocal<UpdateState>();
  public StoredConcurrentMap(
      Database database, EntryBinding keyBinding,
      EntryBinding valueEntityBinding, boolean writeAllowed)
    super(database, keyBinding, valueEntityBinding, writeAllowed);
  public Object getForUpdate(Object key)
    if(_updateState.get() != null) {
      throw new IllegalStateException(
          "previous update still outstanding for key " +
          _updateState.get()._key);
    UpdateState updateState = new UpdateState(key, beginAutoCommit());
    _updateState.set(updateState);
    DataCursor cursor = null;
    Object value = null;
    try {
      cursor = new DataCursor(view, true, key);
      if(OperationStatus.SUCCESS == cursor.getNextNoDup(true)) {
        // takeover ownership of the cursor
        value = updateState.loadCurrentValue(cursor);
        cursor = null;
      closeCursor(cursor);
    } catch (Exception e) {
      closeCursor(cursor);
      throw handleException(e, false);
    return value;
  public void completeUpdate(Object key)
    UpdateState updateState = getUpdateState(key);
    if(updateState != null) {
      try {
        updateState.clearCurrentValue(this);
        commitAutoCommit(updateState._doAutoCommit);
        // only clear the reference if everything succeeds
        _updateState.set(null);
      } catch(DatabaseException e) {
        throw new RuntimeExceptionWrapper(e);
  public void closeUpdate(Object key)
    UpdateState updateState = getUpdateState(key);
    if(updateState != null) {
      // this op failed, abort (clear the reference regardless of what happens
      // below)
      _updateState.set(null);
      try {
        updateState.clearCurrentValue(this);
        view.getCurrentTxn().abortTransaction();
      } catch(DatabaseException ignored) {
  public Object putIfAbsent(Object key, Object value)
    UpdateState updateState = getUpdateState(key);
    if(valueExists(updateState)) {
      return updateState._curValue;
    Object oldValue = null;
    DataCursor cursor = null;
    boolean doAutoCommit = beginAutoCommit();
    try {
      cursor = new DataCursor(view, true);
      while(true) {
        if(OperationStatus.SUCCESS ==
           cursor.putNoOverwrite(key, value, false)) {
          // we succeeded
          break;
        } else if(OperationStatus.SUCCESS ==
                  cursor.getSearchKey(key, null, false)) {
          // someone else beat us to it
          oldValue = cursor.getCurrentValue();
          break;
        // we couldn't put and we couldn't get, try again
      closeCursor(cursor);
      commitAutoCommit(doAutoCommit);
    } catch (Exception e) {
      closeCursor(cursor);
      throw handleException(e, doAutoCommit);
    return oldValue;
  public boolean remove(Object key, Object value)
    UpdateState updateState = getUpdateState(key);
    if(valueExists(updateState)) {
      if(ObjectUtils.equals(updateState._curValue, value)) {
        try {
          updateState._cursor.delete();
          updateState.clearCurrentValue(this);
          return true;
        } catch (Exception e) {
          throw handleException(e, false);
      } else {
        return false;
    boolean removed = false;
    DataCursor cursor = null;
    boolean doAutoCommit = beginAutoCommit();
    try {
      cursor = new DataCursor(view, true, key);
      if(OperationStatus.SUCCESS == cursor.getNextNoDup(true)) {
        Object curValue = cursor.getCurrentValue();
        if(ObjectUtils.equals(curValue, value)) {
          cursor.delete();
          removed = true;
      closeCursor(cursor);
      commitAutoCommit(doAutoCommit);
    } catch (Exception e) {
      closeCursor(cursor);
      throw handleException(e, doAutoCommit);
    return removed;
  public boolean replace(Object key, Object oldValue, Object newValue)
    UpdateState updateState = getUpdateState(key);
    if(valueExists(updateState)) {
      if(ObjectUtils.equals(updateState._curValue, oldValue)) {
        try {
          updateState.replaceCurrentValue(newValue);
          return true;
        } catch (Exception e) {
          throw handleException(e, false);
      } else {
        return false;
    boolean replaced = false;
    DataCursor cursor = null;
    boolean doAutoCommit = beginAutoCommit();
    try {
      cursor = new DataCursor(view, true, key);
      if(OperationStatus.SUCCESS == cursor.getNextNoDup(true)) {
        Object curValue = cursor.getCurrentValue();
        if(ObjectUtils.equals(curValue, oldValue)) {
          cursor.putCurrent(newValue);
          replaced = true;
      closeCursor(cursor);
      commitAutoCommit(doAutoCommit);
    } catch (Exception e) {
      closeCursor(cursor);
      throw handleException(e, doAutoCommit);
    return replaced;
  public Object replace(Object key, Object value)
    UpdateState updateState = getUpdateState(key);
    if(valueExists(updateState)) {
      try {
        return updateState.replaceCurrentValue(value);
      } catch (Exception e) {
        throw handleException(e, false);
    Object curValue = null;
    DataCursor cursor = null;
    boolean doAutoCommit = beginAutoCommit();
    try {
      cursor = new DataCursor(view, true, key);
      if(OperationStatus.SUCCESS == cursor.getNextNoDup(true)) {
        curValue = cursor.getCurrentValue();
        cursor.putCurrent(value);
      closeCursor(cursor);
      commitAutoCommit(doAutoCommit);
    } catch (Exception e) {
      closeCursor(cursor);
      throw handleException(e, doAutoCommit);
    return curValue;
   * @return the current UpdateState for the given key, if any, {@code null}
   *         otherwise.
  private UpdateState getUpdateState(Object key)
    UpdateState updateState = _updateState.get();
    if((updateState != null) && (ObjectUtils.equals(updateState._key, key))) {
      return updateState;
    return null;
   * @return {@code true} if the update state exists and found a value (which
   *         is currently locked)
  private boolean valueExists(UpdateState updateState)
    return((updateState != null) && (updateState._cursor != null));
   * Maintains state about an object loaded in a
   * {@link StoredConcurrentMap#getForUpdate} call.
  private static class UpdateState
    public final Object _key;
    public final boolean _doAutoCommit;
    public DataCursor _cursor;
    public Object _curValue;
    private UpdateState(Object key, boolean doAutoCommit) {
      _key = key;
      _doAutoCommit = doAutoCommit;
     * Loads the current value from the given cursor, and maintains a
     * reference to the given cursor and the loaded value.
    public Object loadCurrentValue(DataCursor cursor)
      throws DatabaseException
      _cursor = cursor;
      _curValue = _cursor.getCurrentValue();
      return _curValue;
     * Replaces the current value in the current cursor with the given value.
     * @return the old value
    public Object replaceCurrentValue(Object newValue)
      throws DatabaseException
      Object oldValue = _curValue;
      _cursor.putCurrent(newValue);
      _curValue = newValue;
      return oldValue;
     * Closes the current curstor and clears the references to the cursor and
     * current value.
    public void clearCurrentValue(StoredConcurrentMap map) {
      try {
        map.closeCursor(_cursor);
      } finally {
        _cursor = null;
        _curValue = null;
}

Similar Messages

  • I have thought about adding a new persona, but once I click on the wear this nothing happens

    I have thought about adding a new Persona, but when I click on Wear this nothing happen

    See:
    *http://kb.mozillazine.org/Preferences_not_saved

  • Some thoughts on adding ram to G4 sawtooth

    I've gone down the list and read all I can about adding ram to my G4. It now has 2-64mb pc-100's, 1-256mb pc-100,and 1-128mb pc133-333. I would like to max it out since it's been freezing up during graphic work when I have more than one Adobe application running. Am I correct in thinking that's the problem or could there be something else going on? I have already expanded with a 1ghz processor, and 120gig hard drive. I'm running Panther. Any suggestions? Also I read somewhere that it matters what slot you put each ram chip in. Is there some order to this?
    powermac G4 (agp graphics),Powerbook Titanium OSX   Mac OS X (10.3.9)  

    Claire, In the Finder under the Apple/About this Mac/More Info/Memory you will see the Memory Slot order of each stick follow by their size. Take a look here she is replacing memory in the first slot, also the size should be printed on the side each stick.
    http://www.info.apple.com/usen/cip/html/g4ge/g4gbenet-memory-cip.mov.html
    Joe
    Power Mac G4 Gigabit Ethernet   Mac OS X (10.3.9)  

  • Adding Payment Method Field ( ZLSCH) to the Remuneration Statement (pc00_m99_cedt)

    Dear Experts,
    I want to add the payment method field in the pnp logical database to be displayed in the further selection as follows

    Hi
    The Payment Method field is very much available in the VA01 screen.
    Go to Item-->Billing, there you can see the Payment Method field.
    This field is automatically populated if you have maintained it the Customer Master.
    This can also be entered manually in the sales order.
    Thanks
    Madhu

  • Adding Payment method field- VBKD-ZLSCH in initial screen of VA01

    Hi All,
    I would like to add payment method field - VBKD-ZLSCH in initial screen of VA01.
    This field can be seen in the VA41 under "Item overview" tab. But not visible in VA01 screen.
    Please advice.
    Ghassu

    Hi
    The Payment Method field is very much available in the VA01 screen.
    Go to Item-->Billing, there you can see the Payment Method field.
    This field is automatically populated if you have maintained it the Customer Master.
    This can also be entered manually in the sales order.
    Thanks
    Madhu

  • Need thoughts on adding caption

    I have finished scanning a number of old family photos and have used Adobe Photoshop Elements 9 (PSE9) to “tag” and add “captions” to each photo. The photos vary in size and are saved in tif format. All of the work I have done so far was using the Organizer in PSE9.
    I have gone to the Edit screen of PSE9 and used Process Multiple Files to add the “captions” to the photos. There are three options for placement: Bottom Left, Bottom Right or Centered. Centered puts the caption dead center of the photo. What I really want is Bottom Centered but that is not an option.
    I am a complete novice with most photo software but I have used IrfanView and Paint. Is there any way to get the captions to be added to a photo in a bottom centered position.
    I am well over 400 photos with “captions” and I have no intent of typing by hand something I have already entered. I do wish I understood this more. Any help would be appreciated. Thanks.

    If you want to place the same information on multiple photo files, the batch process which you reference will do it. The downside is that you have limited control as to placement.
    Consider making a brush. This will allow for placement, color, and size to suit, although it is a manual process. There are many tutorials for making a brush. Here is one:
    http://www.elementsvillage.com/forums/showthread.php?t=61706

  • Adding new method into String.java (just for personal usage)

    For some reason, it kept bringing in the old String.class, even I updated it the rt.jar with the new String.class. I even checked it with jar -tvf rt.jar. It has the new String.class. However, it seemed to constantly loading in the old one. Unless I use bootclasspath. The followng is the test :
    1.     I add a new function to String.java
    a.     : goody() { return “this is a test method”; }
    2.     To compile:
    a.     javac -bootclasspath ".\;C:\Program Files\Java\jdk1.6.0_03\jre\lib\rt.jar" String.java
    jar uf rt.jar java/lang/String.class
    3.     To test with file test.java where it calls String.goody()
    a.     To make sure it is not pulling in old code, I had to copy the new rt.jar to my test directory:
    i.     copy "C:\Program Files\Java\jdk1.6.0_03\jre\lib\rt.jar” .\
    4.     compile my test.java:
    a.     javac -bootclasspath .\rt.jar test.java
    5.     Execute the jvm:
    a.     java -Xbootclasspath:.\rt.jar;.\; test
    6.     I got output : “this is test method”
    =========================
    if I use the regular : java classpath where the new classpath does indeed reside in, it claims the symbol not found. I have to copy the rt.jar to my local and use -Xbootclasspath. Suggestion? Or, this is really the only way to be able to call a new method installed in String.class?

    eproflab wrote:
    a.     To make sure it is not pulling in old code, I had to copy the new rt.jar to my test directory:
    i.     copy "C:\Program Files\Java\jdk1.6.0_03\jre\lib\rt.jar&#148; .\That will not work.
    You must replace it in the VM directory or use the bootpath options. There is no other way.
    Note that you mess up with what you are doing (replacing the rt.jar way) that not only will you not be able to run, not even to get an exception, but you will not be able to compile either.

  • Adding toString method

    Is there any way to programmatically add a toString method() to the
    generated classes? I have a number of objects that will be used to
    populate pick lists or put in other swing components. They will only
    display correctly if toString() is defined. I was thinking along the
    lines of specifying the fields that would be returned from toString(). In
    the custom.properites format, something like:
    com.foo.jdo.Person.tostring: forename,surname
    Doug

    I looked at the docs mentioned and at the javadocs for FieldMapping,
    ReverseCustomizer, etc. It looks quite complex, I'm not sure where to
    start. Can you quickly summarize what steps need to be taken? For
    example, for my class Person:
    public class Person {
    private Date birthDate;
    private String birthPlace;
    private EyeColor eyeColor;
    private String forename;
    private String surname
    Say I want to add a toString() method that returns
    forename + surname. I don't want to add any new fields, just the method.
    Marc Prud'hommeaux wrote:
    Doug-
    Do you mean in the reverse mapping process? There isn't any built-in way
    to do this, but it is quite simple to implement your own implementation
    of kodo.jdbc.meta.ReverseCustomizer, which will allow you to add
    something like this to the generated code.
    For more details on this, see:
    http://docs.solarmetric.com/manual.html#ref_guide_pc_reverse_custom
    In article <c372g8$bhg$[email protected]>, Doug Emerald wrote:
    Is there any way to programmatically add a toString method() to the
    generated classes? I have a number of objects that will be used to
    populate pick lists or put in other swing components. They will only
    display correctly if toString() is defined. I was thinking along the
    lines of specifying the fields that would be returned from toString(). In
    the custom.properites format, something like:
    com.foo.jdo.Person.tostring: forename,surname
    Doug
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Adding string methods? not concat

    How can I add together strings such as "1" + "2" = "3"
    not "1" + "2" = "12"
    if there is no way to do this, how can I convert a string value such as "1" to 1, so I can then add these integers together?
    Any help is appreciated.
    thanks, Patrick.

    class StringAdd {
         private String one = "1";
         private String two = "2";
         private String result;
         public StringAdd() {
              result = String.valueOf(Integer.parseInt(one) + Integer.parseInt(two));
              System.out.println(result);
         public static void main(String[] argv) { new StringAdd(); }
    }

  • JVM crash when adding method to class

    Hello,
    I am getting some kind of problem with the virtual machine. The JVM crashes when making a class (with new). It happened when I was adding some functionality to the class, I worked my way backwards and discovered it crashes when I add any new methods, if I comment them out again everything works, adding a method by any name causes to crash.
    I went in debug to find out where it was happening, and it happens on this line:
    public PerspectiveActionToolBarHeader createPerspectiveActionToolBarHeader() {
         PerspectiveActionToolBarHeader ret = null;
         ret = new PerspectiveActionToolBarHeader(this); // << here
         return ret;
    }The PerspectiveActionToolBarHeader is the class where adding methods causes it to fail. For example, it has the method
    public Container getContainer() {
         return this;
    }and works, but if I add:
    public void anything(){} it causes a crash on the new PerspectiveActionToolBarHeader(this);
    When stepped into with the debugger it goes to the (source not found) ClassNotFoundException and eventually before the crash the (stack?) looks like this:
    Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available     
    MaldiSoftwareOptionsUIEnsemble(PerspectiveUIEnsemble).createPerspectiveActionToolBarHeader() line: 72
    and the debugger describes the class just before the crash:
    Launcher$AppClassLoader (id=44)     
    arg0     "saiman.uiobjnew.PerspectiveToolBarButton" (id=51) << has just changed
    and the log file (not sure how much to copy here!):
    # A fatal error has been detected by the Java Runtime Environment:
    # EXCEPTION_ILLEGAL_INSTRUCTION (0xc000001d) at pc=0x005c0001, pid=15504, tid=20112
    # JRE version: 6.0_24-b07
    # Java VM: Java HotSpot(TM) Client VM (19.1-b02 mixed mode windows-x86 )
    # Problematic frame:
    # C 0x005c0001
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    --------------- T H R E A D ---------------
    Current thread (0x011ca000): JavaThread "main" [_thread_in_vm, id=20112, stack(0x01140000,0x01190000)]
    siginfo: ExceptionCode=0xc000001d
    Registers:
    EAX=0x13e13248, EBX=0x6da0daa8, ECX=0x13e13250, EDX=0x13e131f8
    ESP=0x0118f93c, EBP=0x0118f9a0, ESI=0x011ca9b0, EDI=0x011ca9ac
    EIP=0x005c0001, EFLAGS=0x00010206
    Register to memory mapping:
    EAX=0x13e13248
    {method}
    - klass: {other class}
    EBX=0x6da0daa8
    0x6da0daa8 is pointing to unknown location
    ECX=0x13e13250
    {method}
    - klass: {other class}
    EDX=0x13e131f8
    {constMethod}
    - klass: {other class}
    - method: 0x13e13248 {method} 'flipVisible' '(I)V' in 'saiman/uiobjnew/PerspectiveActionToolBarHeader'
    - exceptions: 0x13bf11e8
    ESP=0x0118f93c
    0x0118f93c is pointing into the stack for thread: 0x011ca000
    "main" prio=6 tid=0x011ca000 nid=0x4e90 runnable [0x0118f000]
    java.lang.Thread.State: RUNNABLE
    EBP=0x0118f9a0
    0x0118f9a0 is pointing into the stack for thread: 0x011ca000
    "main" prio=6 tid=0x011ca000 nid=0x4e90 runnable [0x0118f000]
    java.lang.Thread.State: RUNNABLE
    ESI=0x011ca9b0
    0x011ca9b0 is pointing to unknown location
    EDI=0x011ca9ac
    0x011ca9ac is pointing to unknown location
    Top of Stack: (sp=0x0118f93c)
    0x0118f93c: 6d94272d 011ca370 13e17d40 011ca000
    0x0118f94c: 011ca000 01a30950 011ca748 011ca9b4
    0x0118f95c: 011cab3c 0118fb28 011c6748 011ca348
    0x0118f96c: 011ca370 011ca73c 6da0daa8 011ca350
    0x0118f97c: 011ca370 0118f9cc 011ca9a8 0118f9c8
    0x0118f98c: 011ca788 011ca370 011ca9b0 011ca000
    0x0118f99c: 13e17d40 0118f9cc 6d943009 00000910
    0x0118f9ac: 011ca9ac 00000001 011ca000 011ca000
    Instructions: (pc=0x005c0001)
    0x005bfff1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff
    0x005c0001: ff ff 7f 00 00 00 00 00 00 00 00 ff ff ff ff 00
    Stack: [0x01140000,0x01190000], sp=0x0118f93c, free space=318k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C 0x005c0001
    V [jvm.dll+0x153009]
    V [jvm.dll+0xdecdb]
    V [jvm.dll+0xe1887]
    V [jvm.dll+0xe1c46]
    V [jvm.dll+0xec09a]
    j saiman.uiobjnew.PerspectiveUIEnsemble.createPerspectiveActionToolBarHeader()Lsaiman/uiobjnew/PerspectiveActionToolBarHeader;+2
    j saiman.mv.ModelViewPerspectiveUIEnsemble.createPerspectiveActionToolBarHeader()Lsaiman/uiobjnew/PerspectiveActionToolBarHeader;+1
    j saiman.uiobjnew.PerspectiveUIEnsemble.addButtons()V+1
    j saiman.uiobjnew.PerspectiveUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+21
    j saiman.mv.ModelViewPerspectiveUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+2
    j saiman.uiobjnew.SoftwareOptionsUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+2
    j saiman.wmaldi.MaldiSoftwareOptionsUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+2
    j saiman.newuiimpl.MassSpectrumMainFrameImpl.main([Ljava/lang/String;)V+173
    v ~StubRoutines::call_stub
    V [jvm.dll+0xf0ab9]
    V [jvm.dll+0x1837d1]
    V [jvm.dll+0xf0b3d]
    V [jvm.dll+0xfa0d6]
    V [jvm.dll+0x101cde]
    C [javaw.exe+0x2155]
    C [javaw.exe+0x8614]
    C [kernel32.dll+0x51194]
    C [ntdll.dll+0x5b3f5]
    C [ntdll.dll+0x5b3c8]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j saiman.uiobjnew.PerspectiveUIEnsemble.createPerspectiveActionToolBarHeader()Lsaiman/uiobjnew/PerspectiveActionToolBarHeader;+2
    j saiman.mv.ModelViewPerspectiveUIEnsemble.createPerspectiveActionToolBarHeader()Lsaiman/uiobjnew/PerspectiveActionToolBarHeader;+1
    j saiman.uiobjnew.PerspectiveUIEnsemble.addButtons()V+1
    j saiman.uiobjnew.PerspectiveUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+21
    j saiman.mv.ModelViewPerspectiveUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+2
    j saiman.uiobjnew.SoftwareOptionsUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+2
    j saiman.wmaldi.MaldiSoftwareOptionsUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+2
    j saiman.newuiimpl.MassSpectrumMainFrameImpl.main([Ljava/lang/String;)V+173
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x01b05400 JavaThread "AWT-Windows" daemon [_thread_in_native, id=19680, stack(0x18560000,0x185b0000)]
    0x01b04800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=19516, stack(0x18140000,0x18190000)]
    0x01b04000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=20064, stack(0x18040000,0x18090000)]
    0x01b03c00 JavaThread "CompilerThread0" daemon [_thread_blocked, id=20276, stack(0x17ff0000,0x18040000)]
    0x01aeb000 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=16832, stack(0x17fa0000,0x17ff0000)]
    0x01aea000 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=16360, stack(0x17ef0000,0x17f40000)]
    0x01ae8000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=20084, stack(0x17ea0000,0x17ef0000)]
    0x01ade400 JavaThread "Attach Listener" daemon [_thread_blocked, id=19772, stack(0x17d90000,0x17de0000)]
    0x01add400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=20192, stack(0x17d40000,0x17d90000)]
    0x01ab2800 JavaThread "Finalizer" daemon [_thread_blocked, id=17344, stack(0x17cf0000,0x17d40000)]
    0x01aabc00 JavaThread "Reference Handler" daemon [_thread_blocked, id=19964, stack(0x17ca0000,0x17cf0000)]
    =>0x011ca000 JavaThread "main" [_thread_in_vm, id=20112, stack(0x01140000,0x01190000)]
    Other Threads:
    0x01aa7c00 VMThread [stack: 0x011d0000,0x01220000] [id=19144]
    0x01b17400 WatcherThread [stack: 0x180f0000,0x18140000] [id=12792]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 4928K, used 768K [0x03bf0000, 0x04140000, 0x09140000)
    eden space 4416K, 5% used [0x03bf0000, 0x03c30380, 0x04040000)
    from space 512K, 100% used [0x040c0000, 0x04140000, 0x04140000)
    to space 512K, 0% used [0x04040000, 0x04040000, 0x040c0000)
    tenured generation total 10944K, used 1858K [0x09140000, 0x09bf0000, 0x13bf0000)
    the space 10944K, 16% used [0x09140000, 0x09310948, 0x09310a00, 0x09bf0000)
    compacting perm gen total 12288K, used 9598K [0x13bf0000, 0x147f0000, 0x17bf0000)
    the space 12288K, 78% used [0x13bf0000, 0x1454fb70, 0x1454fc00, 0x147f0000)
    No shared spaces configured.
    Edited by: hanvyj on 07-Jun-2011 02:39
    Edited by: hanvyj on 07-Jun-2011 02:43

    I think I may have stumbled across the answer, It seems that the abstract class PerspectiveToolBar implements
    the interface with the method public Container getContainer() but does not declare it, this should be fine because the method is abstract but it crashes. When I add the method public abstract Container getContainer(); to the abstract sub-class there is no error. I'm going to try make a small compilable example to see if I can reproduce it.
    edit its actually only one of the two interface methods, and not getContainer(), but another one. If anyone is interested here is the interface:
    public interface IMassSpectrometerPassableControlContainer
         Container getContainer();
         void reloadWidgetsOnVisible(boolean visible);
    }and it works only if there is "public abstract void reloadWidgetsOnVisible(boolean visible);" in the abstract class PerspectiveToolBar implementing IMassSpectrometerPassableControlContainer.
    I tried to reproduce it, but I can't get another class to repeat the behaviour, so I don't think I can post a bug report on it. Here is my attempt anyway:
    import javax.swing.JToolBar;
    * Class     Test.java
    * Date:     7 Jun 2011
    * @author     tofuser
    public class Test extends Subclass
         public static void main(String args[])
              System.out.println("in main method");
              Test t = new Test();
              t.interfaceMethod();
         @Override
         public void interfaceMethod()
              System.out.println("interface method");
    abstract class Subclass extends JToolBar implements Interface
         private static final long serialVersionUID = 1L;
         //this line is where it breaks in my code, including it works
         //public abstract void interfaceMethod();
    interface Interface
         public abstract void interfaceMethod();
    }Edited by: hanvyj on 07-Jun-2011 03:56

  • Adding and Calling custom method to the application module or view object

    My project uses jheadstart 10.1.2.
    I want to run "oracle reports" from my uix page. I have coded a method which takes "VOParameter view object" as a parameter to run report.
    I have generated the input page (parameter page) which based on VOParameter view object, by using jheadstart for using jheadstart lov, date etc. advantages. But I dont know how can I add custom method on application module or view object implementation class and custom button on uix page to call from uix page.
    THANKS for your help

    Yes, method binding has been added to the page UI model.
    I have find some clue that When I darg and drop metod as a submitButton, the code "
    <SubmitButton text="runReport" model="${bindings.runReport}" id="runReport0" event="action" />"
    is added to the uix page code. I change this code like this;
    <button text="runReport" model="${bindings.runReport}" id="runReport0" event="action" onClick="submitForm('dataForm',1,{'event':'action','source':'runReport0'});return false"/>
    by adding onClick method and changed submitButton to button tag..
    Then button action is triggered. But I can not pass to the design part of the uix page. It gives me the message like that "The document is not a valid state" But it works. I dont know why?

  • Adding a collection to a VO

    Using JDeveloper 11g PS2
    I have a VO called Dossiers which has some attributes from the dossiers table...
    I also have a content repository with documents. Each dossier has multiple documents attached to it. I can use a java api to access the content repository and query it so it will return a list of documents linked to a specific dossier.
    How should i add that list to my VO?
    I first thought i should do it by exposing a method getDocuments in the client interface but i get strange errors...
    This is what i have done:
    1) In my VO, generate the View Row Class
    2) I've added my method to the DossierRowImpl class:
        public List<Document> getDocuments(){
          ArrayList<Document> list = new ArrayList<Document>();
          Document d = new Document();
          d.setName("name");
          d.setTitle("title");
          d.setUrl("url");
          list.add(d);
          return list;
        }This is a test... Document is just a simple pojo with name,title and url attribute. Nothing more, nothing less.
    3) Edit the Client Row Interface
    4) Shuttle the getDocuments method to the right
    5) Save all and refresh the data control.
    6) Drag and drop the return of my getDocuments method to a JSPX page
    7) Generate a table out of it
    8) run the page
    This is the error i get:
    <Utils><buildFacesMessage> ADF: Adding the following JSF error message: Object model.test of type ApplicationModule is not found.
    oracle.jbo.NoObjException: JBO-25003: Object model.test of type ApplicationModule is not found.
         at oracle.jbo.server.ApplicationModuleImpl.findViewObject(ApplicationModuleImpl.java:3108)
         at oracle.adf.model.bc4j.DCJboDataControl.createRowSetIteratorImpl(DCJboDataControl.java:1256)
         at oracle.adf.model.binding.DCDataControl.findOrCreateRowSetIteratorImpl(DCDataControl.java:765)
         at oracle.adf.model.binding.DCDataControl.createRowSetIteratorImpl(DCDataControl.java:796)
         at oracle.adf.model.bc4j.DCJboDataControl.findOrCreateMethodRowSetIterator(DCJboDataControl.java:1224)
         at oracle.jbo.uicli.binding.JUMethodIteratorDef$JUMethodIteratorBinding.initSourceRSI(JUMethodIteratorDef.java:691)
         at oracle.adf.model.binding.DCIteratorBinding.callInitSourceRSI(DCIteratorBinding.java:1654)
         at oracle.adf.model.binding.DCIteratorBinding.internalGetRowSetIterator(DCIteratorBinding.java:1630)
         at oracle.adf.model.binding.DCIteratorBinding.refresh(DCIteratorBinding.java:4300)
         at oracle.adf.model.binding.DCExecutableBinding.refreshIfNeeded(DCExecutableBinding.java:341)
         at oracle.adf.model.binding.DCIteratorBinding.getRowSetIterator(DCIteratorBinding.java:1592)
         at oracle.adf.model.bc4j.DCJboDataControl.getAttributeDefs(DCJboDataControl.java:2499)
         at oracle.adf.model.binding.DCIteratorBinding.getAttributeDefs(DCIteratorBinding.java:3147)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.fetchAttrDefs(JUCtrlValueBinding.java:484)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDefs(JUCtrlValueBinding.java:436)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.findAttributeDef(JUCtrlValueBinding.java:585)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.lookupAttributeDef(JUCtrlValueBinding.java:556)
         at oracle.jbo.uicli.binding.JUCtrlHierBinding$1JUCtrlHierHintsMap.internalGet(JUCtrlHierBinding.java:175)
    ...Just wondering... Am i doing something wrong... Should i implement it in another way?

    I've done what you said and i still get the same error.
    SO i added the getDocuments method to the DossierImpl class:
    public class DossierImpl extends ViewObjectImpl implements Dossier {
         * This is the default constructor (do not remove).
        public DossierImpl() {
      public List<Document> getDocuments(){
        ArrayList<Document> list = new ArrayList<Document>();
        Document d = new Document();
        d.setName("name");
        d.setTitle("title");
        d.setUrl("url");
        list.add(d);
        return list;
    }And exposed it to the Client Interface instead of the Client Row Interface and i get the same error when adding the results to my JSPX as a read only table.

  • Where to put methods?

    Hi folks, this isn't a Java dependant question but since I am coding in Java I will ask it here. I have a value object that contains a few attributes, accessor and persistence methods. We'll call the Class Player and it contains details of a person who is playing a game. All of the methods and attributes belonging to this Class are related to an instance of Player. I want to have a utility method that returns ALL the players. What do people of the group think is the best way to treat this method? Should I add a new Class i.e. PlayerUtils, where I could subsequently add more utility methods OR would adding a method to the Player Class, public static Vector getAllPlayers() be a viable option? My gut feeling is to go with the PlayerUtils Class even though there is only one method so far because it is more flexbile and it keeps static method calls out of my instance Class. I don't really have any formal training in Java so most of what I have learned is through experience and reference-type books. Your thoughts are valued.
    Thanks, Max

    This is like a singleton, except it is a "multipleton". (I haven't studied my design patterns well yet, maybe it has a name.) I agree that keeping the collection information in another class might be a better idea, but this Player class could also do its own enforcing that certain Player fields (such as name) acts like primary keys and are not duplicated.
    class Player
       // static field
       private static Vector allPlayers = new Vector();
       // private constr
       private Player(<args>)
       public static Player createNewPlayer(<args>)
          Player newguy = new Player(args);
          allPlayers.add(newguy);
          return newguy;
       public static Player getPlayerByName(String name)
          ... // assuming Player has a Name field, find him
       public static Vector getAllPlayers()
          return allPlayers;  // or a copy of it

  • Adding Padding Bottom property to an UI in dynamic coding

    Hi
    I am writing a dynamic code in the doModify() method to create a set of UI elements within a Transparent container at runtime.
    I need more spacing between two rows of UI elements. So I thought of adding the Padding Bottom property to the UI elements. Since the UIs are generated at runtime, I need to specify the Padding Bottom value at runtime as well.
    Please advise how to achieve that.
    Thanks and Regards,
    Sayan Ghosh

    I hope that helps you!
         IWDTransparentContainer trspContHeaderButtonsLeft = (IWDTransparentContainer) view.createElement(IWDTransparentContainer.class, "trspContHeaderButtonsLeft");
              IWDGridLayout gridLayouttrspContHeaderButtonsLeft = (IWDGridLayout) trspContHeaderButtonsLeft.createLayout(IWDGridLayout.class);
                   gridLayouttrspContHeaderButtonsLeft.setColCount(6);
              IWDGridData gridDatatrspContHeaderButtonsLeft = (IWDGridData) trspContHeaderButtonsLeft.createLayoutData(IWDGridData.class);
                   gridDatatrspContHeaderButtonsLeft.setColSpan(1);
                   gridDatatrspContHeaderButtonsLeft.setHAlign(WDCellHAlign.FORCED_LEFT);
                   gridDatatrspContHeaderButtonsLeft.setWidth("1%");
    regards,
    Angelo

  • [Q] htmlKona - adding attributes not specified in object model

    How do I go about adding attributes to a htmlKona object that exist in
              proprietary HTML versions, or versions beyond what is supported in Kona, if
              those add methods do not exist in the current object model?
              Most htmlKona elements extend weblogic.html.ElementWithAttributes, but the
              addAttribute(String, String) method is inexcessable.
              Any help appreciated. If this is posted to the wrong group, please point me
              in the right direction.
              Lukas
              

    I guess you need to get htmlkonapatch403Patch.jar. ElementsWithAttributes
              supports it then.
              Madhavi
              Lukas Bradley <[email protected]> wrote in message
              news:[email protected]...
              > import weblogic.html.TableElement ;
              >
              > class TableTest
              > {
              > public static void main(String args[])
              > {
              > TableElement lTable = new TableElement() ;
              > lTable.addAttribute("height", "100%") ;
              > }
              > }
              >
              > Yields:
              >
              > TableTest.java:8: Method addAttribute(java.lang.String, java.lang.String)
              > not found in class weblogic.html.TableElement.
              > lTable.addAttribute("height", "100%") ;
              > ^
              > 1 error
              >
              > While the documentation states:
              >
              > java.lang.Object
              > |
              > +----weblogic.html.HtmlElement
              > |
              > +----weblogic.html.ElementWithAttributes
              > |
              > +----weblogic.html.MultiPartElement
              > |
              > +----weblogic.html.TableElement
              >
              >
              > And ElementWithAttributes has:
              >
              > addAttribute(String, String)
              >
              > And yes, many browsers will allow you to set the height on a table. =)
              > Thanks for any help.
              >
              > Lukas
              >
              >
              >
              > John Greene wrote in message <[email protected]>...
              > >
              > >Hi --
              > >
              > >A method was added to allow generic attributes. I thought it was this
              > method
              > >you speak of. How do you mean it's inaccessible? Newsdude, can you
              > clarify?
              > >
              > >
              > >Lukas Bradley wrote:
              > >>
              > >> How do I go about adding attributes to a htmlKona object that exist in
              > >> proprietary HTML versions, or versions beyond what is supported in
              Kona,
              > if
              > >> those add methods do not exist in the current object model?
              > >>
              > >> Most htmlKona elements extend weblogic.html.ElementWithAttributes, but
              > the
              > >> addAttribute(String, String) method is inexcessable.
              > >>
              > >> Any help appreciated. If this is posted to the wrong group, please
              point
              > me
              > >> in the right direction.
              > >>
              > >> Lukas
              > >
              > >--
              > >
              > >Take care,
              > >
              > >-jg
              > >
              > >John Greene E-Commerce Server Division, BEA Systems,
              > Inc.
              > >Developer Relations Engineer 550 California Street, 10th floor
              > >415.364.4559 San Francisco, CA 94104-1006
              > >mailto:[email protected] http://weblogic.beasys.com
              >
              >
              >
              >
              

Maybe you are looking for

  • Can No Longer Write files to a NSF-mounted drive on one Server. Error -36

    Hi Folks: I have searched the Net (including these forums now) for several hours and found nothing definite. The story is this: I have a Fedora 14 server that, up to this point, has been acting as a file server. Sometime last week (around the 28th we

  • Java Script and LOV

    Hi * I used in an PL/SQL Packages, which creat an HTML Pages the folloing Portal funktion to open an LOV ! htp.print(''); The folloing Link open the LOV : htp.print(''); With the Netscape Navigator 4.75 is no problem, but the Internet Explorer 5 coul

  • Urgent! Encountering NoSuchMethod Error.

    We are using bc4j components as part of our oracle lite application.During the packaging process we encounter a NoSuchMethod error when the program reaches the look up of the ApplicationModuleName. Is it really possible to use bc4j components in an o

  • HT201413 install rolls back and cancels

    I cannot get Itunes to install. It tries to install but rolls back and cancels. I have deleted ny old version of i-tunes but still cannot install any version.

  • Which is more powerful the old flat airport extreme or airport express

    Which is more powerful the old flat airport extreme or an Airport express