parent
ace820480a
commit
efe7ec389b
@ -0,0 +1,49 @@ |
|||||||
|
package com.bellmann.runner; |
||||||
|
|
||||||
|
|
||||||
|
import com.zznode.cap.api.CAP; |
||||||
|
import com.zznode.cap.api.ServiceManager; |
||||||
|
import com.zznode.itms.api.ACSManager; |
||||||
|
import com.zznode.itms.api.InventoryManager; |
||||||
|
import com.zznode.itms.api.NBIManager; |
||||||
|
import com.zznode.itms.api.OAMManager; |
||||||
|
import lombok.Getter; |
||||||
|
|
||||||
|
|
||||||
|
public class InterfaceService extends ServiceManager { |
||||||
|
static InterfaceService service = null; |
||||||
|
|
||||||
|
//任务超时的时间
|
||||||
|
@Getter |
||||||
|
private static String task_timeOut; |
||||||
|
|
||||||
|
public InterfaceService(String[] args) { |
||||||
|
super(args); |
||||||
|
} |
||||||
|
@Override |
||||||
|
public boolean init() { |
||||||
|
CAP.trDebug("Start init service INTERFACE"); |
||||||
|
if (!super.init()) { |
||||||
|
CAP.trError("Failed to init QUERYService."); |
||||||
|
return false; |
||||||
|
} |
||||||
|
service = this; |
||||||
|
task_timeOut = getStringValueByName("TaskTimeOut"); |
||||||
|
ACSManager.init(getStringValueByName("Service.Name.ACSManager")); |
||||||
|
NBIManager.init(getStringValueByName("Service.Name.NBI")); |
||||||
|
InventoryManager.init(getStringValueByName("Service.Name.Inventory")); |
||||||
|
OAMManager.init(getStringValueByName("Service.Name.OAM")); |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public synchronized static InterfaceService getInstance(){ |
||||||
|
if(service != null){ |
||||||
|
return service; |
||||||
|
} |
||||||
|
String[] arg = new String[] { "-ServerName", "INTERFACE" }; |
||||||
|
service = new InterfaceService(arg); |
||||||
|
return service; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,24 @@ |
|||||||
|
package com.bellmann.runner; |
||||||
|
|
||||||
|
import lombok.extern.log4j.Log4j2; |
||||||
|
import org.springframework.boot.ApplicationArguments; |
||||||
|
import org.springframework.boot.ApplicationRunner; |
||||||
|
import org.springframework.core.annotation.Order; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
@Component |
||||||
|
@Order(value = 1) |
||||||
|
@Log4j2 |
||||||
|
public class ServiceManagerRunner implements ApplicationRunner { |
||||||
|
|
||||||
|
@Override |
||||||
|
public void run(ApplicationArguments args) { |
||||||
|
new Thread("ServiceManager") { |
||||||
|
@Override |
||||||
|
public void run() { |
||||||
|
InterfaceService.getInstance().start(); |
||||||
|
} |
||||||
|
}.start(); |
||||||
|
log.info("ServiceManager started"); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue