HELP IN JNI (1.4) : how to get informations from a jclass pointer ?

Hi,
I am integrating a JVM inside an already built product in C and Objective C. I need to build hash tables of jclass pointers. The problem is :
On two different JNI interactions, when for instance you ask for the jclass pointer of "java/lang/String", you get different pointers. So I cannot built a hash key based on the jclass value. Only
(*env)->IsSameObject(env,jclass1,jclass2) can help to recognize that those pointers points to the same java class.
So it would be usefull for me to grab (efficiently) a stable information, such as the name of the class, to build a hash key from.
Anybody could tell me how can I do this ?
Thanks in advance,
Regards,
C.Dore

Yes, sorry, realized that myself and actually thought I would have posted the correct solution but I guess I forgot about it. Here it is:
import java.util.Hashtable;
public final class Test {
    static { System.loadLibrary("test"); }
    private static native Hashtable  makeHash();
    public static void main(String[] args) {
     Hashtable  h = makeHash();
     h.put("ba", "ba");
     System.out.println(h);
    } // main(String[])
// NATIVE portion:
#include <jni.h>
/* Header for class Test */
#ifdef __cplusplus
extern "C" {
#endif
* Class:     Test
* Method:    makeHash
* Signature: ()Ljava/util/Hashtable;
  JNIEXPORT jobject JNICALL Java_Test_makeHash(JNIEnv *env, jclass klass) {
    jclass    hashClass  = (*env)->FindClass(env, "java/util/Hashtable");
    jmethodID hashConstr = (*env)->GetMethodID(env, hashClass, "<init>", "()V");
    jobject   hash       = (*env)->NewObject(env, hashClass, hashConstr);
    return  hash;
#ifdef __cplusplus
#endif

Similar Messages

  • How to get information from my laptop to my ipad

    I`m new on I-pad
    How to get information from my laptop to my ipad
    Saludos
    Josè Montero

    Heres some Apple Support tips on the subject.
    How to transfer and sync content to your computer:
    http://support.apple.com/kb/ht1296
    How to transfer files between your computer and mobile apps:
    http://support.apple.com/kb/PH1693
    How to do file transfers:
    http://support.apple.com/kb/HT4094

  • How to get information from ODBC sources to Forms Builder environment

    Hi,
    Could anyone help me, to get some examples or more information, that how can I get information from ODBC sources to Forms Builder environment. I have a need to read data for example to LOV.

    If you are on Forms 6i you install the Oracle Client Adaptor from the Forms CD. You then have a way of connecting to ODBC datasources.
    To connect to ODBC at the same time as you are connected to Oracle you can use the EXEC_SQL package to create a second connection via odbc and issue select statements against that datasource.

  • How to get information from Oracle's views

    Hi,
    I need to get information from Oracle's views about:
    * in which table's column is set index
    * what type of index is on this column
    * name of a trigger which exist on a table
    * type of trigger (before, after etc)
    * trigger status (enable, disable)
    Thanks for help.

    Hi..
    One of the best way to know which views to use is doing select * from dict where table_name like 'xxx';
    For example in your case you needed to know about the indexes and triggers so
    SQL> select * from dictionary where table_name like 'DBA_IND%';
    TABLE_NAME                     COMMENTS
    DBA_INDEXES                    Description for all indexes in the database
    *DBA_IND_COLUMNS                COLUMNs comprising INDEXes on all TABLEs and CLUSTERs*
    DBA_IND_EXPRESSIONS            FUNCTIONAL INDEX EXPRESSIONs on all TABLES and CLUSTERS
    DBA_INDEXTYPES                 All indextypes
    DBA_INDEXTYPE_COMMENTS         Comments for user-defined indextypes
    DBA_INDEXTYPE_ARRAYTYPES       All array types specified by the indextype
    DBA_INDEXTYPE_OPERATORS        All indextype operators
    DBA_IND_PARTITIONS
    DBA_IND_SUBPARTITIONS
    DBA_IND_STATISTICS             Optimizer statistics for all indexes in the database
    10 rows selected.
    SQL> select * from dictionary where table_name like 'DBA_TRI%';
    TABLE_NAME                     COMMENTS
    DBA_TRIGGERS                   All triggers in the database
    DBA_TRIGGER_COLS               Column usage in all triggers
    Reading the comments you can know which view to use, then  describe the view and use what you need

  • Any helpful materials or sample on how to get data from lotus in SAP?

    I have some experience on get data from Biztalk (Microsoft Middleware). In that case, i could using "call FMxxxx DESTINATION rfc". the destination with type TCP/IP is created via SM59.
          and how about lotus ?
       ths

    I have some experience on get data from Biztalk (Microsoft Middleware). In that case, i could using "call FMxxxx DESTINATION rfc". the destination with type TCP/IP is created via SM59.
          and how about lotus ?
       ths

  • How to get information from edit box

    Hi,
    I have to modfy user-exit EXIT_SAPMM07M_004
    For me necceassry is field GOHEAD-LFSNR but it is
    edit box and when customer fill this field i need to get
    the information from this field.
    There is question how to in module EXIT_SAPMM07M_004
    I can read infromation from structure GOHEAD ?
    Any suggestions ?
    Please help.
    Regards,
    Greg.

    Hi,
    You can read data and modify it from another program using assign.
    Here's an example of modifying in internal table from another program in CRM
      FIELD-SYMBOLS : <fieldcat> TYPE slis_fieldcat_alv,
                      <links>    TYPE crmt_kw_document_change.
      ASSIGN ('(SAPLCRM_KW_SERVICE)gt_link[]') TO <links>.
    With the above assign you can alter the data
    Kind regards, Rob Dielemans

  • How to get information from desktops into SQL?

    Hello Everyone,
    I could use some help with an idea that I have been working on. I basically am looking for a way to capture information from desktops and get that data into a SQL database. Could anyone give me any links, kb articles, etc on how I can go about doing this?
    Any help would be very appreciated
    Thanks :)

    Powershell is the tool for you. If you could please move this post to powershell; you should get better response.  I almost certain that there are already some powershell scripts that does this, or at least will give you a report or a excel\csv file
    with this information.
    once you have that info you import that data into sql and sql server agent jobs you can automate. 
    Below are some of the resources :
    http://serverfault.com/questions/585223/how-to-list-all-computers-operating-system-on-a-network-in-powershell
    https://www.simple-talk.com/sql/database-administration/let-powershell-do-an-inventory-of-your-servers/
    http://gallery.technet.microsoft.com/scriptcenter/Hardware-Inventory-Using-fe6611e0
    http://blogs.technet.com/b/heyscriptingguy/archive/2006/11/09/how-can-i-use-windows-powershell-to-get-a-list-of-all-my-computers.aspx
    Again, please move this powershell thread. you will get better response,
    Hope it Helps!!

  • How to get information from my iPhone to the SIMcard?

    I do not know how to get my information from an iphone4s to another phone - not apple!!????

    You will need to find out which Address Book/Contacts app on the computer that the Lumia can sync with. Once you know that you can use a program like Backup Extractor to pull out your contact information, a program like TouchCopy to move your information out of the iPhone, or see if you are already using an address book that can be read by the Lumia.

  • How to get information from a text editor in the SAP standard transactions

    Hi SAP gurus I have a requirement in which it is required to gte the information from a text editor(which is not a field) in mm02 (click on) goto Purchase Order Text  in this view there is a text editor there is some text  in te the text editor i have to get that information in a table can it be done if so please give example and steps
    Points will be given to useful information

    Ah yes, excellent question, and not really a clear cut answer. In my experience, the easiest way to find this information is to simply create the text using the standard transaction, in this case MM02.  Then go to transaction SE16, using table STXH, do a query on this table, entering your user name, and today's date as the creation date.  The results should show the text that you just created, now you can see the object, id, and the way the name is being used here. 
    I also understand that in some cases, there is a button next to the editor in the screen which gives you some idea of these values, but this is not implemented everywhere, and I believe that I've only seen this in one place, can't remember where, but the first solution above will always work for you.
    Regards,
    Rich Heilman

  • How to get information from SOAP header in weblogic without handlers

    I need to retrieve information from SOAP header without handlers.
    Any ideas how to do that?

    Just wondering if Filter can be used here, though I never tried that.

  • How to get information from JEditorPane if underlined or not?

    Hello!
    I'm making WYSIWYG html editor using JEditorPane (contentType -> text/html, editable = true). There are several standard buttons and combo boxes on the toolbar like B, I, U, font color etc. I need to update those whenever the caret chages position. So if the caret is set at the bold formatted text I require the bold button to be pressed and so on. However I have problem with getting information about underline state.
    So which method of which class would tell me that?
    Thans in advance!
    Maciej

    This is from memory so forgive if slighly incorrect.
    StyledDocument doc = (StyledDocument)myEditorPane.getDocument();
    boolean isUnderlined = doc.getCharacterElement(myEditorPane.getCaretPosition()).getAttributes().isDefined(StyleConstants.Underline);

  • How to get information from Matrix Cell

    Hello
    I have a system matrix, that shows OBOE (Bill of exchange
    SAPbouiCOM.Form form = SBO_Application.Forms.ActiveForm;
    SAPbouiCOM.Item item = form.Items.Item("5");
    matrix = (SAPbouiCOM.Matrix)item.Specific;
    And them i need to get value from Column 9 row 1 (it is a checkbox, so i need to get if it is checked)
    Now i found only way to serialize this matrix to XML, and then deserialize it, but it is VERY slow
    String MatrixXml = matrix.SerializeAsXML(SAPbouiCOM.BoMatrixXmlSelect.mxs_All);
    Is there any other faster way to get information of matrix cell ?
    Thank you

    Hi Stefano Osler ,
    we can get the information from the matrix by using this below line
    ((SAPbouiCOM.CheckBox)oMatrix.Columns.Item("9").Cells.Item(pval.row).Specific).Checked
    if this is true then it is check else unchecked.
    with Regards,
    MadhuSudhana Rao.G

  • How to get informations from captivate

    Hi, I'm a french developper and I created a swf bar with
    flash for captivate.
    It works and I can control my swf (play, return ...)
    Now, I wish to show informations on my bar (name of the
    movie, etc ...)
    I know something :
    When you create a new movie in captivate, you can write some
    informations (name of society, email etc ...) in the property of
    the project. A button (Information) in the control bar can show
    these informations in a popup.
    Can I get these informations with variables to use it ???
    Regards.

    Right so you have a field, the user types in a customer Id for insatnce, presses tab and the block fills up with that customers data.
    So the problem here is that EXECUTE_QUERY is restricted. It is restricted because it will do things like, validate the record and if there are outstanding changes, prompt you of you want to commit.
    So in your scenario, if execute_query DID work you'd then have a problem because you've just maked a record as changed by typing into it, and so you'd have to commit or rollback before the execute_query could work.
    Anyway that is simple to get around by putting the field that the user entered the ref into into a non base table block.
    The standard way to get a restricted build-in to work from somewhere like a validation trigger is to create a timer of 1ms duration and then execute the query (or whatever) on the when timer expired trigger - to the user it will look instantanious.

  • How to get information from ST03 to RZ20

    Hello,
    I have a problem, i need to be able to view the information available in st03 like spool responce time, db time etc in rz20 but i cant seem to find a way to accomplish this.
    Is there some way i could do this?
    Thank you,
    Martin Rajur

    Hello Martin,
    If you are using the Central Monitoring System, you could monitor the responce time Centrally in ST03G transaction on the Central Monitoring System! I have seen these details in ST03G and all these are visible. You would need to register the system in ST03G transaction in CEN.
    I am not able to justify the requirement for capturing the same spool, background response times again in RZ20. I am still looking at alternatives and in case I figure out some innovative way, I will get back to you!
    Thank You,
    Antarpreet

  • I have a new MacAir and don't know how to get info from my USB stick and my SD photo card.  Can anyone help me please?

    I have a new MacBook Air and don't know how to get info from my USB stick and get info from my SD card.  Can anyone help, please?

    Plug the stick and/or card into the appropriate slots on the side of your Air. Do you see icons for the devices appear on the desktop? Click into them to see what files are there.
    Matt

Maybe you are looking for

  • How to send PDF file to fax number

    Hi I am using COLDFUSION 8," I have a  small screen to take the fax number and want to fax the PDF file  to that fax number from my system using  ColdFusion". I have no idea to implement this. Any help will be appriciated. Thanks

  • Disabling an table in a screen

    hi, i am working in webdynpros where i have a scenario like this. i have only one view and in that view i have taken three transparent contaienrs and each transparetn container has a table and other transparetn contaienr has some input fiields and te

  • I cant access my student and teacher edition Photoshop CS6 extended??

    i bought a student and teacher edition photoshop cs6 extended, i set everything up sent an email to confirm i was a student and what not, it was approved but yet i still cant access my product, can you help?

  • L25 Tape Library

    One of my L25's has been power cycled and after it starts initializing the following message appears: CHK 262F library.c Line 4529 Path 0000 The manual says "the X axis friction is too high for normal operation". Can this be dealt with or is it a har

  • Newest Nokia Ovi Maps ( 0.1.25.114 ) manual downlo...

    Good news About a week ago I noticed Nokia released a new release version of its maps. Last update I noticed was back around May 14 2010 with version 0.1.24.114 Since about 16 October 2010 the version available has been the new 0.1.25.114 Want to ins