public ObjectProxy(Class<T> api, ServantProxyConfig servantProxyConfig, LoadBalance loadBalance, ProtocolInvoker<T> protocolInvoker, Communicator communicator) { this.api = api; // this.objName = objName; this.communicator = communicator; this.servantProxyConfig = servantProxyConfig; this.loadBalancer = loadBalance; this.protocolInvoker = protocolInvoker; this.initialize(); }
public void refresh() { synchronized (refreshLock) { registryStatReproter(); registryServantNodeRefresher(); protocolInvoker.refresh(); loadBalancer.refresh(protocolInvoker.getInvokers()); } }
return this.equals(args[0]); } else if ("getObjectName".equals(methodName) && parameterTypes.length == 0) { return this.getObjectName(); } else if ("getApi".equals(methodName) && parameterTypes.length == 0) { return this.getApi(); } else if ("getConfig".equals(methodName) && parameterTypes.length == 0) { return this.getConfig(); } else if ("destroy".equals(methodName) && parameterTypes.length == 0) { this.destroy(); return null; } else if ("refresh".equals(methodName) && parameterTypes.length == 0) { this.refresh(); return null;
public void shutdown() { this.threadPoolExecutor.shutdownNow(); ScheduledExecutorManager.getInstance().shutdownNow(); TicketManager.shutdown(); for (Iterator<Object> it = servantProxyFactory.getProxyIterator(); it.hasNext(); ) { Object proxy = it.next(); ((ObjectProxy) Proxy.getInvocationHandler(proxy)).destroy(); } }
public <T> ObjectProxy<T> getObjectProxy(Class<T> api, String objName, String setDivision, ServantProxyConfig servantProxyConfig, LoadBalance<T> loadBalance, ProtocolInvoker<T> protocolInvoker) throws ClientException { if (servantProxyConfig == null) { servantProxyConfig = createServantProxyConfig(objName, setDivision); } else { servantProxyConfig.setCommunicatorId(communicator.getId()); servantProxyConfig.setModuleName(communicator.getCommunicatorConfig().getModuleName(), communicator.getCommunicatorConfig().isEnableSet(), communicator.getCommunicatorConfig().getSetDivision()); servantProxyConfig.setLocator(communicator.getCommunicatorConfig().getLocator()); if (setDivision != null) { servantProxyConfig.setEnableSet(true); servantProxyConfig.setSetDivision(setDivision); } } updateServantEndpoints(servantProxyConfig); if (loadBalance == null) { loadBalance = createLoadBalance(servantProxyConfig); } if (protocolInvoker == null) { protocolInvoker = createProtocolInvoker(api, servantProxyConfig); } return new ObjectProxy<T>(api, servantProxyConfig, loadBalance, protocolInvoker, communicator); }
return this.equals(args[0]); } else if ("getObjectName".equals(methodName) && parameterTypes.length == 0) { return this.getObjectName(); } else if ("getApi".equals(methodName) && parameterTypes.length == 0) { return this.getApi(); } else if ("getConfig".equals(methodName) && parameterTypes.length == 0) { return this.getConfig(); } else if ("destroy".equals(methodName) && parameterTypes.length == 0) { this.destroy(); return null; } else if ("refresh".equals(methodName) && parameterTypes.length == 0) { this.refresh(); return null;
public void shutdown() { this.threadPoolExecutor.shutdownNow(); ScheduledExecutorManager.getInstance().shutdownNow(); TicketManager.shutdown(); for (Iterator<Object> it = servantProxyFactory.getProxyIterator(); it.hasNext(); ) { Object proxy = it.next(); ((ObjectProxy) Proxy.getInvocationHandler(proxy)).destroy(); } }
public <T> ObjectProxy<T> getObjectProxy(Class<T> api, String objName, String setDivision, ServantProxyConfig servantProxyConfig, LoadBalance<T> loadBalance, ProtocolInvoker<T> protocolInvoker) throws ClientException { if (servantProxyConfig == null) { servantProxyConfig = createServantProxyConfig(objName, setDivision); } else { servantProxyConfig.setCommunicatorId(communicator.getId()); servantProxyConfig.setModuleName(communicator.getCommunicatorConfig().getModuleName(), communicator.getCommunicatorConfig().isEnableSet(), communicator.getCommunicatorConfig().getSetDivision()); servantProxyConfig.setLocator(communicator.getCommunicatorConfig().getLocator()); if (setDivision != null) { servantProxyConfig.setEnableSet(true); servantProxyConfig.setSetDivision(setDivision); } } updateServantEndpoints(servantProxyConfig); if (loadBalance == null) { loadBalance = createLoadBalance(servantProxyConfig); } if (protocolInvoker == null) { protocolInvoker = createProtocolInvoker(api, servantProxyConfig); } return new ObjectProxy<T>(api, servantProxyConfig, loadBalance, protocolInvoker, communicator); }
return this.equals(args[0]); } else if ("getObjectName".equals(methodName) && parameterTypes.length == 0) { return this.getObjectName(); } else if ("getApi".equals(methodName) && parameterTypes.length == 0) { return this.getApi(); } else if ("getConfig".equals(methodName) && parameterTypes.length == 0) { return this.getConfig(); } else if ("destroy".equals(methodName) && parameterTypes.length == 0) { this.destroy(); return null; } else if ("refresh".equals(methodName) && parameterTypes.length == 0) { this.refresh(); return null;
public void refresh() { synchronized (refreshLock) { registryStatReproter(); registryServantNodeRefresher(); protocolInvoker.refresh(); loadBalancer.refresh(protocolInvoker.getInvokers()); } }
public void shutdown() { this.threadPoolExecutor.shutdownNow(); ScheduledExecutorManager.getInstance().shutdownNow(); TicketManager.shutdown(); for (Iterator<Object> it = servantProxyFactory.getProxyIterator(); it.hasNext(); ) { Object proxy = it.next(); ((ObjectProxy) Proxy.getInvocationHandler(proxy)).destroy(); } }
public ObjectProxy(Class<T> api, ServantProxyConfig servantProxyConfig, LoadBalance loadBalance, ProtocolInvoker<T> protocolInvoker, Communicator communicator) { this.api = api; // this.objName = objName; this.communicator = communicator; this.servantProxyConfig = servantProxyConfig; this.loadBalancer = loadBalance; this.protocolInvoker = protocolInvoker; this.initialize(); }
public <T> ObjectProxy<T> getObjectProxy(Class<T> api, String objName, String setDivision, ServantProxyConfig servantProxyConfig, LoadBalance<T> loadBalance, ProtocolInvoker<T> protocolInvoker) throws ClientException { if (servantProxyConfig == null) { servantProxyConfig = createServantProxyConfig(objName, setDivision); } else { servantProxyConfig.setCommunicatorId(communicator.getId()); servantProxyConfig.setModuleName(communicator.getCommunicatorConfig().getModuleName(), communicator.getCommunicatorConfig().isEnableSet(), communicator.getCommunicatorConfig().getSetDivision()); servantProxyConfig.setLocator(communicator.getCommunicatorConfig().getLocator()); if (setDivision != null) { servantProxyConfig.setEnableSet(true); servantProxyConfig.setSetDivision(setDivision); } } updateServantEndpoints(servantProxyConfig); if (loadBalance == null) { loadBalance = createLoadBalance(servantProxyConfig); } if (protocolInvoker == null) { protocolInvoker = createProtocolInvoker(api, servantProxyConfig); } return new ObjectProxy<T>(api, servantProxyConfig, loadBalance, protocolInvoker, communicator); }
public void refresh() { synchronized (refreshLock) { registryStatReproter(); registryServantNodeRefresher(); protocolInvoker.refresh(); loadBalancer.refresh(protocolInvoker.getInvokers()); } }
public ObjectProxy(Class<T> api, ServantProxyConfig servantProxyConfig, LoadBalance loadBalance, ProtocolInvoker<T> protocolInvoker, Communicator communicator) { this.api = api; // this.objName = objName; this.communicator = communicator; this.servantProxyConfig = servantProxyConfig; this.loadBalancer = loadBalance; this.protocolInvoker = protocolInvoker; this.initialize(); }
private void initialize() { loadBalancer.refresh(protocolInvoker.getInvokers()); if (StringUtils.isNotEmpty(this.servantProxyConfig.getLocator()) && !StringUtils.isEmpty(this.servantProxyConfig.getStat())) { this.registryStatReproter(); } if (!servantProxyConfig.isDirectConnection()) { this.registryServantNodeRefresher(); } }
private void initialize() { loadBalancer.refresh(protocolInvoker.getInvokers()); if (StringUtils.isNotEmpty(this.servantProxyConfig.getLocator()) && !StringUtils.isEmpty(this.servantProxyConfig.getStat())) { this.registryStatReproter(); } if (!servantProxyConfig.isDirectConnection()) { this.registryServantNodeRefresher(); } }
private void initialize() { loadBalancer.refresh(protocolInvoker.getInvokers()); if (StringUtils.isNotEmpty(this.servantProxyConfig.getLocator()) && !StringUtils.isEmpty(this.servantProxyConfig.getStat())) { this.registryStatReproter(); } if (!servantProxyConfig.isDirectConnection()) { this.registryServantNodeRefresher(); } }