All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.ibizsys.model.engine.cloud.service.client.CloudClientBase Maven / Gradle / Ivy

The newest version!
package net.ibizsys.model.engine.cloud.service.client;

import net.ibizsys.model.engine.IPSModelEngine;
import net.ibizsys.model.engine.plugin.PSModelEngineAddinBase;
import net.ibizsys.model.engine.service.IPSSubSysServiceAPIEngine;
import net.ibizsys.model.engine.service.client.IWebClient;

public abstract class CloudClientBase> extends PSModelEngineAddinBase {

	private IWebClient iWebClient = null;
	
	@Override
	protected void onInit() throws Exception {
		if(this.getWebClient(true) == null) {
			if(this.getAddinData() instanceof IWebClient) {
				setWebClient((IWebClient)this.getAddinData());
			}
			else
				if(this.getPSModelEngine() instanceof IPSSubSysServiceAPIEngine) {
					setWebClient(((IPSSubSysServiceAPIEngine)this.getPSModelEngine()).getWebClient());
				}
			getWebClient(false);
		}
		
		super.onInit();
	}
	
	protected void setWebClient(IWebClient iWebClient) {
		this.iWebClient = iWebClient;
	}
	
	protected IWebClient getWebClient(boolean tryMode) throws Exception {
		if(this.iWebClient != null || tryMode) {
			return this.iWebClient;
		}
		throw new Exception("Cloud客户端对象无效");
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy