Retrieve list of threads.

If an application has multiple threads running started by multiple classes, is there a simple way to get a list of all running threads, so we can safely shut them down?
(ie the http listener receives the shut down message, but it doesn't know what other threads have been started by the other threads in the application, so simply exiting the webserver thread doesn't terminate the application)

ThreadGroup will give you a list of active threads, but "safely shutting down" is another issue, because it's up to the thread's code to specify a way of safely shutting it down, so if you didn't write it there's no assured way.

Similar Messages

  • Trying to retrieve list of rooms using EWS Managed API but it returned empty collection

    Hi,
    I'm trying to retrieve list of rooms using EWS Managed API. Before I have tried the following code I make sure our Administrator put all the rooms in a list following  link https://technet.microsoft.com/en-us/library/ee633471%28v=exchg.141%29.aspx.
    Here is the simple code I have used :
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Microsoft.Exchange.WebServices.Data;
    using System.Net;
    using System.Security;
    namespace ExchangeConsole1
    class Program
    static void Main(string[] args)
    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
    service.Credentials = new NetworkCredential("username", "Password1", "domain");
    service.Url = new Uri("https://email.xxxx.com/ews/exchange.asmx");
    EmailMessage email = new EmailMessage(service);
    EmailAddressCollection listOfRoomList = service.GetRoomLists();
    // Display the individual rooms.
    foreach (EmailAddress address in listOfRoomList)
    Console.WriteLine("Email Address: {0}", address.Address);
    service.GetRoomLists() results "Enumeration yielded no results". Could anybody help me please ?
    Thanks
    Sandipan

    Enable tracing and see what the response from the server looks like. Also depending on your setup and how long ago your administrator created the list, it may take some
    time to replicate.
    Administrator has done it one week ago. Here is the trace response I am getting
    <Trace Tag="EwsResponse" Tid="9" Time="2015-04-10 15:36:37Z" Version="15.00.0847.030">
    <?xml version="1.0" encoding="utf-8"?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
    <h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="995" MinorBuildNumber="31" Version="V2_15" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <m:GetRoomListsResponse ResponseClass="Success" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
    <m:ResponseCode>NoError</m:ResponseCode>
    <m:RoomLists />
    </m:GetRoomListsResponse>
    </s:Body>
    </s:Envelope>
    </Trace>
    It's say no error.  Any help ?
    Thanks
    Sandipan

  • Retrieve List Items based on condition in Where Clause

    Hello Experts,
     I am trying to retrieve list items from a list (CityList)  which contains 2 columns one is city(string) and State(Lookup) based on Lookup value, but i am getting all city names.
    here is my query below.
    function MainFunction() {
            var lookupid = 5;
            var myQueryString = "<Where><Eq><FieldRef Name='State' LookupId='true' /><Value Type='Lookup'>"+lookupid+"</Value></Eq></Where>";
            var myContext = new SP.ClientContext.get_current(); ;
            var myWeb = myContext.get_web();
            var myList = myWeb.get_lists().getByTitle("CityList");
            var myQuery = new SP.CamlQuery();
            myQuery.set_viewXml(myQueryString);    
            myItems = myList.getItems(myQuery);
            myContext.load(myItems, 'Include(Title)'); 
            myContext.executeQueryAsync(Function.createDelegate(this, GetListDataSuccess), Function.createDelegate(
    this, GetListDataFail));
        function GetListDataFail(sender, args) {
            // Show error message
            alert('GetListDataFail() failed:' + args.get_message());
        function GetListDataSuccess(sender, args) {
            var currListItemCount = myItems.get_count();       
            var currItemEnumerator = myItems.getEnumerator();
            var currItemDetails = '';       
            while (currItemEnumerator.moveNext()) {          
                var currItem = currItemEnumerator.get_current();          
                 currItemDetails = currItemDetails + ';' + currItem.get_item("Title");
            // Show details 
            alert(currItemDetails); 
    Please suggest where i am wrong. 
    Thank you
    saroj

    You need to enclose the <Where> tag inside <View><Query> . Try like below
    var myQueryString = "<View><Query><Where><Eq><FieldRef Name='State' LookupId='TRUE' />
    <Value Type='Lookup'>"+lookupid+"</Value></Eq></Where></Query></View>";
    Geetanjali Arora | My blogs |

  • When moving from a list of threads view to a thread would be nice to jump to last thread read.

    When moving from a list of threads being viewed to a thread, it would be nice to jump to last thread read or first unread thread.
    Sometimes the threads get rather long.  Sometimes I haven't read a thread in awhile & I forget where I have left off reading a thread. It would be nice to have an icon to click on to move to your last read post or the first non-read post. 
    Seems this could be implemented in javascript without too much problem.  Might be a problem of when to get rid of the tracking data.
    Robert

    This would be a new capability.   I didn't know you could jump directly to the last post in a thread by clicking on the posters name in your discussions.  However, I am interested in jumping to the first post that I haven't read.
    Since writing my original post, I realize that software doesn't know what posts I have read. Lets say there are are 26 posts in a thread.  Lets assume these are divided into three pages with at most 10 items in a page:
    page 1 -- a, b, c, d, e, f, g, h, i, j
    page 2 -- k, l, m, n, o, p, q, r, s, t
    page 3 -- u, v, w, x, y, z
    The software know that I have viewed the first three pages.  It doesn't know what post on the pages I have read.  The software would need to assume I have read all the available posts on a page.
    Now lets assume that 12 more post were added.  This results in:
    page 1 -- a, b, c, d, e, f, g, h, i, j
    page 2 -- k, l, m, n, o, p, q, r, s, t
    page 3 -- u, v, w, x, y, z, aa,bb,cc,dd
    page 4 -- ee,ff,gg,hh,ii,jj,kk,ll
    It would be nice if I could go to aa. 
    Jumping to the last post in the thread doesn't hack it. You have to spend a lot of time finding where you left off your reading.
    Intesting, the list of your posts on your homepage usings the term Last Activity were as Your Discussions uses the term Last Post. The terminalogy should be the same & should act the same.  For the existing capability of going the the last post, I was thinking of Goto Last Post.

  • Need a way to retrieve list of all tables through a RFM

    I wish to retrieve list of all tables through a RFM.
    I know the table DD02L contains a list of all other tables. I can call the RFM RFC_READ_TABLE with table name DD02L or DD03L as an input parameter. I do not wish to do this way as the table name DD02L might get changed in a future release of SAP and break my external C program.
    The question is - is there any other RFM that would return the list of tables and their properties. Does SWO_QUERY_OBJTYPES or some other SWO_QUERY_* RFMs can be used?
    Any useful info is appreciated.
    Thanks

    Thanks Ramiro.
    If I relay on TFDIR table to get a list of function modules, what are the chances that SAP will rename or get rid of TFDIR in a future release of SAP? I wish to avoid using undocumented interfaces as do not want to change my program in the future.

  • Retrieving list items from a specific view using CSOM

    How can I query a specific view of a SharePoint List using the C# CSOM? I am dealing with SharePoint Online, so the only option is to use SharePoint.Client.
    I have done this using Javascript, and I know how to do this with SharePoint On-Premises, but I haven't found a way to do with for SharePoint online using C#.

    hi Dkhouri,
    thanks for posting your issue, you can create a specific view of a list using CSOM and C#.
    Kindly find the code snippet below fort he same.
    Code for CSOM :- 
    // Starting with ClientContext, the constructor requires a URL to the
    // server running SharePoint.
    ClientContext context = new ClientContext("http:SiteUrl");
    // Assume the web has a list named "Announcements".
    List announcementsList = context.Web.Lists.GetByTitle("Announcements");
    // This creates a CamlQuery that has a RowLimit of 100, and also specifies Scope="RecursiveAll"
    // so that it grabs all list items, regardless of the folder they are in.
    CamlQuery query = CamlQuery.CreateAllItemsQuery(100);
    ListItemCollection items = announcementsList.GetItems(query);
    // Retrieve all items in the ListItemCollection from List.GetItems(Query).
    context.Load(items);
    context.ExecuteQuery();
    foreach (ListItem listItem in items)
    // We have all the list item data. For example, Title.
    label1.Text = label1.Text + ", " + listItem["Title"];
    For C# 
    public CamlQuery CreateInventoryQuery(string searchSku)
    var qry = new CamlQuery();
    qry.ViewXml =
    @"<View>
    <Query>
    <Where>
    <BeginsWith>
    <FieldRef Name='SKU' />
    <Value Type='Text'>" + searchSku + @"</Value>
    </BeginsWith>
    </Where>
    </Query>
    </View>";
    return qry;
    Also, checkout below mentioned URLs for more details
    http://www.c-sharpcorner.com/UploadFile/sagarp/sharepoint-2013-caml-query-for-item-id-with-jquery/
    http://msdn.microsoft.com/en-us/library/ff798388.aspx
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • Retrieve list items from the textbox text value and display the dropdownlist item for that particular list item

    hi,
     I have created a custom list in my sharepoint :
    List1 name:   employeedepartment  -
                   Title       empdepartment
                   A             D1
                   B             D2
                   C             D3 
    List2  name:  employeedetails  
     emptitle            empname       empdepartment(lookup) --> from the list "employeedepartment"
       x                     Ram                 D1
       y                     Robert             D2
       z                     Rahim              D3
    My task is to create a custom webpart that will be for searching this employee details by entering emptitle
    For this, i have created a visual webpart using visual studio 2010, my webpart will be like this:
    emptitle  --->  TextBox1                        Button1--> Text property : Search
    empname---> TextBox2
    empdepartment-->  DropDownList1
    For this, i wrote the code as follows:
    protected void Button1_Click(object sender, EventArgs e)
                using (SPSite mysite = new SPSite(SPContext.Current.Site.Url))
                    using (SPWeb myweb = mysite.OpenWeb())
                        SPList mylist = myweb.Lists["employeedetails"];
                        SPQuery query = new SPQuery();
                        query.Query = "<Where><Eq><FieldRef Name='Title'/><Value Type='Text'>" + TextBox1.Text.ToString() + "</Value></Eq></Where>";
                        SPListItemCollection myitems = mylist.GetItems(query);
                        if (myitems.Count > 0)
                            foreach (SPListItem item in myitems)
                                string a1 = Convert.ToString(item["empname"]);
                                string a2 = Convert.ToString(item["empdepartment"]);
                                TextBox2.Text = a1;           // displaying   properly                    
                                //DropDownList3.SelectedIndex = 1;                           
     It is showing the list item in textbox according to the item entered in the textbox1... But I am stuck to show in the dropdown list. 
    Suppose, if i enter X in textbox and click on search, then dropdownlist need to show D1,
                               for Y --> D2 and for Z-> D3... like that.
    What code do i need to write in the button_click to show this... 
    Please don't give any links...i just want code in continuation to my code.

    Hi,
    Since you have got the data you want with the help of SharePoint Object Model, then you can focus on how to populate values and set an option selected in the Drop Down List.
    With the retrieved data, you can populate them into the Drop Down List firstly, then set a specific option selected.
    Here is a link will show how to populate DropDownList control:
    http://www.dotnetfunda.com/articles/show/30/several-ways-to-populate-dropdownlist-controls
    Another link about select an item in DropDownList:
    http://techbrij.com/select-item-aspdotnet-dropdownlist-programmatically
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to retrieve list of iviews in a folder in pcd through webdynpro -- ASAP

    Hello,
    The requirement is to build an application in webdynpro which can retrieve the names of the iviews present in a specific folder.
    Can anyone help me out in this regard as to how to approach.
    Thanks
    *points are rewarded

    Hi,
    Here is the excellent document / blog written by one of my colleague. i hope with this you will solve you issues
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6112ecb7-0a01-0010-ef90-941c70c9e401
    oh... sorry.... but its not using Web dynpro.
    check this
    Retreive a list of workets, iViews, pages from Roles
    regards,
    Pradeep
    Edited by: pradeep bondla on Jul 15, 2008 6:52 AM

  • Parameter Form-How to use a user parameter to retrieve list of values for another par

    I am developing a report in Reports 6i. There are 2 parameters on parameter form namely year and month.
    LOV for Year is retrieved from database. After user selects a value from LOV for year, I want to retrieve another LOV for month parameter based on selected year. That is how can we use a user parameter's value to dynamically retrieve an LOV for another parameter on the same parameter form.
    Pl. guide.
    Thanks in anticipation.

    You can't restrict the "List of Values" of one parameter based on the value of another parameter within the Reports Builder/Runtime parameter form.
    The SQL select statements within LOV's are only executed once. They aren't re-calculated when you enter, leave or change other field values in the parameter form. This is mainly because there is no event model in the Reports parameter form and it only supports basic form functionality.
    To do what you're after in a client-server environment you need to create an Oracle Forms "parameter form" and use that to execute the Report using the run_product() call. Actually, you should probably use Oracle Forms for any more generic "form" functionality such as radio buttons or check boxes.
    If you're in a Web rather than Client-Server environment, it may be easier to create a JSP based parameter form. You can then use Reports 9i since it has JSP support to assist here.

  • MM - Retrieve List of G/L Account

    Dear experts,
    For PR creation, how to retrieve the list of G/L account and what it based on?
    Thank you.
    Regards,
    Weng
    Edited by: Weng on Feb 7, 2009 6:45 AM

    Hi Weng,
                 I have a page which explains dependency on Asset number for G/L default values.It has the structre representation.Hope it might be helpful to you.
    Link:
    [Asset|http://help.sap.com/saphelp_erp60_sp/helpdata/en/4f/71db80448011d189f00000e81ddfac/content.htm]
    Have a best day ahead.

  • List in thread..

    hi All,
    i'm new with thread. so i just starting with the simple program like:
    class thread1 implements Runnable{
         private String name;
         public thread1(String nameThread){
              name = new String(nameThread);
         public void run(){
              System.out.println(name+" was sleeping");
               System.out.println(name+" wake up");
    class thread{
         public static void main(String[] args){
              Thread student = new Thread(new thread1("student"));
              Thread kid = new Thread(new thread1("kid"));
              Thread sherlock  = new Thread(new thread1("sherlock"));
              student.start();
              kid.start();
              sherlock.start();
    }and output:
    student was sleeping
    kid was sleeping
    sherlock was sleeping
    student wake up
    kid wake up
    sherlock wake up
    after that, i'm trying to modify this code that create thread automatically depend on element in list but the i still want output was same. so, this my code.
    class thread1 implements Runnable{
         private String name[] = {"Student", "kid", "sherlock"} ;
         java.util.List threads = new java.util.ArrayList(Arrays.asList(name));
         public thread1(String name[]){
              this.name = name;
         public void run(){
              for(int i=0; i<2; i++){
              System.out.println(name[i]+" was sleeping");
               System.out.println(name[i]+" wake up");
    class thread{
         public static void main(String[] args){
              int T=100;
              String name[] = new String[T];
              Runnable r = new thread1(name);
              Thread t = new Thread(r);
              t.start();
    }but the output is:
    null was sleeping
    null wake up
    null was sleeping
    null wake up
    so, what the problem with my code. hope can anybody give any solution.
    thanks.

    problem is in your second program you have a private string array names name and that is initialized to a array or nont null strings. But the constructor accepts a string array argument and replace the name with the value of that argument. As a result initialising the name array with the declaration is pointless.
    And when you creating a thread1 instance you pass a 'new String[T]' to the constructor which will be assigned to the name array in the thread1 class. But that argument is an uninitialized array which has 100 null elements.

  • OSB: Retrieve list of proxy service/business service operations via OSB API

    Hi,
    I would like to retrieve the list of proxy service/business service operations using OSB API. I was able to retrieve References to all services on given server using examples from documentation (http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/javadoc/com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html). I'm also able to retrieve the Reference to any given service I want.
    My problem is - what do I do next? I've read here[http://www.theserverlabs.com/blog/2012/03/14/alsbosb-customization-using-wlst/] , that one can use ServiceConfigurationMBean.
    But when I execute this code:
              ServiceConfigurationMBean servConfMBean = (ServiceConfigurationMBean) domainService
              .findService(
                        ServiceConfigurationMBean.NAME + "." + sessionName,
                        ServiceConfigurationMBean.TYPE,null);
    The servConfMBean object is null.
    I know that there might be some useful info in the statistics, but my proxys are enabled for monitoring, and therefore I'm unable to obtain statistics programatically.
    I've also learned that thereis a TransportManagerHelper.getWsdlDescription(ref) method. But it throws null pointer exception. I dont understand how to use it.
    Any help would be greatly appreciated.
    Veronica
    Edited by: Veronica on Apr 11, 2012 2:33 AM

    There is an API change from the OSB release 11.1.1.3 and later....
    There is a solution, but this is based on Java & JMX:
    See support on this note:
    WLST scripting needed for note [ID 1431254.1]

  • Retrieving records using Thread

    I am a newbie in Java Servlet programming. I want to retrieve some records from my db2 database every 5 minutes and then display the result for viewing.
    I have no idea where should I put my html tags. Assuming that my program only have 2 methods which are the doPost method and runningThread method, should I put the tags within the doPost method or inside the running thread?
    Example or tutorial are good in term of understanding for a beginner.
    Thanks in advanced for any help.

    You don't need to use threads to do it. If it is just updated response that you need, you can achieve it by setting headers appropriately for autorefresh.
    In your doPost method , call
    response.setIntHeader("Refresh", 300) the browser re-requests the page after 300 seconds
    Then you can pull the new data and display.
    HTH

  • Retrieve list of approvers programmatically

    I've developed a repository service that dynamically resets the permissions of a document created in KM based on the creator of the document.  I'd also like to base the new permissions on who is listed as approvers in the approval workflow of the folder.  What code would I use to retrieve a list of all approvers of the KM folder the document's created in?
    Thanks in advance for any help!
    - Fallon

    Hi Fallon,
    I can't provide an actual code sample, but I have a direction.
    <b>IStatemanagementUtilsResource</b>:
    http://media.sdn.sap.com/html/submitted_docs/nw_kmc/javadoc/com/sapportals/wcm/repository/service/statemanagement/IStatemanagementUtilsResource.html
    <b>IStepList</b>:
    http://media.sdn.sap.com/html/submitted_docs/nw_kmc/javadoc/com/sapportals/wcm/repository/service/statemanagement/IStepList.html
    I didn't find how to get an actual instance of one of them, though.
    Perhaps decompiling the jar files mentioned in the top of those pages can offer some more insight.
    Hope that helps,
    Yoav.

  • Retrieve list of office365 users in Batches

    Hi, 
      I want to retrieve all the users list in batches through powershell. Suppose say that i have some around 1000 users on office365 but i want to get a list of users in batch of 100 for 10 batches. I use the get-msolUser to get all results.
    Note: As i checked the order of list is obtained is according to the ObjectId values in ascending order.Can i confirm with you that the order of the users will be based on ascending order of ObjectId???
    Thanks,
    Satya

    Satya,
    I think these cmdlets do the bulk of the work on the client side in RAM, when you are doing a "Get" cmdlet, there may be some small impact on the server side, but I believe most of the impact is on the client side.  
    It looks like Powershell 3.0 and above, has some optimization of the Select cmdlet (http://technet.microsoft.com/en-us/library/hh849895.aspx). 
    As a rule of thumb you should filter as much as possible before using a pipe or processing results from a cmdlet, to help keep the demand for resources at a minimum, when doing your scripts.  Generally speaking, if the cmdlet you are running has ways
    of filtering the results, use as many as you can.  In the case of Get-MsolUser, perhaps instead of  just using, 
    Get-MsolUser -MaxResults 100
    Maybe you want to use add
    Get-MsolUser -EnabledFilter EnabledOnly -MaxResults 100
    Along with some other filters possibly. That way when you get to the pipe and use select, sort, select, or foreach, your not doing all of your filtering as your processing results which can really eat up resource, depending on how many objects your cmdlet retrieved, and how many properties they have.

Maybe you are looking for