Announcement

Collapse
No announcement yet.

Java - Using Events with the bridge2java

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Java - Using Events with the bridge2java

    Hi you Java minority!
    The more I look into into the eSignal2Java stuff, the more I get the feeling that nobody has ever tried this beyond simple synchronous queries. As I read from other threads, unfortunately I cannot expect this from ESignal programmers, because they only know about M$ :-(

    The issue:
    There is an EventListener Interface _IHooksEvents. But to use this there has to be a method to add an EventListener to the Hook.
    Hook extends the (undocumented!) ibm class Dispatch which has an undocumented native method IDispatch_addListener (int, String, EventListener, String). I guess this is the one. Now what are the parameters? It's part of the undocumented bridge2java.dll.

    I guess there is no documentation on bridge2java at all?

    A poll: I might implement the java interface using JNI, which I have already done for other dlls, hoping the c++ functions do work. Would anyone be interested in this or has anyone already done this?

    Regards,
    TradingDuke

  • #2
    Java for ActiveX is not supported officially (as you've found out =) ).

    We wrote that example using one of the publically available Java->ActiveX bridges. In this case, this is from IBM, try searching their website for the bridge2java product ?

    There are a number of other free and commercial products available to allow Java to communicate with ActiveX. We've found the bridge2java was the simplest to use, but you're right, we haven't explored it in more demanding applications.

    You'll probably find documentation on the IBM classes on the IBM website somewhere, perhaps google for bridge2java?

    Comment


    • #3
      Very sad. But let's try to do it unofficially.

      I did some analysis:

      The bridge2java does not generate addListener/removeListener calls for the _IHooksEvents. Question is why? It generates listeners for the _IBrokerGUIEvents. I don't see why it shouldn't generate the others. As I see from a tlb2xml view of the winsig.tlb, the generated call should be something like
      Code:
      m_app = new Hooks();
      m_app.addListener("{A7E17FDF-37B6-48F5-862C-3A5FA1CF7B26}", hooksEventsAdapter);
      where hooksEventsAdapter is my implementation of the callback EventListener. I tried to do it manually, but no event callbacks happen. So it seams that the association with the uuid does'nt work in this case. I don't want do dig more into the COM specifics. Maybe someone has some knowledge here. I didn't find any bridge2java support that might help.

      Then I tried annother Com/Java bridge, called EZ JCom(http://www.ezjcom.com/). Everything works fine here! Only problem is, that I would have to pay royalties for redistributions.

      Any thoughts and ideas welcome!

      Regards,
      TradingDuke

      Comment


      • #4
        I think the reason is that IHooksEvents is the 'default' events interface for the eSignal COM stuff. IBrokerGUIEvents is there too, but not the default, so perhaps bridge2java doesn't deal with non-defaults too well.

        It was definitely not the best COM <-> Java bridge that I've seen, but as you said, the good ones cost $$ =).

        Comment


        • #5
          Jacob did the Job!

          FYI
          I finally found an open source solution called jacob that solved all my problems!
          Regards,
          TradingDuke

          Comment


          • #6
            JACOB code

            Hi TradingDuke,

            Is it possible if you could post what you have written with JACOB? I am struggling to get this work... I'd greatly appreciate it

            - Geoffrey

            Comment


            • #7
              Interfacing to eSignal with Jacob

              Geoffrey,

              I'm only using part of the API right now:

              SetApplication
              DoSymbolicLink
              GetBar
              GetNumBars
              RequestHistory
              IsHistoryReady
              IsEntitled
              GetAppBuildNumber
              ReleaseHistory
              ReleaseAllHistory

              and the Callbacks

              OnSymbolChanged
              OnBarsChanged
              OnBarsReceived

              I extended the jajob.dll jni interface with a special variant for the bar data to be more efficient.

              Everything else could be implemented accordingly without too much cost

              Please contact me. if you need details.

              Regards,
              TradingDuke
              Last edited by TradingDuke; 03-15-2006, 10:19 PM.

              Comment


              • #8
                TradingDuke,
                I am pretty slow on picking up new APIs... is it possible if you could show me how to use JACOB w/ eSignal with a couple of simplest connect & event handling (such as RequestSymbol) example? I'd greatly appreciate it...
                - Geoffrey

                Comment


                • #9
                  Geoffrey - I'm not in the open source business - I write software for living. So if you want help - please contact me. Let's see what I can do for you.

                  Comment

                  Working...
                  X