GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #64 from xxxllluuu/master · optimuse/uavstack@40968e5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • com.creditease.uav.agent.buildComponent/bin
    • stop.bat
    • stop.sh
  • com.creditease.uav.agent.heartbeat/src/main/java/com/creditease/agent/feature/nodeopagent/actions
    • MSCPGeneralAction.java
  • com.creditease.uav.base/src/main/java/com/creditease/agent
    • SystemStarter.java
    • workqueue
      • SystemActionEngineMgr.java
  • com.creditease.uav.monitorframework.buildFat/src/resource/java
    • struts-action.xml
    • struts-action2.xml
    • struts.xml
  • com.creditease.uav.monitorframework/src/main/java/com/creditease/uav/profiling/handlers
    • ComponentProfileHandler.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎com.creditease.uav.agent.buildComponent/bin/stop.bat‎

Copy file name to clipboardExpand all lines: com.creditease.uav.agent.buildComponent/bin/stop.bat
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ cd ..
66
setlocal enabledelayedexpansion
77
set CLASSPATH=
88
for %%I in (dir lib/*.jar) do set CLASSPATH=lib/%%I;!CLASSPATH!
9-
java -classpath "%CLASSPATH%" com.creditease.agent.feature.nodeopagent.NodeOperCtrlClient %profile% kill
9+
java -classpath "%CLASSPATH%" com.creditease.agent.feature.nodeopagent.NodeOperCtrlClient %profile% shutdown
Collapse file

‎com.creditease.uav.agent.buildComponent/bin/stop.sh‎

Copy file name to clipboardExpand all lines: com.creditease.uav.agent.buildComponent/bin/stop.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ do CLASSPATH=$i:"$CLASSPATH";
3636
done
3737
export CLASSPATH=.:$CLASSPATH
3838
echo $CLASSPATH
39-
$executeJava -classpath $CLASSPATH com.creditease.agent.feature.nodeopagent.NodeOperCtrlClient $1 kill
39+
$executeJava -classpath $CLASSPATH com.creditease.agent.feature.nodeopagent.NodeOperCtrlClient $1 shutdown
Collapse file

‎com.creditease.uav.agent.heartbeat/src/main/java/com/creditease/agent/feature/nodeopagent/actions/MSCPGeneralAction.java‎

Copy file name to clipboardExpand all lines: com.creditease.uav.agent.heartbeat/src/main/java/com/creditease/agent/feature/nodeopagent/actions/MSCPGeneralAction.java
+3-33Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
import java.nio.file.Paths;
2424
import java.util.Map;
25-
import java.util.concurrent.locks.Lock;
26-
import java.util.concurrent.locks.ReentrantLock;
2725

2826
import com.creditease.agent.SystemStarter;
2927
import com.creditease.agent.helpers.JSONHelper;
@@ -449,40 +447,12 @@ public void run() {
449447
*/
450448
private void shutdown() {
451449

452-
final SystemStarter ss = this.getSystemStarter();
453-
454-
final Lock lock = new ReentrantLock();
455-
456-
Thread thd = new Thread(new Runnable() {
457-
458-
@Override
459-
public void run() {
460-
461-
try {
462-
lock.lockInterruptibly();
463-
}
464-
catch (InterruptedException e) {
465-
// ignore
466-
}
467-
468-
try {
469-
ss.stop();
470-
}
471-
catch (Exception e) {
472-
// ignore
473-
}
474-
finally {
475-
lock.unlock();
476-
}
477-
}
478-
});
479-
480-
thd.start();
450+
SystemStarter ss = this.getSystemStarter();
481451

482452
try {
483-
lock.wait(10000);
453+
ss.stop();
484454
}
485-
catch (InterruptedException e) {
455+
catch (Exception e) {
486456
// ignore
487457
}
488458

Collapse file

‎com.creditease.uav.base/src/main/java/com/creditease/agent/SystemStarter.java‎

Copy file name to clipboardExpand all lines: com.creditease.uav.base/src/main/java/com/creditease/agent/SystemStarter.java
+30-30Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -69,36 +69,6 @@ public static void main(String[] args) {
6969

7070
public void stop() {
7171

72-
if (sysInvokerMgr != null) {
73-
sysInvokerMgr.shutdown();
74-
this.configMgr.unregisterComponent("Global", "ISystemInvokerMgr");
75-
log.info(this, "System Invoker Manager shutdown");
76-
}
77-
78-
if (sysForkjoinWorkerMgr != null) {
79-
sysForkjoinWorkerMgr.shutdown();
80-
this.configMgr.unregisterComponent("Global", "I1NQueueWorkerMgr");
81-
log.info(this, "System ForkjoinWorker Manager shutdown");
82-
}
83-
84-
if (sys1nQueueWorkerMgr != null) {
85-
sys1nQueueWorkerMgr.shutdown();
86-
this.configMgr.unregisterComponent("Global", "I1NQueueWorkerMgr");
87-
log.info(this, "System 1+N QueueWorker Manager shutdown");
88-
}
89-
90-
if (sysActionEngineMgr != null) {
91-
sysActionEngineMgr.shutdown();
92-
this.configMgr.unregisterComponent("Global", "ISystemActionEngineMgr");
93-
log.info(this, "System ActionEngine Manager shutdown");
94-
}
95-
96-
if (timerWorkManager != null) {
97-
timerWorkManager.shutdown();
98-
this.configMgr.unregisterComponent("Global", "ITimerWorkManager");
99-
log.info(this, "System Timer Manager shutdown");
100-
}
101-
10272
Set<Object> components = this.configMgr.getComponents();
10373

10474
for (Object component : components) {
@@ -133,6 +103,36 @@ else if (AgentResourceComponent.class.isAssignableFrom(component.getClass())) {
133103
}
134104
}
135105

106+
if (sysInvokerMgr != null) {
107+
sysInvokerMgr.shutdown();
108+
this.configMgr.unregisterComponent("Global", "ISystemInvokerMgr");
109+
log.info(this, "System Invoker Manager shutdown");
110+
}
111+
112+
if (sysForkjoinWorkerMgr != null) {
113+
sysForkjoinWorkerMgr.shutdown();
114+
this.configMgr.unregisterComponent("Global", "I1NQueueWorkerMgr");
115+
log.info(this, "System ForkjoinWorker Manager shutdown");
116+
}
117+
118+
if (sys1nQueueWorkerMgr != null) {
119+
sys1nQueueWorkerMgr.shutdown();
120+
this.configMgr.unregisterComponent("Global", "I1NQueueWorkerMgr");
121+
log.info(this, "System 1+N QueueWorker Manager shutdown");
122+
}
123+
124+
if (sysActionEngineMgr != null) {
125+
sysActionEngineMgr.shutdown();
126+
this.configMgr.unregisterComponent("Global", "ISystemActionEngineMgr");
127+
log.info(this, "System ActionEngine Manager shutdown");
128+
}
129+
130+
if (timerWorkManager != null) {
131+
timerWorkManager.shutdown();
132+
this.configMgr.unregisterComponent("Global", "ITimerWorkManager");
133+
log.info(this, "System Timer Manager shutdown");
134+
}
135+
136136
log.info(this, "CreditEase Agent Server stopped");
137137
}
138138

Collapse file

‎com.creditease.uav.base/src/main/java/com/creditease/agent/workqueue/SystemActionEngineMgr.java‎

Copy file name to clipboardExpand all lines: com.creditease.uav.base/src/main/java/com/creditease/agent/workqueue/SystemActionEngineMgr.java
+21-8Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,34 @@ public IActionEngine getActionEngine(String actionEngineID) {
5656
@Override
5757
public void shutdown(String actionEngineID) {
5858

59-
if (aeMap.containsKey(actionEngineID)) {
60-
IActionEngine ae = aeMap.remove(actionEngineID);
61-
ae.stop();
62-
ae.clean();
63-
// unregister actionEngine
64-
ConfigurationManager.getInstance().unregisterComponent(((ActionEngine) ae).getFeature(), actionEngineID);
65-
}
59+
shutdown(actionEngineID, true);
6660
}
6761

6862
@Override
6963
public void shutdown() {
7064

7165
Set<String> keys = aeMap.keySet();
7266
for (String actionEngineID : keys) {
73-
shutdown(actionEngineID);
67+
shutdown(actionEngineID,false);
68+
}
69+
}
70+
71+
private void shutdown(String actionEngineID, boolean removeAE) {
72+
73+
if (aeMap.containsKey(actionEngineID)) {
74+
75+
IActionEngine ae;
76+
77+
if (removeAE) {
78+
ae = aeMap.remove(actionEngineID);
79+
}
80+
else {
81+
ae = aeMap.get(actionEngineID);
82+
}
83+
84+
ae.clean();
85+
// unregister actionEngine
86+
ConfigurationManager.getInstance().unregisterComponent(((ActionEngine) ae).getFeature(), actionEngineID);
7487
}
7588
}
7689

Collapse file

‎com.creditease.uav.monitorframework.buildFat/src/resource/java/struts-action.xml‎

Copy file name to clipboard
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!DOCTYPE struts PUBLIC
3+
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
4+
"http://struts.apache.org/dtds/struts-2.3.dtd">
5+
6+
<struts>
7+
8+
<package name="test" namespace="/test" extends="buildFat_default">
9+
<action name="hello" method="anno1" class="com.creditease.monitorframework.fat.struts.TestStruts2ActionAnno" />
10+
<action name="hello2" method="hello2" class="com.creditease.monitorframework.fat.struts.TestStruts2Action" />
11+
</package>
12+
13+
</struts>
Collapse file

‎com.creditease.uav.monitorframework.buildFat/src/resource/java/struts-action2.xml‎

Copy file name to clipboard
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!DOCTYPE struts PUBLIC
3+
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
4+
"http://struts.apache.org/dtds/struts-2.3.dtd">
5+
6+
<struts>
7+
8+
<package name="test2" namespace="/test2" extends="buildFat_default">
9+
<action name="hello3" method="hello3" class="com.creditease.monitorframework.fat.struts.TestStruts2Action"></action>
10+
<action name="hello4" method="hello4" class="com.creditease.monitorframework.fat.struts.TestStruts2Action"></action>
11+
12+
</package>
13+
14+
</struts>
Collapse file

‎com.creditease.uav.monitorframework.buildFat/src/resource/java/struts.xml‎

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!DOCTYPE struts PUBLIC
3+
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
4+
"http://struts.apache.org/dtds/struts-2.3.dtd">
5+
6+
<struts>
7+
<constant name="struts.devMode" value="true" />
8+
<constant name="struts.action.extension" value="action,do" />
9+
<package name="buildFat_default" abstract="true" extends="json-default" />
10+
<include file="struts-action.xml" />
11+
<include file="struts-action2.xml" />
12+
</struts>
Collapse file

‎com.creditease.uav.monitorframework/src/main/java/com/creditease/uav/profiling/handlers/ComponentProfileHandler.java‎

Copy file name to clipboardExpand all lines: com.creditease.uav.monitorframework/src/main/java/com/creditease/uav/profiling/handlers/ComponentProfileHandler.java
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020

2121
package com.creditease.uav.profiling.handlers;
2222

23+
import java.io.ByteArrayInputStream;
2324
import java.io.File;
2425
import java.io.FileInputStream;
2526
import java.io.FileNotFoundException;
2627
import java.io.IOException;
28+
import java.io.UnsupportedEncodingException;
2729
import java.lang.reflect.Method;
2830
import java.net.UnknownHostException;
2931
import java.util.ArrayList;
@@ -52,6 +54,8 @@
5254
import org.w3c.dom.NamedNodeMap;
5355
import org.w3c.dom.Node;
5456
import org.w3c.dom.NodeList;
57+
import org.xml.sax.EntityResolver;
58+
import org.xml.sax.InputSource;
5559
import org.xml.sax.SAXException;
5660

5761
import com.creditease.agent.helpers.JSONHelper;
@@ -211,6 +215,22 @@ public static List<String> getMethodParamInfo(Method m) {
211215
*/
212216
public static abstract class DescriptorProcessor extends BaseComponent {
213217

218+
public class NoOpEntityResolver implements EntityResolver {
219+
220+
@Override
221+
public InputSource resolveEntity(String publicId, String systemId) {
222+
223+
InputSource is = null;
224+
try {
225+
is = new InputSource(new ByteArrayInputStream(new String().getBytes("utf-8")));
226+
}
227+
catch (UnsupportedEncodingException e) {
228+
// ignore
229+
}
230+
return is;
231+
}
232+
}
233+
214234
public interface XMLParseHandler {
215235

216236
/**
@@ -268,6 +288,8 @@ public DocumentBuilder getDocumentBuilder() {
268288

269289
try {
270290
db = dbf.newDocumentBuilder();
291+
// keep the DTD from loading
292+
db.setEntityResolver(new NoOpEntityResolver());
271293
}
272294
catch (ParserConfigurationException e) {
273295
this.logger.error(

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.