Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

34
LINES

< > BotCompany Repo | #1010505 // allMainClasses Web Bot

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (1608L/11K).

1  
!7
2  
3  
html {
4  
  if (webAuthed()) {
5  
    if (eq(uri, "/clean")) {
6  
      gc();
7  
      S answer = n(killThreadsOfExpiredMainClasses(), "thread") + " killed";
8  
      sleepSeconds(1);
9  
      gc();
10  
      ret answer;
11  
    }
12  
  }
13  
  L<Class> classes = allMainClasses();
14  
  new L<S> l;
15  
  for (Class c : classes) {
16  
    S s = className(c);
17  
    RuntimeException e = null;
18  
    //s += ", " + str(callOpt(c, 'getProgramID));
19  
    s += ", " + getOpt(c, 'programID);
20  
    pcall {
21  
      e = (RuntimeException) callOpt(c, 'asRuntimeException, new Exception);
22  
    }
23  
    if (e != null) s += ", " + firstFileNameFromStackTrace(e);
24  
    Bool lic = cast getOpt(c, 'licensed_yes);
25  
    if (eq(lic, true)) {} // licensed
26  
    else s += ", license: " + lic;
27  
    L<Thread> threads = registeredThreads(c);
28  
    if (nempty(threads))
29  
      s += ", threads: " + threadNames(threads);
30  
    l.add(s);
31  
  }
32  
  ret p("Have " + n(classes, "class") + ".")
33  
    + ul_htmlEncode(l);
34  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1010505
Snippet name: allMainClasses Web Bot
Eternal ID of this version: #1010505/16
Text MD5: 4a215b8a2009202e2d68775cd8fe5888
Transpilation MD5: 363d5070425419a634ed6610508fbbe9
Author: stefan
Category: javax / html
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-19 17:18:43
Source code size: 956 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 558 / 4667
Version history: 15 change(s)
Referenced in: [show references]