diff --git a/src/main/java/com/loafle/overflow/container/general/server/GeneralContainerServer.java b/src/main/java/com/loafle/overflow/container/general/server/GeneralContainerServer.java index a16e4a9..8000e39 100644 --- a/src/main/java/com/loafle/overflow/container/general/server/GeneralContainerServer.java +++ b/src/main/java/com/loafle/overflow/container/general/server/GeneralContainerServer.java @@ -38,19 +38,19 @@ public class GeneralContainerServer extends ContainerServer { 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 protected void onStart() throws Exception { 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 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(); @@ -58,13 +58,13 @@ public class GeneralContainerServer extends ContainerServer { @Override 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(); } - private void execServices(Map, Object> services, String methodName, Class[] orderedTypes, boolean reverse) throws Exception { + private void execServices(Map, Object> services, com.loafle.overflow.core.interfaces.Service.ServiceMethodType methodType, Class[] orderedTypes, boolean reverse) throws Exception { if (null == services || 0 == services.size()) { return; } @@ -101,7 +101,7 @@ public class GeneralContainerServer extends ContainerServer { for (int i = 0; i < orderedServices.size(); i++) { Object service = orderedServices.get(i); Class clazz = service.getClass(); - Method method = clazz.getMethod(methodName, parameterTypes); + Method method = clazz.getMethod(methodType.toString(), parameterTypes); if (null == method) { continue; }