閱讀原始碼筆記一

2021-09-26 19:05:28 字數 1612 閱讀 6382

一、build 

public sqlsessionfactory build(inputstream inputstream)
build作用:建立乙個sqlsessionfactory

返回值:inputstream輸入流

二、build

public sqlsessionfactory build(inputstream inputstream, string environment, properties properties)  catch (exception e)  finally  catch (ioexception e) 

}}

build作用:建立乙個sqlsessionfactory

返回值:

inputstream inputstream:輸入流

string environment:環境

properties properties:屬性

xmlconfigbuilder parser = new xmlconfigbuilder(inputstream, environment, properties);

xmlconfigbuilder:讀取.xml檔案

parser:解析

return build(parser.parse());

返回配置檔案

public sqlsessionfactory build(configuration config)
三、xmlconfigbuilder

public xmlconfigbuilder(inputstream inputstream, string environment, properties props)
xmlconfigbuilder作用:讀取.xml檔案

引數:inputstream inputstream:輸入流

string environment:環境

properties props:屬性

xpathparser作用:.xml路徑解析

public xpathparser(inputstream inputstream, boolean validation, properties variables, entityresolver entityresolver)
引數:

inputstream inputstream:輸入流

boolean validation:布林型別

properties variables:屬性

entityresolver entityresolver:實體處理類

commonconstructor:公共建構函式

private void commonconstructor(boolean validation, properties variables, entityresolver entityresolver)
this.document = createdocument(new inputsource(inputstream));

把輸入流傳進來的資源建立為乙個文件

LUA 原始碼閱讀筆記(一)

背景介紹 因為工作的需要,後台svr要能夠動態修改更新,使用c當然沒有問題,問題就在於修改原始碼後,需要重啟服務。所以就想到在c裡能夠嵌入一種指令碼,最好是和c無縫結合的。因此就想到使用到lua,lua的大名圈內人士應該早有耳聞,只不過一直沒有機會接觸。機緣巧合,有幸一見。俗話說得好,耳聞不如一見。...

tomcat原始碼閱讀筆記一

container全部啟動後,connector接著啟動,connector包含乙個protocolhandler,protocolhandler目前有三種協議 bio nio apr,可以按需求啟用相應的協議。每個協議protocolhandler包含乙個endpoint,在endpoint中開啟...

AQS原始碼閱讀筆記(一)

aqs原始碼閱讀筆記 先看下這個類張非常重要的乙個靜態內部類node。如下 static final class node 查詢當前節點的前乙個節點 final node predecessor throws nullpointerexception node node thread thread,...