public void init(NutConfig config) {
final Ioc ioc = config.getIoc();
}
此处ioc toString()有我配置的bean信息
/*NutIoc*/
{
loader:/*ComboIocLoader*/
{
"paths" :["ioc/"],
"map" :{
"baseService" :{
"type" :"com.alibaba.dubbo.config.ServiceConfig",
"fields" :{
"application" :{
"refer" :"provider.application"
},
"registry" :{
"refer" :"registry"
},
"protocol" :{
"refer" :"protocol"
}
}
},
"txREPEATABLE_READ" :{
"type" :"org.nutz.aop.interceptor.TransactionInterceptor",
"args" :[4]
},
"dataSource" :{
"type" :"com.alibaba.druid.pool.DruidDataSource",
"events" :{
"depose" :"close"
},
"fields" :{
"driverClassName" :{
"java" :"$conf.get(\"db_driver\")"
},
"url" :{
"java" :"$conf.get(\"db_url\")"
},
"username" :{
"java" :"$conf.get(\"db_user\")"
},
"password" :{
"java" :"$conf.get(\"db_passwd\")"
},
"filters" :"stat",
"initialSize" :30,
"maxActive" :150,
"minIdle" :30
}
},
"protocol" :{
"type" :"com.alibaba.dubbo.config.ProtocolConfig",
"fields" :{
"name" :"dubbo",
"port" :"8181",
"payload" :"52428800"
}
},
"transactionRepository" :{
"type" :"org.mengyun.tcctransaction.repository.RedisTransactionRepository",
"fields" :{
"keyPrefix" :"TCC:CAP:",
"jedisPool" :{
"refer" :"jedisPool"
}
}
},
"txNONE" :{
"type" :"org.nutz.aop.interceptor.TransactionInterceptor",
"args" :[0]
},
"service.basic.CapitalAccountService" :{
"parent" :"baseService",
"fields" :{
"interfaceName" :"org.mengyun.tcctransaction.sample.dubbo.capital.api.CapitalAccountService",
"ref" :{
"refer" :"capitalAccountService"
}
}
},
"provider.application" :{
"type" :"com.alibaba.dubbo.config.ApplicationConfig",
"fields" :{
"name" :"capital",
"logger" :"log4j"
}
},
"jedisPoolConfig" :{
"type" :"redis.clients.jedis.JedisPoolConfig",
"fields" :{
"maxTotal" :"1000",
"maxWaitMillis" :"1000"
}
},
"transactionRecovery" :{
"type" :"org.mengyun.tcctransaction.recover.TransactionRecovery",
"fields" :{
"transactionConfigurator" :{
"refer" :"transactionConfigurator"
}
}
},
"txSERIALIZABLE" :{
"type" :"org.nutz.aop.interceptor.TransactionInterceptor",
"args" :[8]
},
"transactionConfigurator" :{
"type" :"org.mengyun.tcctransaction.spring.support.SpringTransactionConfigurator",
"create" :"init"
},
"$aop" :{
"type" :"org.nutz.ioc.aop.config.impl.JsonAopConfigration",
"fields" :{
"itemList" :[["org\\.mengyun\\.tcctransaction\\.sample\\.dubbo\\.capital\\.service\\..+", ".+", "ioc:txREAD_COMMITTED"]]
}
},
"conf" :{
"type" :"org.nutz.ioc.impl.PropertiesProxy",
"fields" :{
"paths" :["custom/"]
}
},
"txREAD_UNCOMMITTED" :{
"type" :"org.nutz.aop.interceptor.TransactionInterceptor",
"args" :[1]
},
"jedisPool" :{
"type" :"redis.clients.jedis.JedisPool",
"args" :[{
"refer" :"jedisPoolConfig"
}, "127.0.0.1", "6379", "1000", "", 0]
},
"service.basic.CapitalTradeOrderService" :{
"parent" :"baseService",
"fields" :{
"interfaceName" :"org.mengyun.tcctransaction.sample.dubbo.capital.api.CapitalTradeOrderService",
"ref" :{
"refer" :"capitalTradeOrderService"
}
}
},
"reference" :{
"type" :"com.alibaba.dubbo.config.ReferenceConfig",
"singleton" :false,
"fields" :{
"cluster" :"failfast",
"loadbalance" :"leastactive",
"timeout" :38000,
"application" :{
"refer" :"provider.application"
},
"registry" :{
"refer" :"registry"
}
}
},
"txREAD_COMMITTED" :{
"type" :"org.nutz.aop.interceptor.TransactionInterceptor",
"args" :[2]
},
"dao" :{
"type" :"org.nutz.dao.impl.NutDao",
"args" :[{
"refer" :"dataSource"
}]
},
"registry" :{
"type" :"com.alibaba.dubbo.config.RegistryConfig",
"fields" :{
"protocol" :"zookeeper",
"address" :"zookeeper://127.0.0.1:2181",
"file" :"../dubbo/dubbo-registry-capital.propertie"
}
},
"defaultRecoverConfig" :{
"type" :"org.mengyun.tcctransaction.spring.recover.DefaultRecoverConfig",
"fields" :{
"maxRetryCount" :"30",
"recoverDuration" :"0/30 * * * * ?",
"delayCancelExceptions" :["com.alibaba.dubbo.remoting.TimeoutException"]
}
}
}
"map" :{
"capitalAccountRepository" :{
"type" :"org.mengyun.tcctransaction.sample.capital.domain.repository.CapitalAccountRepository",
"singleton" :true,
"events" :{
},
"args" :[],
"fields" :[{
"name" :"capitalAccountDao",
"value" :{
"type" :"refer",
"value" :"capitalAccountDao"
},
"optional" :false
}],
"scope" :"app"
},
"baseDao" :{
"type" :"org.mengyun.tcctransaction.sample.dao.BaseDao",
"singleton" :true,
"events" :{
},
"args" :[],
"fields" :[{
"name" :"dao",
"value" :{
"type" :"refer",
"value" :"dao"
},
"optional" :false
}],
"scope" :"app"
},
"capitalAccountService" :{
"type" :"org.mengyun.tcctransaction.sample.dubbo.capital.service.CapitalAccountServiceImpl",
"singleton" :true,
"events" :{
},
"args" :[],
"fields" :[{
"name" :"capitalAccountRepository",
"value" :{
"type" :"refer",
"value" :"capitalAccountRepository"
},
"optional" :false
}],
"scope" :"app"
},
"tradeOrderRepository" :{
"type" :"org.mengyun.tcctransaction.sample.capital.domain.repository.TradeOrderRepository",
"singleton" :true,
"events" :{
},
"args" :[],
"fields" :[{
"name" :"tradeOrderDao",
"value" :{
"type" :"refer",
"value" :"tradeOrderDao"
},
"optional" :false
}],
"scope" :"app"
},
"complexDatabase" :{
"type" :"org.mengyun.tcctransaction.sample.dao.ComplexDatabase",
"singleton" :true,
"events" :{
},
"args" :[],
"fields" :[{
"name" :"dao",
"value" :{
"type" :"refer",
"value" :"dao"
},
"optional" :false
}],
"scope" :"app"
},
"tradeOrderDao" :{
"type" :"org.mengyun.tcctransaction.sample.capital.infrastructure.dao.TradeOrderDao",
"singleton" :true,
"events" :{
},
"args" :[],
"fields" :[{
"name" :"baseDao",
"value" :{
"type" :"refer",
"value" :"baseDao"
},
"optional" :false
}],
"scope" :"app"
},
"capitalTradeOrderService" :{
"type" :"org.mengyun.tcctransaction.sample.dubbo.capital.service.CapitalTradeOrderServiceImpl",
"singleton" :true,
"events" :{
},
"args" :[],
"fields" :[{
"name" :"capitalAccountRepository",
"value" :{
"type" :"refer",
"value" :"capitalAccountRepository"
},
"optional" :false
}, {
"name" :"tradeOrderRepository",
"value" :{
"type" :"refer",
"value" :"tradeOrderRepository"
},
"optional" :false
}],
"scope" :"app"
},
"capitalAccountDao" :{
"type" :"org.mengyun.tcctransaction.sample.capital.infrastructure.dao.CapitalAccountDao",
"singleton" :true,
"events" :{
},
"args" :[],
"fields" :[{
"name" :"baseDao",
"value" :{
"type" :"refer",
"value" :"baseDao"
},
"optional" :false
}],
"scope" :"app"
}
}
},
}