Find out all usages of an annotation at runtime

Is there any way to find out all usages of an annotation at runtime? Hypothetically, something like Annotation.getDeclaringElements() which would return AnnotatedElements to which the specific annotation has been applied?
JSR 269 is out of question, as I need this at runtime (correct me, if my requirement does not imply my claim here). Think of a framework which needs to discover all uses of its own annotations in an arbitrary target environment. In addition, classes loaded at arbitrary points in runtime should be detectable if the discovery is made afterwards.
Performance is not critical: enumerating all classes of all ClassLoaders and checking each class and its members would do. Is there a way to enumerate all classes for this purpose?
Is there any way to hack around any/all limitations, using whatever non-elegant, ugly ways to achieve this?

hey. I don't know if there is anything like that out of the box, but might use bytecode instrumentation/analysis with the -javaagent-switch. It will give you the chance to analyse everyclass that is getting loaded into the JVM. Look here for more info: http://java.sun.com/javase/6/docs/api/java/lang/instrument/package-summary.html
I think the catch with the classloader is, that you never know if another class will be loaded in future.
joh

Similar Messages

  • I want to buy a hard case for my macbook pro, but I don't know what year it is. When I use the serial number to try and find out, all it says is, "~VIN,MacBook Pro (15-inch Glossy)". When I type that into amazon for a case it gives me nothing!

    I want to buy a hard case for my macbook pro, but I don't know what year it is. When I use the serial number to try and find out, all it says is, "~VIN,MacBook Pro (15-inch Glossy)". When I type that into amazon for a case it gives me nothing!

    Hi T,
    Either of these will give you the info you seek:
    http://www.appleserialnumberinfo.com/Desktop/index.php
    http://www.chipmunk.nl/klantenservice/applemodel.html

  • How to find out all user exits edited

    Hi All,
    Would you know how to find out all user exits have been ever edited?
    Can we find out those user exit by some tcode or table?
    Thank you very much
    Best Regards,
    Calvin
    Edited by: Sam Sum on Mar 2, 2009 5:09 AM

    Hi,
    Just try this in your system.
    Go to SE38 and give ZX* and press F4.
    Have a look at table MODATTR to find the active projects in your system.
    Regards
    Edited by: Rajvansh Ravi on Mar 2, 2009 5:17 AM

  • How to find out all the OKCODEs for a particular screen?

    I am working on t-code CL20N and trying to record with t-code SHDB, in the second screen when I press enter it is coming out, but when I run CL20N without SHDB it is going through all the screens perfectly, SHDB is not working for CL20N.
    Is there any other way to find out all the OKCODEs for a particular screen/s?

    Hi,
    First look for any push button or menu item which can take you to the second screen instead of hitting enter directly in tcode CL20N . If any such button exist in the TCode, u can use the same button in SHDB also for moving to the  second screen.
    Thanks,
    Rajinikanth G

  • Table Name or Function Module to find out all the Screens & Subscreens for

    Hello Experts,
          Table Name or Function Module to find out all the Screens & Subscreens for all T-Codes
    Helpful Answer will b rewarded
    Arif Shaik

    Hi Balaji,
       But TSTC only Gives the Program Name , T-Code and Screen but not all the Subscreen details
    Any other which U know

  • How to find out all the tables in a schema with a particular column

    Hi
    Is there a way to find out all the tables in schema1 that has col1 as one of the columns?

    select table_name from dba_tab_cols where owner='schema' and column_name='col1';

  • How to find out all the text elements in the report using Java?

    How to trace the contents of an rpt file?
    I am able to open the rpt file in my report viewer but can not trace it using the JAVA code.
    Actually, I need to find out all the text elements of rpt (Report) file and replace them with the contents of resource bundle.
    My Java code to open a report is given below:
    import com.crystaldecisions.reports.sdk.ISubreportClientDocument;
    import com.crystaldecisions.reports.sdk.ParameterFieldController;
    import com.crystaldecisions.reports.sdk.ReportClientDocument;
    import com.crystaldecisions.sdk.occa.report.data.ConnectionInfo;
    import com.crystaldecisions.sdk.occa.report.data.ConnectionInfos;
    import com.crystaldecisions.sdk.occa.report.data.Fields;
    import com.crystaldecisions.sdk.occa.report.data.IConnectionInfo;
    import com.crystaldecisions.sdk.occa.report.data.ParameterField;
    import com.crystaldecisions.sdk.occa.report.data.ParameterFieldDiscreteValue;
    import com.crystaldecisions.sdk.occa.report.data.Values;
    import com.crystaldecisions.sdk.occa.report.lib.IStrings;
    import com.crystaldecisions.sdk.occa.report.lib.PropertyBag;
    import com.crystaldecisions.sdk.occa.report.lib.PropertyBagHelper;
    import com.crystaldecisions.sdk.occa.report.lib.ReportSDKException;
    import com.crystaldecisions.sdk.occa.report.reportsource.IReportSource;
    public String viewRpt()
                   //1.) Setting Database Infos
                            IConnectionInfo iConnectionInfoObj=setDatabaseConnectionInfos();
                   //2.) Setting Report Path
                   String reportPath=u201DE:
    was60
    rptFilesLocation
    u201D;
                   reportPath=(reportPath!=null)?                                             reportPath:AppConstants.CONSTANTS.BLANK;
                   String reportName="report1.rpt";
                   String reportFullPath = reportPath +   rptName;
                 //3.) Setting Report Source
                             ReportClientDocument reportClientDoc = new ReportClientDocument();
                                              reportClientDoc.open(reportPath, 0);
                  IReportSource reportSource = reportClientDoc.getReportSource();
                  setReportSource(reportSource);
                  reportClientDoc.close();
              //4.) Setting the Fields Starts
              setFieldsCrystal(null);
              Fields fields = new Fields();
              ParameterField pfield1 = new ParameterField();
              Values vals1 = new Values();
              ParameterFieldDiscreteValue pfieldDV1 = new ParameterFieldDiscreteValue();
              pfield1.setName("@parameter1");
              pfieldDV1.setValue(u201Cvalue1u201D);
              vals1.add(pfieldDV1);
              pfield1.setCurrentValues(vals1);
              fields.add(pfield1);
              pfield1 = new ParameterField();
              vals1 = new Values();
              pfieldDV1 = new ParameterFieldDiscreteValue();
              pfield1.setName("@parameter2");
              pfieldDV1.setValue(u201Cvalue2u201D);
              vals1.add(pfieldDV1);
              pfield1.setCurrentValues(vals1);
              fields.add(pfield1);
              setFieldsCrystal(fields);
              //Setting the Fields Ends
    The sample jsp code to view the report is as follows:
    <%@taglib uri="http://www.businessobjects.com/jsf/crystalreportsviewers"
         prefix="bocrv"%>
    <bocrv:reportPageViewer viewerName="CrystalViewer"
                                                 reportSource="#{CrystalReportBeanObject.reportSource}"
                                                 displayToolbarRefreshButton="false"
                                                 allowDatabaseLogonPrompting="false"
                                                 allowParameterPrompting="false"
                                                 databaseLogonInfos="#{CrystalReportBeanObject.connectionInfosCrystal}"
                                                 parameterFields="#{CrystalReportBeanObject.fieldsCrystal}"
                                                 displayGroupTree="false" displayToolbarLogo="false"
                                                 displayToolbarToggleTreeButton="false"
                                                 enablePageToGrow="false" height="540"
                                                 zoomPercentage="100" width="750"
                                                 allowDrillDown="false"
                                                 displayToolbarPrintButton="true"
                                                 printMode="PDF"
                                                 ></bocrv:reportPageViewer>
    Edited by: JayKumarSharma on Mar 23, 2011 12:42 PM

    This is how you retrieve all the text fields in the reort:
    ReportObjects reportObjects = (ITextObject) oReportClientDocument.getReportDefController().getReportObjectController().getReportObjectsByKind(ReportObjectKind.text);
    for(int i=0; i< reportObjects.size();i++)
    ITextObject textObject = (ITextObject)reportObjects.get(i);
    // use ReportObjectController to modify the text object.
    If you want to modify the contents of the text element, you can do it as follows:
    TextObject oTextObject = new TextObject();
    Paragraphs oParagraphs = new Paragraphs();
    Paragraph oParagraph = new Paragraph();
    ParagraphElements oParagraphElements = new ParagraphElements();
    ParagraphTextElement oParagraphTextElement = new ParagraphTextElement();
    oParagraphTextElement.setText("This is the new text field");
    oParagraphTextElement.setKind(ParagraphElementKind.text);
    oReportClientDocument.getReportDefController().getReportObjectController().modify(textObject, oTextObject);
    oReportClientDocument.save();

  • How to find out all SQLs executed by a procedure

    I need to find out all SQLs executed by a procedure. I can trace and check but in my case the issue happened 4 hours back and i know what procedure was causing it. There are multiple dynamic queries fired from this procedure. I need to track down all SQLs fired by this procedure constructed dynamically during the time issue was happening.
    I have the sql_id of the statement which was executing the procedure. How do I track down all "child" SQLs using this sql_id?
    Will appreciate any pointers.
    -ravi

    Thanks for your suggestion and looking into this.
    We already have that functionality built in. Version is 10.2.0.3...But the issue is the proc is called thousands of time in a day and we can not keep the tracking of sqls and parameters passed on all the time. When the issue happened we were not tracking. The bind variables are not captured as the SQL is constructed within the proc by looking up the values dynamically from secondary tables dynamically based on the parameters passed to the procedure. Now the SQLs which are generated from the proc will have the bind variables captured as they will come as predicates and will have no clob types (condition for the binds to be captured).
    I need a query to track down all "child" SQLs by using the sql_id of the parent process which is the procedure's sql_id.

  • How to find out all the tables associated with particular T-code or Program

    Hi All,
    In 4.6B we have a transaction code SE49, where we can see all the tables associated with particular Transaction code or Program.
    But in ECC 5.0 or in ECC 6.0 this transaction code is not available.So is there any alternative where i can find out all the tables associated with particular T-code or Program.
    Thanks
    Shubham

    Hi,
    you are right, Transaction SE49 as well as SE48 do not exist anymore I'm afraid, they        
    are discontinued.                                                              
    You might try to create a transaction variant:                                        
    1) Start SE93 to create a transaction variant                                         
    2) Specify a name, eg. ZSE49, and choose the first option:                            
       "program and screen (dialog transaction)                                           
    3) Here specify SAPMSEUZ as program, and 200 as screen number                         
    4) Choose a suitable development class (package) if you want it to be                 
       transportable or Local (=$TMP) if non-transportable                                
    5) press Save                                                                         
    Same applies for SE48, same program but dynpro 100.                                   
    Sorry for not being able the reasons behind the decision to discontinue            
    these transactions. I suppose at least part of the functionality was               
    integrated in SE38.           
    Best regards
    Erika

  • How can i find out all the different meanings of  User ID Paramtrs (USR05)?

    Dear Gurus
    How can i find out all the different meanings of  User ID Parameters (table USR05)?
    Thanks
    Nuno Natividade

    hi,
       the values are stored in the table tpara and they are used to put the landscape of the system,and to know the log of the system.
      FORM DETERMINE_LANDSCAPE .
        SELECT SINGLE * FROM USR05
                        WHERE BNAME = SY-UNAME
                            AND PARID = 'ZLANDSCAPE'.
        IF SY-SUBRC = 0.
          IF NOT USR05-PARVA IS INITIAL.
       REPLACE
          ELSE.
            PERFORM DETERMINE_FROM_CENTRAL_SYSTEM.
          ENDIF.
        ELSE.
          PERFORM DETERMINE_FROM_CENTRAL_SYSTEM.
        ENDIF.
      ENDFORM.                    " determine_landscape
      FORM DETERMINE_LOG_PARAMETER.
        SELECT SINGLE * FROM USR05 WHERE BNAME = SY-UNAME
                            AND PARID = 'ZLOG_USER'
                            AND PARVA = 'X'.
        IF SY-SUBRC = 0.
          WITH_LOG = 'X'.
        ENDIF.
    <REMOVED BY MODERATOR>
    venkat.
    Edited by: Alvaro Tejada Galindo on Mar 4, 2008 12:47 PM

  • Is there a way to find out all the apps that I've deleted on my iPhone? If so how?

    Is there a way to find out all the apps that I have deleted on my iPhone ? If so how?
    And all so if I have cleared my history on safari but not in the settings is there a way to retrieve the last sites visited? If so how?
    Thanks.

    What is iOS 5 ?
    http://support.apple.com/kb/dl1521
    And does my iPhone 4 as that?
    Settings>>General>>About>>Version
    (Used my iTouch as example)
    And if it deos how can I see the apps that I've deleted ?
    App Store>>Updates>>Purchased
    Scroll through the list of apps that your purchased, and if you remember the apps that you delete, the search will be a lot easier.
    If you don't have iOS 5, you can update your iPhone and since you have an iPhone 4, you can only go up to iOS 6.1.3
    iOS: How to update your iPhone, iPad, or iPod touch
    Hope all this helps.
    Message was edited by: keeferaf

  • How I can find out all menu item name at runtime from forms 9i ?

    Hellow all
    we can find out all the block name and item name in forms at runtime.
    but
    can I find out all the menu item at runtime without knowing the name of menu item.
    I want disable some menu item at runtime.
    From
    Chirag Patel

    Hi Frank
    I hope the solution from u
    please.......
    are u got my problem ?
    from
    Chirag Patel

  • How to find out all active instances in a syste

    How to find out all active instances in a system

    Go to your basis team and ask them, as far as i know there is no other way then suggested in the other answer, but that is not a complete picture, And that is as designed, why should one want to be able to find out, the basis consultant will tell you!

  • SSRS Reports level how to find out All tables names & columns list to display dynamically SQL Query????

    Hi Team,
    I Have one requirement,In SSRS Reporsitory 3000 reports are available.
    My end user requirement All 3000 reports are used Table names & columns list of each wise to display single table or single result set.
    I find out all 3000 reports details are diplayed single results set like
    Report Id,Path,Dataset,Source Query Text,Datasource
    In Source Query Text  column level All reports Queries are available but I want Each Report wise Table name & columns List.If any solution Please share me.
    Regards
    Rama

    Hi Ramakoteswara,
    According your description, you want to show used tables and columns of each report, and display is into a single result set. Right?
    In this scenario, we don't know where to find a column contains the Source Query Text. With my understanding, in Reporting Services, we have Catalog table in ReportServer DataBase, it has a column called Content stores the report code (.xml). In the
    code we can find the Query and Fields. Then you need to use VB/C# code to parse each .xml code of each report and fetch out the table name and columns. We do not support writing any queries against SSRS DataBase or parsing data records in any
    table.
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Find out all custom concurrent program

    Hi experts,
    I am looking for the query that can bring me all custom concurrent programs. We did not follow the naming convention so that It is so difficult the find find out all custom concurrent programs. If you have that sql, please kindly share with me.
    Thanks in advance.
    HL

    That is another question, probably the question was asking the custom tables, and I found out almost custom tables. Now, I am asking about custom concurrent programs. If I base on creation_date, it seems to me that I can get 60%-70% of custom concurrent programs. But I need all custom concurrent programs. Do you have the query that can list all standard current programs. Then I can exclude them on my list and I can get the expected result.The same way you got the list of custom table you can use to get the list of custom concurrent programs.
    You can query the same tables/views and get the list of seeded concurrent programs (CREATED_BY in (-1, 0, 1, 2)). Please pay attention to the custom concurrent programs which were created by any of those users (ANONYMOUS, SYSADMIN, AUTOINSTAL, INITIAL_SETUP).
    Thanks,
    Hussein

Maybe you are looking for

  • Operation not found error while calling AM methods from managed bean

    Hi, operation not found error while calling AM methods from managed bean. written a method with two parameters in AM. exposed the method in AM client interface in the page bindings added the method in method action ..left empty in the value fields of

  • IBooks PDF support not available in iPod touch 3rd gen!!???!?!?!?!

    I installed the iBooks app in my 3rd gen iPod touch today and I can sync books I bought in my iPad pretty well....but I do NOT have PDF support!!! (After I updated the app my iPad was capable to do so) I've seen screenshots in Engadget and other site

  • Multi Cam View

    Perhaps someone can explain what is happening... I have a 2 camera edit.... Both cameras are synced on timeline.  I dragged them into a new sequence - enabled multi cam and then opened the multi cam monitor. When I right click on timeline video, I se

  • Eclipse & Running my RMI Server

    I have everything set up nicely to run my RMI Sever from eclipse and I keep getting this error message. Any help would be greatly appreciated: Exception in MAIN java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:

  • Edit-In-Place still caching media

    FCSvr system, XSAN, Edit-In-Place set for all Devices. But when FCP projects are checked out by the editors, it still loads all the video files into their local Cache. Unable to duplicate the problem on my own system. The difference is that they have