From 986aa62ed00bee39363bab41b4eeb8259d446efd Mon Sep 17 00:00:00 2001 From: ludc <ludc@vci-tech.com> Date: 星期四, 16 一月 2025 18:20:32 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/Service/ServiceBase/src/com/vci/server/base/utility/ServerServiceProvider.java | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 42 insertions(+), 2 deletions(-) diff --git a/Source/Service/ServiceBase/src/com/vci/server/base/utility/ServerServiceProvider.java b/Source/Service/ServiceBase/src/com/vci/server/base/utility/ServerServiceProvider.java index 21ac8dc..5af0ce8 100644 --- a/Source/Service/ServiceBase/src/com/vci/server/base/utility/ServerServiceProvider.java +++ b/Source/Service/ServiceBase/src/com/vci/server/base/utility/ServerServiceProvider.java @@ -7,12 +7,13 @@ import com.vci.common.resource.IceClientProperties; import com.vci.corba.common.VCIError; import com.vci.corba.bofactory.BOFactoryServicePrx; -import com.vci.corba.framework.method.FrameworkServicePrx; +import com.vci.corba.framework.FrameworkServicePrx; +import com.vci.corba.log.LogServicePrx; import com.vci.corba.omd.OMDServicePrx; import com.vci.corba.portal.PortalServicePrx; import com.vci.corba.query.ObjectQueryServicePrx; import com.vci.corba.volume.VolumeServicePrx; -import com.vci.corba.workflow.method.WorkflowServicePrx; +import com.vci.corba.workflow.WorkflowServicePrx; import com.zeroc.Ice.Communicator; import com.zeroc.Ice.Current; import com.zeroc.Ice.ObjectPrx; @@ -65,6 +66,45 @@ } /** + * 鑾峰彇绯荤粺璇ユ鏋舵湇鍔′唬鐞� + * @return + */ + public static LogServicePrx getLogService(Current current) { + try { + ObjectPrx prx = getObjectByName(current.adapter.getCommunicator(), ServiceNames.LOGSERVICE); + + LogServicePrx prxTemp = LogServicePrx.uncheckedCast(prx); + return prxTemp.ice_context(current.ctx); + } catch (Exception e) { + //e.printStackTrace(); + ServerWithLog4j.logger.error(e); + } + + return null; + } + + /** + * 鑾峰彇绯荤粺璇ユ鏋舵湇鍔′唬鐞� + * @return + * @throws Exception + */ + public static LogServicePrx getLogService() throws VCIError { + try { + Current current = threadLocal.get(); + if (current == null) + throw new VCIError("ServerServiceProvider-0001", new String[] {"鑾峰彇褰撳墠涓婁笅鏂囧け璐ワ紒"}); + + ObjectPrx prx = getObjectByName(current.adapter.getCommunicator(), ServiceNames.LOGSERVICE); + + LogServicePrx prxTemp = LogServicePrx.uncheckedCast(prx); + return prxTemp.ice_context(current.ctx); + } catch (VCIError e) { + //e.printStackTrace(); + ServerWithLog4j.logger.error(e); + throw e; + } + } + /** * 鑾峰彇绯荤粺鎺堟潈璁よ瘉妗嗘灦鏈嶅姟浠g悊 * @return */ -- Gitblit v1.9.3