Code example for ConnectorServerFactoryBean

Methods: afterPropertiesSetsetObjectNamesetServiceUrl

0
        if (mbeanPort != null && mbeanPort != 0) {// 做个兼容处理,<=4.2.2版本没有mbeanPort设置
            port = mbeanPort;
        } 
 
        String serviceUrl = MessageFormat.format(SERVER_URL, String.valueOf(port));
        super.setServiceUrl(serviceUrl);
        super.setObjectName("connector:name=rmi"); 
        // 直接使用port 
        getRegistry(port);
        super.afterPropertiesSet(); 
    } 
 
    private Registry getRegistry(int registryPort) throws RemoteException {
        if (this.alwaysCreateRegistry) {
            logger.info("Creating new RMI registry");
            return LocateRegistry.createRegistry(registryPort);
        } 
        if (logger.isInfoEnabled()) {
            logger.info("Looking for RMI registry at port '" + registryPort + "'");
        } 
Experience pair programming with AI  Get Codota for Java