Which is the best way for a called function to identify caller class name.

Which is the best way for a called function to identify the caller class name .
1)Using sun.reflect.Reflection from called function
                Class caller = Reflection.getCallerClass(2);
                System.out.println("Caller Class Name ::"+caller.getName());2) Analyzing current threads stack trace from called function
                StackTraceElement[] stElements=Thread.currentThread().getStackTrace();
                System.out.println("Caller Class Name ::"+stElements[3].getClassName());Is there any alternate ways to achieve the same .Which is the best way ?
Called function doesn’t have any arguments, I don’t want t pass any arguments from caller function to called function.
Plz help.
With kind regards
Paul

798185 wrote:
Which is the best way for a called function to identify the caller class name .
Is there any alternate ways to achieve the same.SecurityManager
    // 0 is the anonymous SecurityManager class
    // 1 is this class (also works in static context)
    // 2 is calling class
    static Class getClass(int i) {
        return new SecurityManager() {
            protected Class[] getClassContext() {
                return super.getClassContext();
        }.getClassContext();

Similar Messages

  • Which is the best way for posting a large number of records?

    I have around 12000 register to commit to dababase.
    Which is the best way for doing it?
    What depends on ?
    Nowadays I can't commit such a large number of register..The dabatase seems hanged!!!
    Thanks in advance

    Xavi wrote:
    Nowadays I can't commit such a large number of registerIt should be possible to insert tens of thousands of rows in a few seconds using an insert statement even with a complex query such as the all_objects view, and commit at the end.
    SQL> create table t as select * from all_objects where 0 = 1;
    Table created.
    Elapsed: 00:00:00.03
    SQL> insert into t select * from all_objects;
    32151 rows created.
    Elapsed: 00:00:09.01
    SQL> commit;
    Commit complete.
    Elapsed: 00:00:00.00
    I meant RECORDS instead of REGISTERS.Maybe that is where you are going wrong, records are for putting on turntables.

  • Which is the best way for creating video placeholders in AE?

    I should create some video placeholder for AE animation, but I am not sure which is the best approach to do that.
    I found some tutorials on the web where is explained how to create basic placeholders in AE, but I want to do something better.
    Could I create some placeholder even in Photoshop? And after that to import this psd files into AE.
    I saw some intersting placeholders on Videohive but I don't know how to create something similar?
    Any help?
    Regards!

    Any layer may be replaced with new footage by simply selecting the layer you want to replace in the composition, then selecting the new footage in the project panel, then holding down the Alt/Option key and dragging the new footage to the composition.
    If you want to automate the process of replacing footage you'll have to use a script.
    If you want to use a project as a template then simply copy the template file in it's folder and paste it into a folder that contains the same structure as the template. IOW, the folders should look like this:
    Template Project
         >template.aep
         >Footage
    New project
         >copiedtemplate.aep
         >Footage
    Your footage has to have the same filename as the original template project.
    You can also save an AE project as a template (aet) project. That's what they are doing on siges like Video Hive. The template isn't easily overwritten so it maintains the work. Then you simply add your footage using the first technique that I talked about.

  • Which is the best way for iOS to communicate with the webserver SOAP or JSON

    Which one is the best for iOS to interact with the webserver.. to exchange messages like
    1. Normal NSString
    2. images
    3. audio
    4. videos
    like any other stream of bits..
    Thank you

    There is a reason why JSON took over AJAX world. I have been too busy to research this myself, but you may be interested in WebSockets.

  • Which is the best way to create a connection object

    hi,
    Eventhough i am not new to java I just wanted to know that which is the best way for creating sql connection object.
    Is it using the DriverManager.getConnection(..,..,..) or using a datasource and getting the connection.
    Which is more efficient or Is there any other way to create sql connection which is even more better.
    thanks in advance.
    pradeepbhargav

    AFAIK all connections, DataSource ones included are created by calling the DriverManager. A DataSource is a factory for Connection objects (from JavaDocs)
    If you're talking about managing connections then it depends on the application. A DataSource is great for apps that can support many clients or are multi-threaded, but may require a JNDI implementation to get to it.
    If however you have an single threaded app that hits the database in a serial fashion, then DataSource is probably an overkill.
    Dave

  • The BEST way for recharge iPhone4.

    Hy to all!
    My answer is:
    Which is the BEST way for recharge the iPhone4?
    When the battery is completely to %0 or not?
    Finally, the iPhone when is in recharge mode, the best way is that it is turned on or turned off? Because if it's are turned off, how i understand that are 100% recharged?
    Thank you!

    Garydp wrote:
    I agree that you can't charge while off unless it is completely flat. Even then when it has charged for a while the phone switches back on. Just tried again to make sure and as soon as I plugged the charger in the phone turned on.
    Hi, Actually an iPhone can be charged when off at any time, not just when totally exhausted. It is true the the phone will turn on when plugged in if it's off to begin with, however, if it is turned off after being plugged in, it will indeed charge. This is how I habitually charge mine overnight.
    Regards, R.

  • WHat is the best way for other iphone users to share pictures with me?  I am doing a project which req. people to send me 100 pictures at a time that I'll be putting in my iphoto?

    WHat is the best way for other iphone users to share pictures with me?  I am doing a project which req. people to send me 100 pictures at a time that I'll be putting in my iphoto? thank you.

    ingridlisa,
    I'd suggest to ask them to create Shared PhotoStreams and to invite you to view the streams, see:
    iCloud: Using and troubleshooting Shared Photo Streams
    Regards
    Léonie
    Added:
    that I'll be putting in my iphoto?
    Will you be collecting the photos in iPhoto on your iPhone or on a Mac? On a Mac a Shared PhotoStream requires Mac OS X 10.8.2.

  • I am looking to start developing apps for the iTunes Store, but I have no previous experience. What is the best way for me to start on this? As in which programs and materials must I need and what I need to know. Thanks!

    I am looking to start developing apps for the iTunes Store, but I have no previous experience. What is the best way for me to start on this? As in which programs and materials must I need and what I need to know. Thanks!

    You will need a Mac, with OS X 10.6+ on it, to be able to develop iOS apps.
    There is some info on these pages :
    developer site : https://developer.apple.com
    developing for iOS 7 : https://developer.apple.com/ios7/
    developer support : https://developer.apple.com/support/
    developer forums : https://devforums.apple.com/index.jspa (you will need to be a registered developer to access them)

  • My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

    My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

    My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

  • Which is the Best way to upload BP for 3+ million records??

    Hello Gurus,
                       we have 3+million records of data to be uploaded in to CRM coming from Informatica. which is the best way to upload the data in to CRM, which takes less time consumption and easy. Please help me.
    Thanks,
    Naresh.

    do with bapi BAPI_BUPA_FS_CREATE_FROM_DATA2

  • Which is the best way of deploying JSP (mod_ose or OSE) ?

    I need to deploy some jsps that are using servlet api 2.2 and i would like to know which is the best way of deploying these jsps?
    Thanks
    RJC

    Speaking of JServ Vs OSE, I have some related questions on it. I would appreciate if someone can answer:
    1.For a stateful servlet (assuming that we are using Oracle JVM), Will it not call the init() method of the servlet each time for a client (because each client will have his own Oracle JVM)? If so, isn't that expensive because it needs to initialize the servlet again?
    Again, for the same servlet, Will it not have a servlet context for each and every client? Isn't that expensive? ( A servlet context by definition maintains state information for all instances of a web application within any single JVM)
    2. If we have an application that has some portion of it which is stateless and some portion of it which is stateful, how do we make a choice JDK JVM vs Oracle JVM?
    Can we (for the same application) use both the JDK JVM as well as Oracle JVM? If so, how does the JDK JVM talk with Oracle JVM?
    3. Since Oracle JVM is useful for stateful applications only, does it mean that we cannot use it for Stateless session beans? (In an application we might have stateless session beans, stateful session beans as well as entity beans) Should we be using JDK JVM or Oracle JVM?
    4. For Servlets too, we might have stateless servlets and stateful servlets within the same application. If so, can we use JDK JVM for stateless servlets and Oracle JVM for stateful servlets? If so, how does the JDK JVM talk with Oracle JVM?

  • Which is the best iOS for iPhone 3G? I am currently on 3.1.3 !

    Which is the best iOS for iPhone 3G?
    Should i update it to the latest 4.2.1 or let it be on my current firmware 3.1.3?
    I have heard that 3G is best on 3.1.3?
    Comment?

    If I may, I agree that version 3.1.3 is the best for the iPhone 3G, however, I am currently travelling in Europe and I have a SIM card from a local mobile company. I discovered the hard way that there is an option missing: Settings > General > Network > Cellular Data (on/off). This option is not present in iOS 3.1.3. So basically, you disable 3G but it is impossible to block EDGE, and your phone will automatically revert to it if 3G is not available, and you will occur cellular data fees anyway.
    I am sure of what I am saying because with the local service I use, I have unlimited data for $4 per day, but it is debited as soon as I consume one byte of data, then it is free until midnight the same day. Event if I have set Enable 3G = off, Data Roaming = off, for two days in a row, I was still charged the $4 a day because the Cellular Data was not off!
    I compared with my wife's iPhone 3GS with iOS 5.1, there is the three options, Enable 3G (on/off), Data Roaming (on/off), Cellular Data (on/off). The option to turn it off simply doesn't exists on iOS 3.1.3!
    With some research, I found that it is possible to block it anyway if you change your APN (Access Point Name) to an invalid setting. The easiest way to do this is to connect to the Internet using WiFi, then access this web site with Safari: http://unlockit.co.nz/ (from your iPhone).
    This online tool allows you to change your APN, it is very useful when you travel abroad and you use local SIMs. On the first screen press Continue, on the second screen press Custom APN to create an APN for a local mobile company, or press Disable Data (FakeAPN) to disable 3G and Edge for good. When creating a Custom APN, you will be asked to choose a Country and a Provider, then press Create Profile. Then, either way, press Install and "Install Now" or "Replace", then press Done. This will add two things to your phone: first, an app-like icon for quick access to the website http://unlockit.co.nz/, second, a new menu in Settings > General, labelled "Profile", that contains your new APN. Note that it is possible to add several profile information, and some may conflict with each other. Remove those you don't need. Don't remove them if you are not sure!
    I hope this works for you!

  • What's the best way for home sharing to iDevices without iTunes?

    What's the best way for home sharing movies and tv shows on my iDevices?  I know I can use home sharing through iTunes, but I'm looking for a way to share videos to my iDevices without having to leave my computer on.  I have a MacPro, iPhone, iPad, Airport Extreme, and Airport Express (and several external hard drives).  Can anyone suggest an app that would do this?  Can I have videos on an external hd attached to an Airport Extreme/Express and have it stream without iTunes?

    If your "server" is new enough to run Mountain Lion, you can purchase the OS X Server app from the Mac App store and you'll have everything you need to host a NetInstall (NetBoot) server.
    If your machine does not support Mountain Lion, you'll need to purchase the appropriate Mac OS X Server software (i.e. Lion Server or Snow Leopard Server)
    From there you can host NetInstall or NetRestore images, depending on your preferred workflow, which can be created using System Image Utility.
    As Richard points out you can also use Deploy Studio which, again depending on your preferred workflow, might simplify things.

  • Which are the best settings for exporting comps before edditing in Premiere Pro

    Hello everyone!
    As the title says, which are the best settings for exporting comps from AE to Pr.Pro and then edit them?
    Let  me explain: I have two comps in AE (intro and outro) and want to export  them in Pr.Pro for edditing along with a fottage i shot.
    When i render them the size of the files are huge (30 sec= 7GB).
    Which  is the best method (and settings) i can export the intro and outro to a 'normal' file  size and then put them in Pr.Pro without loosing any quality??
    [Comp settings: HDTV 1080 29.97 (1920x1080)]
    AE and Premiere Pro both CS4

    If you're rendering and exporting an intermediate video file to go from After Effects to any other piece of post-production software (such as Premiere Pro), you want to make sure that you're not losing any quality.
    Most compression methods, which make movies smaller, also lose some of the image data---i.e., quality. There are a few compression methods that don't lose any image data; these are "lossless" codecs. These lossless codecs do decrease the size of a video file, but they're nowhere near as effective at decreasing size as the lossy codecs are. But file size isn't important when you're doing post-production work. Big files are a fact of life in post-production.
    Examples of lossless codecs include the PNG codec and the Animation codec at the highest quality settings, both of which can be used in a QuickTime (.mov) container. I prefer the PNG codec; it's more efficient for photorealistic images, whereas Animation is more efficient for things like cartoons. There are lots of other lossless and nearly lossless codecs. A lot of people that do video editing like the Lagarith codec, but that is something that you'd have to go and get; it's not part of a standard CS5 or QuickTime installation.
    See these FAQ entries for information about compression and why file sizes are big for losslessly encoded files:
    "FAQ: Why is my output file huge...?"
    "FAQ: What is the best format for rendering and exporting from After Effects?"
    By the way, keep in mind that you don't always need to render and export an intermediate movie to go from After Effects to Premiere Pro. There are other ways to move data back and forth between these applications, including Dynamic Link. Which is best depends on the specific circumstance. See "Working with Premiere Pro and After Effects".

  • What are the best ways (for best performance) in MII to process the incoming process messages from shop floor systems to SAP ECC 6.0 and vice versa?

    Hi All,
    Can you please suggest to choose the best ways (for best performance) in MII (12.2 on NW 7.3), to process the incoming process messages from shop floor systems to SAP ECC 6.0 and vice versa?
    Thanks

    Hi Surya,
    Best practices for flow of data from ECC --> SAP MII --> Shop floor & Vice verse:
    1. Send ECC data through IDOC's/RFC's as messages to SAP MII message listener and BSL transaction process data and update directly on shop floor database as if you configured in Data services or later send those data by web service to shop floor system (i.e. depends on Shop floor machines).
    From Shop floor:
    shop floor --> SAP MII --> ECC
    1. Use either Web service or fetch data from DB and pass data to BAPI's  for sending to ECC through BLS transaction.
    Regards,
    Praveen Reddy

Maybe you are looking for

  • How to give a value in Token when Conc prog method registered as pl/sql typ

    Hi We have a report which will generate invoices for a given Operating Unit at one time.i.e Conc Prog1 We have a customised pl/sql package which submits the above report conc prog for all Operating Units with the required parameters for the report.i.

  • I am running Windows 7-32bit...

    I had to restore my laptop to an earlier date/time (before I tried out the Adobe CC trial software). Now that I have the Desktop app loaded, it indicates that all the apps I chose to trial, are "up to date". Yet they are missing off my Programs and F

  • Mac App Store keeps crashing...

    Whenever I want to see any updates for my Mac, the App Store keeps crashing, as well as the iTunes Store and iBooks Store. I don't know what's going on, but last night everything was working...

  • Are there any third party apps for Mavericks outside the Apple store?

    I am looking for a way to highlight / color code the full file or folder name. Mavericks changed my color codes to small dots, worthless.  Are there still such things as "helper" apps or "plug-ins" that change the way finder behaves, or has Apple loc

  • Unable to install new itunes update

    i am unable to sync my phone as my mac requires new version of itunes, but when i try to install it says i have the lastest version. can anyone advise what i can do to install the latest version?