API to find out identity of current thread in a feature receiver?

Hi All,
What API can I use to get the identity under which the current thread is running in a feature event receiver?
Thank you!

hi,
use System.Threading.Thread.CurrentThread.ManagedThreadId.
Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

Similar Messages

  • How to find out the number of threads created under java vm at runtime

    our application seems to have hit the max number of threads that can be created under vm and the vm will just hang after that. that behavior seems to be consistent from an article that I read earlier.
    I wonder any way that java app can find out the number of threads currently created under vm?
    thanks in advance!

    If you are not starting an extra thread group you can use the Thread.activeCount method. But this willnot return all the threads, as there are some jvm threads, i.e. garbage collector. Also if you are running on a Unix type operating system then you can send a signal to the jvm to give you a thread dump, i think the signal is sighup.
    If the application is hanging i would of thought that you have a deadlock situation rather then the JVM not being able to create new threads, roughly how many threads should be running ??

  • How to find out the users currently logged into ODI

    Hi all,
    How to find out the users currently logged into ODI Work Repository?
    Thanks.

    Hi,
    It stores all the final queries in work rep table i.e "SNP_SESS_TXT_LOG" and the column is "TXT".
    Here u can find all the ODI bkp process queries.Pls specify the SESS_NO for purtivular task u want to check which u can get this in ODI operator.
    I dont think so that it will keep the substituted value(because its implicit and temporary process) but it will keep all the default values in the table SNP_VAR_SESS and the column is "DEF_V".
    Thanks,
    katukota

  • Please help me to find out how to turn off the shuffle feature on my touch i-pod, Please help me to find out how to turn off the shuffle feature on my touch i-pod

    Please help me to find out how to turn off the shuffle feature on my I-pod nano ... THANK YOU!!!!!! :)

    Just figured it out :) Thanks though!!!

  • Is there a way to figure out what the current thread is?

    I've got the following snippet of code:
    // create a new thread. If the current thread is not this new thread, return
    Thread CountDownThread = new Thread("CountDownThread");
    CountDownThread.start();
    if (/*CURRENT THREAD*/.getName() != CountDownThread.getName()) {
         System.out.println ("I'm not CountDownThread. I'm leaving.");
         return;
    // current thread should be new thread. Therefore start the countdown
    CurrTime = InitTime;
    while(CurrTime.charAt(0) != '-') {      // go until current time is negative
         CurrTime = C.countDown();       // returns the current time based on the difference between the initial and elapsed time
         setText(CurrTime);                   // display current time in JLabel
    C.reset();
    setText(C.getCurrTime());What I'm trying to do is get a clock (C) to count down and display the time remaining in a JLabel (this snippet is taken from a method within that very JLabel which I'm extending from javax.swing.JLabel). While it's counting down, I'd like for the program to go off and do other things. Therefore, I'm trying to create a new thread that carries out the task of counting down while the original/main thread moves on to do other things.
    Please have a look at the above code and tell me if I'm on the right track. The one thing I don't know how to do is figure out how to tell which thread the current thread is. I'm assuming that both the new thread and original/main one will execute the if statement, the new one after it returns from start() (which I haven't defined). The original/main one will detect that it is not the new thread and return, whereas the new thread will and go on to the while loop. In the while loop, it will count down the clock until it reaches 0, after which point it will reset it and die.
    If I'm on the right track, all I need to know is how to detect which thread is currently executing. If I'm not on the right track, what would be the best way to do this?

    What? No! No Thread terminates on the return of start(). Those two events are unrelated!Uh... I think you misunderstood what I said.
    I didn't say that CountDownThread terminates upon returning from start() (which is what it sounds like you interpreted from me); I said that the thread that CountDownThread creates terminates once CountDownThread returns from start() (i.e. like any other local variable/object). This, of course, assumes that CountDownThread has a Runnable object on which to call its run() method (am I right?), in which case my code above doesn't create a new thread at all (i.e. CountDownThread.start() is executed within the main/original thread) - am I right?
    No, run() doesn't call start()! That would be stupid.Again, you misunderstood. I shouldn't need to explain this one. A simple reference to an ordinary dictionary on the words 'former' and 'latter' should suffice :)
    Anyway, all joking aside, I have now improved my code and it works! Here's what it looks like:
    ClockJLabel.java
    package MazeMania.clock;
    public class ClockJLabel extends javax.swing.JLabel {
    private Clock C;
    private ClockJLabelsRunnable CJLR;
    public ClockJLabel() {
      C = new Clock();
      CJLR = new ClockJLabelsRunnable();
      setText(C.getCurrTime()); // should be 00:00:00:00
      setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
      // need to figure out how to set the size so that it sticks
      setForeground(new java.awt.Color(255, 0, 0));
      setBackground(new java.awt.Color(0, 0, 0));
      setOpaque(true);
    // starts the clock counting up indefinitely from 0
    public void start() {
      (new Thread(new Runnable() {
        public void run() {
         while(true) setText(C.getElapsedTime());
       })).start();
      //System.out.println("Started clock...");
    // starts the clock counting down from an initial time and runs this count down in a separate thread
    public void countDown(String InitTime) {
      // initialize the clock
      try {C.initClock(InitTime);}
      catch(java.text.ParseException PE) {
       System.out.println(PE.getMessage());
      // initialize JLabel's display
      setText(C.getCurrTime());
      // prepare Runnable and give it to new Thread. New Thread starts count down.
      CJLR.task = CJLR.COUNTDOWN;
      CJLR.CJL = this;
      Thread CountDownThread = new Thread(CJLR);
      CountDownThread.start();
    public Clock getClock() {
      return C;
    }ClockJLabelsRunnable
    package MazeMania.clock;
    import java.lang.Runnable;
    class ClockJLabelsRunnable implements Runnable {
    public static int COUNTDOWN = 1;
    public static int COUNTUP = 2;
    // NOTE: this Runnable doesn't test for the proper setting of these variables
    public int task = 0;
    public ClockJLabel CJL = null;
    public void run() {
      Clock C = CJL.getClock();
      while(C.countDown().charAt(0) != '-') {CJL.setText(C.getCurrTime());}
      C.reset();
      CJL.setText(C.getCurrTime());

  • How can I find out if the current CPU is 32-bit or 64-bit?

    I am developing a program that calls an external c++ executable with a certain parameter. With certain parameters, the executable often takes up large amounts of memory (<4GB). This is bad as I am often running this program on a 32-bit machine.
    I am compiling this program on a 32-bit machine and running it (sometimes) on a 64-bit machine.
    I need a way to find out if I have a 32 or 64 bit CPU. I can't solve the problem of it crashing with these parameters, however I can avoid calling the executable for these specific parameters when I am on a 32 bit machine.
    As far as I know, System.getProperty("sun.arch.data.model") will return the size of your java Virtual Machine, but I need to know the size of the CPU
    So basically, to sum it up:
    I need a way of finding out what the size of the runtime machine is. (32-bit or 64-bit)
    Thank you in advance!
    -Andysics

    Crossposted as a response to another thread.

  • Find out information about current network connection

    Hi,
    I am looking for a library that helps me find out several things about the current network connection, e.g.
    - am I behind a firewall?
    - latency
    - bandwidth
    I know, that the information gathered largely depends on the internet connection of another client or server and may change over time. However, I still need the option to find out... And instead of reinventing the wheel, I asked myself if there was something out there I did not find using search...
    Thank you very much
    Karl

    There is no such thing (at least not that I know of) because it is technically almost impossible to do. As you already mentioned you need some other party you can test with for the different factors. There are things like STUN, though, which can help you find your IP address as it appears to other people on the internet.

  • How do i find out when my current phone and broadb...

    Hiya i hope someone can help how can i find out when my bt phone and broadband package ends i have looked everywhere on the site and just cant seem to find it.
    thank you

    Phone sales on 0800800150 and ask them when it ends
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the reply answers your question then please mark as ’Mark as Accepted Solution’

  • Where Can I Go To Find Out How To Use New iOS 4 Features?

    I have just updated my ipod touch to ios 4. I have the wallpaper feature so I am presuming the rest of the features should work. How to I find out how to use the other features such as App folder options, Multitasking etc as I can't seem to be able to ??
    Thanks in advance to anyone who may be able to help

    Start Here. Search Google.
    You must have a 3G or later model to use multi-tasking and some other features.
    Message was edited by: Kappy

  • How to find out which lists are using email enabled feature in my SP 2010? Any script? Anything else?

    Hi there,
    How to find out which lists are email enabled in my SP 2010?
    Any script? Anything else?
    Thank you.

    Hi frob,
    check this script that is stated on this link
    $SPwebApp = Get-SPWebApplication "http://migration.Company.com"
    <# If it is MOSS 2007, You can use:
    $SPWebApp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup(http://sharepoint.com)
    To get SPWebApplication Object
    #>
    #create a CSV file
    "E-Mail,List,Site" > "EMail-Enabled.txt" #Write the Headers in to a text file
    foreach ($SPsite in $SPwebApp.Sites) # get the collection of site collections
    foreach($SPweb in $SPsite.AllWebs) # get the collection of sub sites
    foreach ($SPList list in $SPweb.Lists)
    if ( ($splist.CanReceiveEmail) -and ($SPlist.EmailAlias) )
    # WRITE-HOST "E-Mail -" $SPList.EmailAlias "is configured for the list "$SPlist.Title "in "$SPweb.Url
    $SPList.EmailAlias + "," + $SPlist.Title +"," + $SPweb.Url >> EMail-Enabled.txt #append the data
    http://www.sharepointdiary.com/2011/06/find-all-incoming-email-enabled-lists.html
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation. Please remember to mark the reply as answer if it helps.

  • API to find out all unsaved changes since last safe

    I am currently implement a cPro Subsystem.
    During the save operation, I would like to analyze the changes that the user has done since the last saving (e.g. change in the field "GROUPING" of a task, or newly added phase, or new assignment of a business partner to a role).
    Is there a service class, an API or something similar by which I can find that out?
    Some kind of change manager or change log class?
    Best regards,
    Daniel

    Hi Daniel,
    The class CL_DPR_APPL_OBJECT_CHANGE_MNGR should store the information you wanted. The problem is that the attribute
    MT_UPDATED_OBJECTS is private and can not be retrieved externally.
    Actually, if a sub system is implmented, typically the following three methods should be added:
    ON_OBJECT_CREATE     Instance Method     Private          Event handler for cPro Object create
    ON_OBJECT_CHANGE     Instance Method     Private          Event handler for cPro Object change
    ON_OBJECT_DELETE     Instance Method     Private          Event handler for cPro Object delete
    they should re-act of the change of cProject object,
    e.g. ON_OBJECT_CHANGE
    Event handler for                
    Class/interface CL_DPR_ENTITY    
    Event           CHANGED          
    Kind regards,
    Zhenbo

  • Any plug-in api to find out the product info.

    Hi ,
    Is there any plug-in api which can provide information about product name in which it is loaded ...like this plug-in is loaded with Acrobat Reader or Acrobat Professional ?
    Regards,
    Arvind

    Thanks Leonard,
    Yes, I found api named ASGetConfiguration(ASAtomFromString("Product")) for this.

  • How to find the Current threads idle in each execute queue

    Hi,
    Currently I am able to get the idle threads in the default queue.
    I would like to find out if it is possible to find out the no of threads
    that are idle in each of the execute queues in the wls server.
    Thanks
    Senthil

    Senthil Kumar wrote:
    Hi,
    Currently I am able to get the idle threads in the default queue.
    I would like to find out if it is possible to find out the no of threads
    that are idle in each of the execute queues in the wls server.
    Thanks
    Senthil
    Senthil, the easiest way from the command-line is by using a
    ExecuteQueueRutime MBean. You could use the simple syntax below or use
    the more specific domain oject name. You could also omit the -property
    option and get a list of every attribute for the bean.
    %java weblogic.Admin -url t3://127.0.0.1:7001 -username system -password
    weblogic -get -pretty -type ExecuteQueueRuntime -property
    ExecuteThreadCurrentIdleCount
    HTH
    ~Ryan

  • Finding out the userid from a JSP or servlet. (9.0.2)

    Hi Again!
    I have a JSP in the htdocs directory of my portal which fetches binary objects
    from a content repository. I use this binary.jsp to display images embedded
    in a content portlet shown within the portal. So as far as the browser gots
    the portal page it starts to fetch the images with an ordinary get operation
    to a given URL of the binary.jsp.
    Now I want to be able to find out if the current user is allowed to see the
    image from the content repository, so I have to find out the userid within
    the JSP. But I couldn't find any way to do this. Since the binary.jsp is
    not loaded in the context of the portal, it doesn't know anything about
    the PortletRendererRequest, so thi code returns null:
    PortletRenderRequest oraRequest = (PortletRenderRequest)
    request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    if ( oraRequest == null ) {
    makeLog ("Could not get PortletRequest!");
    } else {
    oracleUser = oraRequest.getUser().getName();
    So I've tried to put the userID into the servlet session like this
    request.getSession().setAttribute("iASUserName", oracleUser);
    but obviously the binary.jsp doesn't share the same http session object,
    so this code returns null within the binary.jsp
    request.getSession().getAttribute("iASUserName");
    We allready done this with the old version of PDK and JServ and
    everything was OK, except that we used the deprecated API
    request.getSession().setValue("iASUserName", oracleUser);
    request.getSession().getValue("iASUserName");
    No both ways doesn't work, since we are using Orion-Appserver
    and PDK 9.0.2 :-(
    Is there anyone out there with an idea how we can solve
    this problem?

    I could understand what you are lookig for. We can probably relie on cookies to share user information between portal & non-portal resources.
    Example :
    Lets say we have a contributor.jsp viewed through portal. This sets up a cookie in the client machine which carries portal user name. It persists till the end of user session.
    contributor.jsp
    <%
    PortletRenderRequest pr =
    (PortletRenderRequest)request.getAttribute(HttpProvider.PORTLET_RENDER_REQUEST);
    String pUser = pr.getUser().getName();
    /* Customize these strings to suitable names. */
    String pUserKey = "CUR_PORTAL_USER";
    String pDomain = ".oracle.com";
    %>
    <SCRIPT language="JavaScript1.2">
    var today = new Date();
    function setCookie(name, value, domain)
    document.cookie = name + "=" + escape(value) +
    "; path=/" +
    "; domain=" + domain;
    </SCRIPT>
    <BODY onload="javascript:setCookie('<%=pUserKey%>', '<%=pUser%>', '<%=pDomain%>')"/>
    This cookie now will be set in the client machine and any JSP in the same domain will be able to access it.
    Let me know if it offers any help to your problem.
    Thanks,
    Amjad.

  • Simple Question: Getting Current Thread

    hi. i'm confused about the currentThread() method. it's a method of the Thread class, but if you have to call it from a Thread, then what's the point?
    say in my program i want to find out what the currently executing thread is. how can i call a method of the Thread class when i don't have a Thread object? if i knew which thread were running, i wouldn't need to call the function. you know what i mean?
    so i guess there must be a way to get ahold of whatever thread you're in at any point in your code, right? what if i want to get the currently executing thread in my GUI- like, everytime i push a certain button, i want to put the thread handling that button to sleep or something. can it be done? if so, how?
    thnx in advance
    ~spoongirl

    I'm not familiar with the static keyword in C, but when it's used for a method in Java, it means the method is a class method instead of an instance method.
    Consider the Math class, with a whole bunch of static methods. For example, the cos(double a) method. The cosine of a 45 degree angle will always be the same, so there's no need to have an instance of the Math class in order to use the method; regardless of what you would want to do with that instance, the cos() method would have to return the same value if you pass it the value 45, so it might as well be accessible regardless of whether or not there's an instance of the class.
    The same is true for variables. Again in the Math class, there's the constant PI. The value of PI is always going to be 3.14etc., so there wouldn't be a reason to have PI be an instance variable that could be changed for each instance. Instead, by making it static, you don't have to have an instance to use it, you just use Math.PI.
    I hope that makes sense. It took me a few months with of an ineffective instructor before I really understood the significance of the modifiers static, protected, private, etc. Hopefully I'm not being equally ineffective now. :)
    Rich

Maybe you are looking for

  • Nokia Lumia 920 India Launch ! - Some Observations...

    Hi, Being a Nokia fan for years .. I decided to write this .. I hope people at the right level from Nokia see this. We all know Nokia Lumia 920 has probably hit all the right spots with Users abroad and the best thing is they are loving it a lot. I p

  • Flash Pro not open or create files.

    Hi, I have Flash CS5.5, but this problem happens to all the Flashes I use, the CS4, CS5, CS5.5... I dont Have the Flash CS6/CC (My PC don't runs the trial), but the problem not apply in CC and CS6 versions... The problem specifically is this: I open

  • Batch input messages

    hi experts how can i find out what is the meaning of the message numbers in batch input operation, and what is the meaning of the message type. thanks amit

  • Time Machine disk not showing up in Migration Assistant

    I have backed up my Snow Leopard with Time Machine and I'm trying to import my stuff into Lion using Migration Assistant. However, my Time Machine disk is not showing up in Migration Assistant even though it's connected and shows in Finder. Any idea

  • MD datasource for Purchase orders in Procurement(MM)

    Hi Friends, Do I need to activate all the MD datasources under MM or are there any particular MD datasource for Purchase Orders .... Points will be awarded