From 93f7335e1a52591662d5d37f41ac352860b2ca2a Mon Sep 17 00:00:00 2001 From: yuxc <yuxc@vci-tech.com> Date: 星期二, 04 六月 2024 18:39:50 +0800 Subject: [PATCH] 1、对象引用改动。 --- Source/platformProject/vci-platform-web/src/main/java/com/vci/web/util/PlatformClientUtil.java | 119 +++++++++++++++++++++++++---------------------------------- 1 files changed, 50 insertions(+), 69 deletions(-) diff --git a/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/util/PlatformClientUtil.java b/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/util/PlatformClientUtil.java index fff6644..7efe896 100644 --- a/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/util/PlatformClientUtil.java +++ b/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/util/PlatformClientUtil.java @@ -1,34 +1,20 @@ package com.vci.web.util; -import com.vci.corba.logon.method.LogonFactory; -import com.vci.corba.logon.method.LogonFactoryHelper; -import com.vci.corba.volumn.method.VolumnFactory; -import com.vci.corba.volumn.method.VolumnFactoryHelper; -import com.vci.starter.corba.connector.JacorbClientConnector; -import com.vci.starter.web.exception.VciBaseException; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; +import com.vci.client.common.providers.ServiceProvider; +import com.vci.corba.bofactory.BOFactoryServicePrx; +import com.vci.corba.common.PLException; +import com.vci.corba.omd.atm.AttPoolServicePrx; +import com.vci.corba.omd.btm.BTMServicePrx; +import com.vci.corba.omd.etm.EnumServicePrx; +import com.vci.corba.omd.lcm.LifeCycleServicePrx; +import com.vci.corba.omd.ltm.LinkTypeServicePrx; +import com.vci.corba.omd.stm.StatePoolServicePrx; +import com.vci.corba.omd.vrm.VersionRuleServicePrx; +import com.vci.corba.portal.PortalServicePrx; +import com.vci.corba.query.ObjectQueryServicePrx; +import com.vci.corba.volume.VolumeServicePrx; +import com.vci.corba.workflow.WorkflowServicePrx; import org.springframework.stereotype.Component; -import plm.bs.bom.common.BOFactoryService; -import plm.bs.bom.common.BOFactoryServiceHelper; -import plm.corba.attribpool.AttPoolServiceHelper; -import plm.corba.attribpool.AttPoolServiceOperations; -import plm.corba.btm.BTMServiceHelper; -import plm.corba.btm.BTMServiceOperations; -import plm.corba.enumManager.EnumServiceHelper; -import plm.corba.enumManager.EnumServiceOperations; -import plm.corba.lifecycle.LifeCyleServiceHelper; -import plm.corba.lifecycle.LifeCyleServiceOperations; -import plm.corba.linkTypeManager.LinkTypeServiceHelper; -import plm.corba.linkTypeManager.LinkTypeServiceOperations; -import plm.corba.portal.PortalServiceHelper; -import plm.corba.portal.PortalServiceOperations; -import plm.corba.qt.QTServiceHelper; -import plm.corba.qt.QTServiceOperations; -import plm.corba.statePoolManager.StatePoolServiceHelper; -import plm.corba.statePoolManager.StatePoolServiceOperations; -import plm.corba.versionRuleManager.VersionRuleServiceHelper; -import plm.corba.versionRuleManager.VersionRuleServiceOperations; /** * 骞冲彴鐨勫鎴风璋冪敤宸ュ叿绫� @@ -91,115 +77,110 @@ */ private static final String QUERY_SERVICE_NAME = "qtService"; - /** - * corba鐨勫鎴风璋冪敤 - */ - @Autowired - private JacorbClientConnector jacorbClientConnector; /** * 鑾峰彇涓氬姟绫诲瀷宸ュ巶鐨勬湇鍔� * @return 鏈嶅姟鐨勫璞� */ - public BOFactoryService getBOFactoryService(){ - return BOFactoryServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(BO_FACTORY_SERVICE_NAME)); - } + public BOFactoryServicePrx getBOFactoryService(){ + return ServiceProvider.getBOFService(); + } /** * 鑾峰彇鐧诲綍涓绘湇鍔� * @return 鏈嶅姟鐨勫璞� */ - public LogonFactory getLogonFactoryService(){ - return LogonFactoryHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(LOGON_FACTORY_SERVICE_NAME)); - } + public WorkflowServicePrx getLogonFactoryService(){ + return ServiceProvider.getWFService(); + } /** * 鑾峰彇鐘舵�佹睜鐨勬湇鍔� * @return 鏈嶅姟鐨勫璞� */ - public StatePoolServiceOperations getStatePoolService(){ - return StatePoolServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(STATE_POOL_SERVICE_NAME)); - } + public StatePoolServicePrx getStatePoolService() throws PLException { + return ServiceProvider.getOMDService().getStateService(); + } /** * 鑾峰彇鐢熷懡鍛ㄦ湡鐨勬湇鍔� * @return 鐢熷懡鍛ㄦ湡鐨勬湇鍔″璞� */ - public LifeCyleServiceOperations getLifeCycleService(){ - return LifeCyleServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(LIFE_CYCLE_SERVICE_NAME)); - } + public LifeCycleServicePrx getLifeCycleService() throws PLException { + return ServiceProvider.getOMDService().getLifeCycleService(); +} /** * 鑾峰彇鏋氫妇鐨勬湇鍔� * @return 鏋氫妇鐨勬湇鍔″璞� */ - public EnumServiceOperations getEnumService(){ - return EnumServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(ENUM_SERVICE_NAME)); + public EnumServicePrx getEnumService() throws PLException { + return ServiceProvider.getOMDService().getEnumService(); +// return EnumServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(ENUM_SERVICE_NAME)); } /** * 鑾峰彇鐗堟湰瑙勫垯鐨勬湇鍔� * @return 鐗堟湰瑙勫垯鐨勬湇鍔� */ - public VersionRuleServiceOperations getVersionService(){ - return VersionRuleServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(VERSION_SERVICE_NAME)); + public VersionRuleServicePrx getVersionService() throws PLException { + return ServiceProvider.getOMDService().getVerRuleService(); +// return VersionRuleServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(VERSION_SERVICE_NAME)); } /** * 灞炴�ф湇鍔� * @return 鏈嶅姟鐨勫璞� */ - public AttPoolServiceOperations getAttributeService(){ - return AttPoolServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(ATTRIBUTE_SERVICE_NAME)); + public AttPoolServicePrx getAttributeService() throws PLException { + return ServiceProvider.getOMDService().getAttributeService(); +// return AttPoolServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(ATTRIBUTE_SERVICE_NAME)); } /** * 鑾峰彇涓氬姟绫诲瀷 * @return 鏈嶅姟鐨勫璞� */ - public BTMServiceOperations getBtmService(){ - return BTMServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(BTM_SERVICE_NAME)); + public BTMServicePrx getBtmService() throws PLException { + return ServiceProvider.getOMDService().getBTMService(); +// return BTMServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(BTM_SERVICE_NAME)); } /** * 鑾峰彇閾炬帴绫诲瀷 * @return 鏈嶅姟鐨勫璞� */ - public LinkTypeServiceOperations getLinkTypeService(){ - return LinkTypeServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(LINK_SERVICE_NAME)); + public LinkTypeServicePrx getLinkTypeService() throws PLException { + return ServiceProvider.getOMDService().getLinkTypeService(); +// return LinkTypeServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(LINK_SERVICE_NAME)); } /** * 鑾峰彇UI涓婁笅鏂囨湇鍔� * @return 鏈嶅姟鐨勫璞� */ - public PortalServiceOperations getPortalService(){ - return PortalServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(PORTAL_SERVICE_NAME)); + public PortalServicePrx getPortalService(){ + return ServiceProvider.getUIService(); +// return PortalServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(PORTAL_SERVICE_NAME)); } /** * 鑾峰彇鏌ヨ鏈嶅姟 * @return 鏈嶅姟鐨勫璞� */ - public QTServiceOperations getQueryService(){ - return QTServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(QUERY_SERVICE_NAME)); + public ObjectQueryServicePrx getQueryService(){ + return ServiceProvider.getOQService(); +// return QTServiceHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByServiceName(QUERY_SERVICE_NAME)); } /** * 鍗锋湇鍔� - * @param serverUrl 鍛藉悕鏈嶅姟 * @param volumeName 鍗风殑鍚嶇О * @return 鍗锋湇鍔$殑鐨勫璞� */ - public VolumnFactory getVolumeService(String serverUrl,String volumeName){ - if(StringUtils.isNotBlank(serverUrl)){ - if(StringUtils.countMatches(serverUrl,":") < 2){ - throw new VciBaseException("鍗锋湇鍔$殑閰嶇疆閿欒锛岄渶瑕佷富鏈哄悕:绔彛:鏈嶅姟鍓嶇紑杩欑褰㈠紡"); - } - String[] split = serverUrl.split(":"); - serverUrl = "corbaloc::" + split[0] + ":" +split[1] + "/NameService:" +split[2]; - } - return VolumnFactoryHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByUrlAndServiceName(serverUrl,volumeName)); + public VolumeServicePrx getVolumeService(String volumeName){ + return ServiceProvider.getVolumeService(volumeName); +// return VolumnFactoryHelper.narrow(jacorbClientConnector.getCorbaServiceObjectByUrlAndServiceName(serverUrl,volumeName)); } } -- Gitblit v1.9.3