ing
This commit is contained in:
parent
5bee7bf4ea
commit
3c4df318af
|
@ -38,19 +38,19 @@ public class GeneralContainerServer extends ContainerServer {
|
||||||
this.services.put(bean.getClass(), bean);
|
this.services.put(bean.getClass(), bean);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.execServices(this.services, "initService", Service.OrderedServices, false);
|
this.execServices(this.services, com.loafle.overflow.core.interfaces.Service.ServiceMethodType.INIT, Service.OrderedServices, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStart() throws Exception {
|
protected void onStart() throws Exception {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
|
||||||
this.execServices(this.services, "startService", Service.OrderedServices, false);
|
this.execServices(this.services, com.loafle.overflow.core.interfaces.Service.ServiceMethodType.START, Service.OrderedServices, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() throws Exception {
|
protected void onStop() throws Exception {
|
||||||
this.execServices(this.services, "stopService", Service.OrderedServices, true);
|
this.execServices(this.services, com.loafle.overflow.core.interfaces.Service.ServiceMethodType.STOP, Service.OrderedServices, true);
|
||||||
|
|
||||||
|
|
||||||
super.onStop();
|
super.onStop();
|
||||||
|
@ -58,13 +58,13 @@ public class GeneralContainerServer extends ContainerServer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void destroy() throws Exception {
|
protected void destroy() throws Exception {
|
||||||
this.execServices(this.services, "destroyService", Service.OrderedServices, true);
|
this.execServices(this.services, com.loafle.overflow.core.interfaces.Service.ServiceMethodType.DESTROY, Service.OrderedServices, true);
|
||||||
|
|
||||||
|
|
||||||
super.destroy();
|
super.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void execServices(Map<Class<?>, Object> services, String methodName, Class<?>[] orderedTypes, boolean reverse) throws Exception {
|
private void execServices(Map<Class<?>, Object> services, com.loafle.overflow.core.interfaces.Service.ServiceMethodType methodType, Class<?>[] orderedTypes, boolean reverse) throws Exception {
|
||||||
if (null == services || 0 == services.size()) {
|
if (null == services || 0 == services.size()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ public class GeneralContainerServer extends ContainerServer {
|
||||||
for (int i = 0; i < orderedServices.size(); i++) {
|
for (int i = 0; i < orderedServices.size(); i++) {
|
||||||
Object service = orderedServices.get(i);
|
Object service = orderedServices.get(i);
|
||||||
Class<?> clazz = service.getClass();
|
Class<?> clazz = service.getClass();
|
||||||
Method method = clazz.getMethod(methodName, parameterTypes);
|
Method method = clazz.getMethod(methodType.toString(), parameterTypes);
|
||||||
if (null == method) {
|
if (null == method) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user