Skip to content

Commit 5688ea0

Browse files
author
mrzhang
committed
fix issue #12
#12
1 parent d6e6d27 commit 5688ea0

File tree

1 file changed

+8
-21
lines changed
  • componentlib/src/main/java/com/mrzhang/component/componentlib/router

1 file changed

+8
-21
lines changed

componentlib/src/main/java/com/mrzhang/component/componentlib/router/Router.java

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,6 @@ public synchronized void removeService(String serviceName) {
5454
services.remove(serviceName);
5555
}
5656

57-
// public static void registerComponent(String classname) {
58-
// try {
59-
// Class clazz = Class.forName(classname);
60-
// IApplicationLike applicationLike = (IApplicationLike) clazz.newInstance();
61-
// applicationLike.onCreate();
62-
// } catch (Exception e) {
63-
// e.printStackTrace();
64-
// }
65-
// }
66-
//
67-
// public static void unregisterComponent(String classname) {
68-
// try {
69-
// Class clazz = Class.forName(classname);
70-
// IApplicationLike applicationLike = (IApplicationLike) clazz.newInstance();
71-
// applicationLike.onStop();
72-
// } catch (Exception e) {
73-
// e.printStackTrace();
74-
// }
75-
// }
76-
77-
7857
/**
7958
* 注册组件
8059
*
@@ -111,6 +90,14 @@ public static void unregisterComponent(@Nullable String classname) {
11190
components.remove(classname);
11291
return;
11392
}
93+
try {
94+
Class clazz = Class.forName(classname);
95+
IApplicationLike applicationLike = (IApplicationLike) clazz.newInstance();
96+
applicationLike.onStop();
97+
components.remove(classname);
98+
} catch (Exception e) {
99+
e.printStackTrace();
100+
}
114101
}
115102

116103
}

0 commit comments

Comments
 (0)