static LogPrx getLoggerPrxHelper() { if (communicator == null) { return null; } return communicator.stringToProxy(LogPrx.class, objName); }
static LogPrx getLoggerPrxHelper() { if (communicator == null) { return null; } return communicator.stringToProxy(LogPrx.class, objName); }
static LogPrx getLoggerPrxHelper() { if (communicator == null) { return null; } return communicator.stringToProxy(LogPrx.class, objName); }
public <T> T stringToProxy(Class<T> clazz, String objName) throws CommunicatorConfigException { return stringToProxy(clazz, objName, null, null, null, null); }
@Deprecated public <T> T stringToProxy(Class<T> clazz, ServantProxyConfig servantProxyConfig, LoadBalance<T> loadBalance) throws CommunicatorConfigException { return stringToProxy(clazz, servantProxyConfig.getObjectName(), servantProxyConfig.getSetDivision(), servantProxyConfig, loadBalance, null); }
@Deprecated public <T> T stringToProxy(Class<T> clazz, ServantProxyConfig servantProxyConfig, LoadBalance<T> loadBalance) throws CommunicatorConfigException { return stringToProxy(clazz, servantProxyConfig.getObjectName(), servantProxyConfig.getSetDivision(), servantProxyConfig, loadBalance, null); }
private QueryFPrx getPrx() { QueryFPrx prx = communicator.stringToProxy(QueryFPrx.class, communicator.getCommunicatorConfig().getLocator()); return prx; }
private void processFields(Object bean, Field[] declaredFields) { for (Field field : declaredFields) { TarsClient annotation = AnnotationUtils.getAnnotation(field, TarsClient.class); if (annotation == null) { continue; } Object proxy = communicator.stringToProxy(field.getType(), annotation.name()); ReflectionUtils.makeAccessible(field); ReflectionUtils.setField(field, bean, proxy); } }
private QueryFPrx getPrx() { QueryFPrx prx = communicator.stringToProxy(QueryFPrx.class, communicator.getCommunicatorConfig().getLocator()); return prx; }
private QueryFPrx getPrx() { QueryFPrx prx = communicator.stringToProxy(QueryFPrx.class, communicator.getCommunicatorConfig().getLocator()); return prx; }
public <T> T stringToProxy(Class<T> clazz, ServantProxyConfig servantProxyConfig) throws CommunicatorConfigException { return stringToProxy(clazz, servantProxyConfig.getObjectName(), servantProxyConfig.getSetDivision(), servantProxyConfig, null, null); }
private void report(String result, boolean sync) { try { if (communicator == null) { return; } NotifyPrx notifyPrx = communicator.stringToProxy(NotifyPrx.class, ConfigurationManager.getInstance().getServerConfig().getNotify()); if (sync) notifyPrx.reportServer(app + "." + server, Thread.currentThread().getId() + "", result); else notifyPrx.async_reportServer(null, app + "." + server, Thread.currentThread().getId() + "", result); } catch (Exception e) { OmLogger.record("RemoteNotify|report error", e); } }
private void report(String result, boolean sync) { try { if (communicator == null) { return; } NotifyPrx notifyPrx = communicator.stringToProxy(NotifyPrx.class, ConfigurationManager.getInstance().getServerConfig().getNotify()); if (sync) notifyPrx.reportServer(app + "." + server, Thread.currentThread().getId() + "", result); else notifyPrx.async_reportServer(null, app + "." + server, Thread.currentThread().getId() + "", result); } catch (Exception e) { OmLogger.record("RemoteNotify|report error", e); } }
private StatFPrx getPrx() { StatFPrx prx = null; String stat = communicator.getCommunicatorConfig().getStat(); if (!StringUtils.isEmpty(stat)) { prx = communicator.stringToProxy(StatFPrx.class, communicator.getCommunicatorConfig().getStat()); } return prx; }
private StatFPrx getPrx() { StatFPrx prx = null; String stat = communicator.getCommunicatorConfig().getStat(); if (!StringUtils.isEmpty(stat)) { prx = communicator.stringToProxy(StatFPrx.class, communicator.getCommunicatorConfig().getStat()); } return prx; }
private StatFPrx getPrx() { StatFPrx prx = null; String stat = communicator.getCommunicatorConfig().getStat(); if (!StringUtils.isEmpty(stat)) { prx = communicator.stringToProxy(StatFPrx.class, communicator.getCommunicatorConfig().getStat()); } return prx; }
private void notify(NOTIFYLEVEL level, String message) { try { if (communicator == null) { return; } NotifyPrx notifyPrx = communicator.stringToProxy(NotifyPrx.class, ConfigurationManager.getInstance().getServerConfig().getNotify()); notifyPrx.async_notifyServer(null, app + "." + server, level.value(), message); } catch (Exception e) { OmLogger.record("RemoteNotify|notify error", e); } }
private void notify(NOTIFYLEVEL level, String message) { try { if (communicator == null) { return; } NotifyPrx notifyPrx = communicator.stringToProxy(NotifyPrx.class, ConfigurationManager.getInstance().getServerConfig().getNotify()); notifyPrx.async_notifyServer(null, app + "." + server, level.value(), message); } catch (Exception e) { OmLogger.record("RemoteNotify|notify error", e); } }
private String getRemoteFile(String fileName, boolean appConfigOnly) { Holder<String> config = new Holder<String>(); ConfigPrx configPrx = comm.stringToProxy(ConfigPrx.class, ConfigurationManager.getInstance().getServerConfig().getConfig()); ConfigInfo configInfo = new ConfigInfo(app, appConfigOnly ? "" : serverName, fileName, appConfigOnly, ConfigurationManager.getInstance().getServerConfig().getLocalIP(), ConfigurationManager.getInstance().getServerConfig().getCommunicatorConfig().getSetDivision()); int ret = configPrx.loadConfigByInfo(configInfo, config); String stream = config.value; if (ret != 0 || stream == null || stream.length() == 0) { throw new TarsException("Config|config file is empty: " + fileName); } String newFile = getConfFilePath(fileName) + "." + System.currentTimeMillis() / 100; FileUtil.writeStringToFile(newFile, stream); return newFile; }
private String getRemoteFile(String fileName, boolean appConfigOnly) { Holder<String> config = new Holder<String>(); ConfigPrx configPrx = comm.stringToProxy(ConfigPrx.class, ConfigurationManager.getInstance().getServerConfig().getConfig()); ConfigInfo configInfo = new ConfigInfo(app, appConfigOnly ? "" : serverName, fileName, appConfigOnly, ConfigurationManager.getInstance().getServerConfig().getLocalIP(), ConfigurationManager.getInstance().getServerConfig().getCommunicatorConfig().getSetDivision()); int ret = configPrx.loadConfigByInfo(configInfo, config); String stream = config.value; if (ret != 0 || stream == null || stream.length() == 0) { throw new TarsException("Config|config file is empty: " + fileName); } String newFile = getConfFilePath(fileName) + "." + System.currentTimeMillis() / 100; FileUtil.writeStringToFile(newFile, stream); return newFile; }