File tree Expand file tree Collapse file tree 1 file changed +8
-21
lines changed
componentlib/src/main/java/com/mrzhang/component/componentlib/router Expand file tree Collapse file tree 1 file changed +8
-21
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments