This commit is contained in:
redkale
2024-06-11 14:52:15 +08:00
parent 5913c515b9
commit 52c120e5ac
8 changed files with 24 additions and 26 deletions

View File

@@ -105,7 +105,7 @@ class NodeAutoServiceLoader implements ResourceTypeLoader {
service.init(null);
}
logger.info("Load Service(" + (Sncp.isRemote(service) ? "Remote" : "@Local") + " @AutoLoad service = "
+ serviceImplClass.getSimpleName() + ", resourceName = '" + resourceName + "')");
+ serviceImplClass.getSimpleName() + ", resourceName='" + resourceName + "')");
return service;
} catch (Exception e) {
logger.log(

View File

@@ -179,7 +179,7 @@ public class CachedManagerService implements CachedManager, Service {
@Override
public String toString() {
return getClass().getSimpleName() + "_" + Objects.hash(this) + "{name = '" + name + "', schema = '" + schema
return getClass().getSimpleName() + "_" + Objects.hash(this) + "{name='" + name + "', schema='" + schema
+ "'}";
}

View File

@@ -100,7 +100,7 @@ public class ClusterModuleEngine extends ModuleEngine {
if (logger.isLoggable(Level.FINER)) {
logger.log(
Level.FINER,
"ClusterAgent (type = " + this.clusterAgent.getClass().getSimpleName() + ") initing");
"ClusterAgent (type=" + this.clusterAgent.getClass().getSimpleName() + ") initing");
}
long s = System.currentTimeMillis();
if (this.clusterAgent instanceof CacheClusterAgent) {
@@ -112,7 +112,7 @@ public class ClusterModuleEngine extends ModuleEngine {
this.resourceFactory.inject(clusterAgent);
clusterAgent.init(clusterAgent.getConfig());
this.resourceFactory.register(ClusterAgent.class, clusterAgent);
logger.info("ClusterAgent (type = " + this.clusterAgent.getClass().getSimpleName() + ") init in "
logger.info("ClusterAgent (type=" + this.clusterAgent.getClass().getSimpleName() + ") init in "
+ (System.currentTimeMillis() - s) + " ms");
}
}

View File

@@ -3,9 +3,6 @@
*/
package org.redkale.net.sncp;
import static org.redkale.net.sncp.Sncp.loadRemoteMethodActions;
import static org.redkale.net.sncp.SncpHeader.HEADER_SUBSIZE;
import java.lang.annotation.Annotation;
import java.lang.reflect.*;
import java.net.*;
@@ -19,6 +16,8 @@ import org.redkale.convert.json.JsonConvert;
import org.redkale.mq.spi.MessageAgent;
import org.redkale.mq.spi.MessageClient;
import org.redkale.mq.spi.MessageRecord;
import static org.redkale.net.sncp.Sncp.loadRemoteMethodActions;
import static org.redkale.net.sncp.SncpHeader.HEADER_SUBSIZE;
import org.redkale.service.*;
import org.redkale.util.*;
@@ -294,26 +293,26 @@ public class SncpRemoteInfo<S extends Service> {
@Override
public String toString() {
InetSocketAddress clientSncpAddress = sncpClient == null ? null : sncpClient.getClientSncpAddress();
return this.getClass().getSimpleName() + "(service = " + serviceType.getSimpleName() + ", serviceid = "
return this.getClass().getSimpleName() + "(service=" + serviceType.getSimpleName() + ", serviceid="
+ serviceid
+ ", serviceVersion = " + serviceVersion + ", name = '" + name
+ "', address = "
+ ", serviceVersion=" + serviceVersion + ", name='" + name
+ "', address="
+ (clientSncpAddress == null
? ""
: (clientSncpAddress.getHostString() + ":" + clientSncpAddress.getPort()))
+ ", actions.size = " + actions.size() + ")";
+ ", actions.size=" + actions.size() + ")";
}
public String toSimpleString() { // 给Sncp产生的Service用
InetSocketAddress clientSncpAddress = sncpClient == null ? null : sncpClient.getClientSncpAddress();
return serviceType.getSimpleName() + "(name = '" + name + "', serviceid = " + serviceid + ", serviceVersion = "
return serviceType.getSimpleName() + "(name='" + name + "', serviceid=" + serviceid + ", serviceVersion="
+ serviceVersion
+ ", clientaddr = "
+ ", clientaddr="
+ (clientSncpAddress == null
? ""
: (clientSncpAddress.getHostString() + ":" + clientSncpAddress.getPort()))
+ ((remoteGroup == null || remoteGroup.isEmpty()) ? "" : ", remoteGroup = " + remoteGroup)
+ ", actions.size = " + actions.size() + ")";
+ ((remoteGroup == null || remoteGroup.isEmpty()) ? "" : ", remoteGroup=" + remoteGroup)
+ ", actions.size=" + actions.size() + ")";
}
public void updateRemoteAddress(String remoteGroup, Set<InetSocketAddress> remoteAddresses) {

View File

@@ -115,7 +115,7 @@ public class PropertiesModule extends BootModule {
}
}
}
logger.info("PropertiesAgent (type = "
logger.info("PropertiesAgent (type="
+ this.propertiesAgent.getClass().getSimpleName() + ") load " + propCount + " data in "
+ (System.currentTimeMillis() - s) + " ms");
}

View File

@@ -5,8 +5,6 @@
*/
package org.redkale.source;
import static org.redkale.util.Utility.isEmpty;
import java.io.*;
import java.net.*;
import java.util.*;
@@ -14,6 +12,7 @@ import org.redkale.inject.ResourceFactory;
import org.redkale.service.Service;
import org.redkale.source.spi.DataSourceProvider;
import org.redkale.util.*;
import static org.redkale.util.Utility.isEmpty;
/**
* 构建DataSource对象的工具类
@@ -441,7 +440,7 @@ public final class DataSources {
}
}
if (readprop == null) {
throw new IOException("Cannot find (resource.name = '" + unitName + "') DataSource");
throw new IOException("Cannot find (resource.name='" + unitName + "') DataSource");
}
if (writeprop == null) {
writeprop = readprop;

View File

@@ -52,10 +52,10 @@ class CacheSourceLoader implements ResourceTypeLoader {
field.set(srcObj, source);
Resource res = field.getAnnotation(Resource.class);
if (res != null && res.required() && source == null) {
throw new RedkaleException("CacheSource (resourceName = '" + resourceName + "') not found");
throw new RedkaleException("CacheSource (resourceName='" + resourceName + "') not found");
} else {
logger.info("Load CacheSource (type = "
+ (source == null ? null : source.getClass().getSimpleName()) + ", resourceName = '"
logger.info("Load CacheSource (type="
+ (source == null ? null : source.getClass().getSimpleName()) + ", resourceName='"
+ resourceName + "')");
}
}

View File

@@ -379,7 +379,7 @@ public class SourceModuleEngine extends ModuleEngine implements SourceManager {
if (!application.isCompileMode() && source instanceof Service) {
((Service) source).init(sourceConf);
}
logger.info("Load CacheSource resourceName = '" + sourceName + "', source = " + source + " in "
logger.info("Load CacheSource resourceName='" + sourceName + "', source=" + source + " in "
+ (System.currentTimeMillis() - st) + " ms");
return source;
}
@@ -403,7 +403,7 @@ public class SourceModuleEngine extends ModuleEngine implements SourceManager {
cacheSources.add(source);
resourceFactory.register(sourceName, CacheSource.class, source);
logger.info("Load CacheSource resourceName = '" + sourceName + "', source = " + source + " in "
logger.info("Load CacheSource resourceName='" + sourceName + "', source=" + source + " in "
+ (System.currentTimeMillis() - st) + " ms");
return source;
} catch (RuntimeException ex) {
@@ -450,7 +450,7 @@ public class SourceModuleEngine extends ModuleEngine implements SourceManager {
}
dataSources.add(source);
resourceFactory.register(sourceName, DataSource.class, source);
logger.info("Load DataSource resourceName = '" + sourceName + "', source = " + source + " in "
logger.info("Load DataSource resourceName='" + sourceName + "', source=" + source + " in "
+ (System.currentTimeMillis() - st) + " ms");
return source;
}
@@ -495,7 +495,7 @@ public class SourceModuleEngine extends ModuleEngine implements SourceManager {
resourceFactory.register(sourceName, DataJdbcSource.class, source);
}
}
logger.info("Load DataSource resourceName = '" + sourceName + "', source = " + source + " in "
logger.info("Load DataSource resourceName='" + sourceName + "', source=" + source + " in "
+ (System.currentTimeMillis() - st) + " ms");
return source;
} catch (RuntimeException ex) {