锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲视频日韩视频,亚洲Av无码一区二区二三区,亚洲综合网站色欲色欲http://www.tkk7.com/huamengxing/archive/2020/06/13/435510.html鍗庢ⅵ琛?/dc:creator>鍗庢ⅵ琛?/author>Sat, 13 Jun 2020 02:46:00 GMThttp://www.tkk7.com/huamengxing/archive/2020/06/13/435510.htmlhttp://www.tkk7.com/huamengxing/comments/435510.htmlhttp://www.tkk7.com/huamengxing/archive/2020/06/13/435510.html#Feedback0http://www.tkk7.com/huamengxing/comments/commentRss/435510.htmlhttp://www.tkk7.com/huamengxing/services/trackbacks/435510.html

            //鍏佽杈撳叆瀛楁瘝銆佺偣銆佸洖閫閿佹暟瀛?br />            if (((int)e.KeyChar >= (int)'a' && (int)e.KeyChar <= (int)'z') || (((int)e.KeyChar > 48 && (int)e.KeyChar < 57) || (int)e.KeyChar == 8 || (int)e.KeyChar == 46))
            {
                e.Handled = false;
            }
            else e.Handled = true;



      //鍏佽杈撳叆瀛楁瘝銆佸洖閫閿佹暟瀛?br />            if (((int)e.KeyChar >= (int)'a' && (int)e.KeyChar <= (int)'z') || (((int)e.KeyChar > 48 && (int)e.KeyChar < 57) || (int)e.KeyChar == 8))
            {
                e.Handled = false;
            }
            else e.Handled = true; 


// 鍙兘杈撳叆瀛楁瘝鏁板瓧浠ュ強涓枃瀛?br />  if ((e.KeyChar != '\b') && (!Char.IsLetter(e.KeyChar)) && (!char.IsDigit(e.KeyChar)))
            {
                e.Handled = true;
            }

//鍙緭鍏ユ暟瀛?br /> if (e.KeyChar != 8 && (!Char.IsDigit(e.KeyChar)))
            {
                e.Handled = true;
            }

鍙兘杈撳叆鏁板瓧浠ュ強瀛楁瘝X

  if (e.KeyChar != 88 && e.KeyChar != 8 && (!Char.IsDigit(e.KeyChar)))
            {
                e.Handled = true;
            }


]]>
nlog瀹夎http://www.tkk7.com/huamengxing/archive/2020/01/06/435020.html鍗庢ⅵ琛?/dc:creator>鍗庢ⅵ琛?/author>Mon, 06 Jan 2020 08:10:00 GMThttp://www.tkk7.com/huamengxing/archive/2020/01/06/435020.htmlhttp://www.tkk7.com/huamengxing/comments/435020.htmlhttp://www.tkk7.com/huamengxing/archive/2020/01/06/435020.html#Feedback0http://www.tkk7.com/huamengxing/comments/commentRss/435020.htmlhttp://www.tkk7.com/huamengxing/services/trackbacks/435020.htmlInstall-Package NLog.Config -Version 3.2.1



Install-Package NLog -Version 3.2.1

]]>
mysql5.7浠ヤ笂鐗堟湰鍦ㄥ父浼氭姤鍏充簬only_full_group_by鐨勯敊璇紝鍙互鍦╯ql_mode涓叧闂粬錛岀綉涓婃煡鎵劇殑瑙?/title><link>http://www.tkk7.com/huamengxing/archive/2019/09/15/434627.html</link><dc:creator>鍗庢ⅵ琛?/dc:creator><author>鍗庢ⅵ琛?/author><pubDate>Sun, 15 Sep 2019 14:02:00 GMT</pubDate><guid>http://www.tkk7.com/huamengxing/archive/2019/09/15/434627.html</guid><wfw:comment>http://www.tkk7.com/huamengxing/comments/434627.html</wfw:comment><comments>http://www.tkk7.com/huamengxing/archive/2019/09/15/434627.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/huamengxing/comments/commentRss/434627.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/huamengxing/services/trackbacks/434627.html</trackback:ping><description><![CDATA[<a > <ul style="list-style-type: none; box-sizing: border-box; font-size: 16px; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; font-variant: normal; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: normal; color: ; outline-width: 0px; padding-bottom: 0px; font-style: normal; padding-top: 0px; outline-style: none; padding-left: 0px; widows: 1; margin: 0px 0px 24px; letter-spacing: normal; outline-color: invert; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px"><li style="list-style-type: disc; box-sizing: border-box; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 8px 0px 0px 32px; outline-color: invert; padding-right: 0px"><span style="white-space: normal; word-spacing: 0px; text-transform: none; float: none; color: rgb(77,77,77); font: 16px/26px 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; widows: 1; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px">mysql5.7浠ヤ笂鐗堟湰鍦ㄥ父浼氭姤鍏充簬</span><code style="box-sizing: border-box; word-wrap: break-word; white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(199,37,78); outline-width: 0px; padding-bottom: 2px; padding-top: 2px; font: 14px/22px 'Source Code Pro', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Anonymous Pro', 'Droid Sans Mono', Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, 'PingFang SC', 'Microsoft YaHei', sans-serif; outline-style: none; padding-left: 4px; widows: 1; letter-spacing: normal; outline-color: invert; padding-right: 4px; background-color: rgb(249,242,244); text-indent: 0px; -webkit-text-stroke-width: 0px; border-radius: 2px">only_full_group_by</code><span style="white-space: normal; word-spacing: 0px; text-transform: none; float: none; color: rgb(77,77,77); font: 16px/26px 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; widows: 1; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px">鐨勯敊璇紝鍙互鍦╯ql_mode涓叧闂粬錛岀綉涓婃煡鎵劇殑瑙?/span></li><li style="list-style-type: disc; box-sizing: border-box; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 8px 0px 0px 32px; outline-color: invert; padding-right: 0px"></li><li style="list-style-type: disc; box-sizing: border-box; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 8px 0px 0px 32px; outline-color: invert; padding-right: 0px"></li><li style="list-style-type: disc; box-sizing: border-box; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; outline-width: 0px; padding-bottom: 0px; padding-top: 0px; outline-style: none; padding-left: 0px; margin: 8px 0px 0px 32px; outline-color: invert; padding-right: 0px">鍦╗mysqld]涓坊鍔犱唬鐮?/li></ul><pre class="prettyprint" style="box-sizing: border-box; word-wrap: break-word; border-top: medium none; border-right: medium none; word-spacing: 0px; overflow-x: auto; overflow-y: hidden; border-bottom: medium none; position: relative; text-transform: none; color: rgb(0,0,0); outline-width: 0px; padding-bottom: 6px; padding-top: 8px; font: 14px/22px 'Source Code Pro', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Anonymous Pro', 'Droid Sans Mono', Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, 'PingFang SC', 'Microsoft YaHei', sans-serif; outline-style: none; padding-left: 56px; border-left: medium none; widows: 1; margin: 0px 0px 24px; letter-spacing: normal; outline-color: invert; padding-right: 16px; background-color: rgb(246,248,250); text-indent: 0px; -webkit-text-stroke-width: 0px"><code onclick="mdcp.signin(event)" class=" hljs bash" style="box-sizing: border-box; font-size: 14px; word-wrap: break-word; font-family: 'Source Code Pro', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Anonymous Pro', 'Droid Sans Mono', Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: pre; min-width: 94%; overflow-x: auto; color: rgb(79,79,79) !important; outline-width: 0px; padding-bottom: 8px; padding-top: 8px; outline-style: none; padding-left: 8px; display: block; outline-color: invert; line-height: 22px; padding-right: 8px; background-color: rgb(246,248,250); border-radius: 4px">sql_mode =<span id="wttszyy" class="hljs-string" style="box-sizing: border-box; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; color: rgb(0,153,0) !important; outline-width: 0px; outline-style: none; outline-color: invert">'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'</span></code></pre><pre class="prettyprint" style="box-sizing: border-box; word-wrap: break-word; border-top: medium none; border-right: medium none; word-spacing: 0px; overflow-x: auto; overflow-y: hidden; border-bottom: medium none; position: relative; text-transform: none; color: rgb(0,0,0); outline-width: 0px; padding-bottom: 6px; padding-top: 8px; font: 14px/22px 'Source Code Pro', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Anonymous Pro', 'Droid Sans Mono', Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, 'PingFang SC', 'Microsoft YaHei', sans-serif; outline-style: none; padding-left: 56px; border-left: medium none; widows: 1; margin: 0px 0px 24px; letter-spacing: normal; outline-color: invert; padding-right: 16px; background-color: rgb(246,248,250); text-indent: 0px; -webkit-text-stroke-width: 0px"><p style="box-sizing: border-box; word-wrap: break-word; white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(77,77,77); outline-width: 0px; padding-bottom: 0px; padding-top: 0px; font: 16px/26px 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; outline-style: none; padding-left: 0px; widows: 1; margin: 0px 0px 16px; letter-spacing: normal; outline-color: invert; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px">閲嶅惎mysql</p><pre class="prettyprint" style="box-sizing: border-box; word-wrap: break-word; border-top: medium none; border-right: medium none; word-spacing: 0px; overflow-x: auto; overflow-y: hidden; border-bottom: medium none; position: relative; text-transform: none; color: rgb(0,0,0); outline-width: 0px; padding-bottom: 6px; padding-top: 8px; font: 14px/22px 'Source Code Pro', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Anonymous Pro', 'Droid Sans Mono', Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, 'PingFang SC', 'Microsoft YaHei', sans-serif; outline-style: none; padding-left: 56px; border-left: medium none; widows: 1; margin: 0px 0px 24px; letter-spacing: normal; outline-color: invert; padding-right: 16px; background-color: rgb(246,248,250); text-indent: 0px; -webkit-text-stroke-width: 0px"><code onclick="mdcp.signin(event)" class=" hljs bash" style="box-sizing: border-box; font-size: 14px; word-wrap: break-word; font-family: 'Source Code Pro', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Anonymous Pro', 'Droid Sans Mono', Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: pre; min-width: 94%; overflow-x: auto; color: rgb(79,79,79) !important; outline-width: 0px; padding-bottom: 8px; padding-top: 8px; outline-style: none; padding-left: 8px; display: block; outline-color: invert; line-height: 22px; padding-right: 8px; background-color: rgb(246,248,250); border-radius: 4px"><span id="vjhmfvl" class="hljs-built_in" style="box-sizing: border-box; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; color: rgb(79,79,79) !important; outline-width: 0px; outline-style: none; outline-color: invert">sudo</span> service mysql restart</code></pre><p style="box-sizing: border-box; word-wrap: break-word; white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(77,77,77); outline-width: 0px; padding-bottom: 0px; padding-top: 0px; font: 16px/26px 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; outline-style: none; padding-left: 0px; widows: 1; margin: 0px 0px 16px; letter-spacing: normal; outline-color: invert; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px"><span style="white-space: normal; word-spacing: 0px; text-transform: none; float: none; color: rgb(77,77,77); font: 16px/26px 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; widows: 1; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px">mysql5.7浠ヤ笂鐗堟湰鍦ㄥ父浼氭姤鍏充簬</span><code style="box-sizing: border-box; word-wrap: break-word; white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(199,37,78); outline-width: 0px; padding-bottom: 2px; padding-top: 2px; font: 14px/22px 'Source Code Pro', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Anonymous Pro', 'Droid Sans Mono', Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, 'PingFang SC', 'Microsoft YaHei', sans-serif; outline-style: none; padding-left: 4px; widows: 1; letter-spacing: normal; outline-color: invert; padding-right: 4px; background-color: rgb(249,242,244); text-indent: 0px; -webkit-text-stroke-width: 0px; border-radius: 2px">only_full_group_by</code><span style="white-space: normal; word-spacing: 0px; text-transform: none; float: none; color: rgb(77,77,77); font: 16px/26px 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; widows: 1; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px">鐨勯敊璇紝鍙互鍦╯ql_mode涓叧闂粬錛岀綉涓婃煡鎵劇殑瑙?/span><br />鏌ョ湅鍙傛暟鏄惁瀛樺湪</p><pre class="prettyprint" style="box-sizing: border-box; word-wrap: break-word; border-top: medium none; border-right: medium none; word-spacing: 0px; overflow-x: auto; overflow-y: hidden; border-bottom: medium none; position: relative; text-transform: none; color: rgb(0,0,0); outline-width: 0px; padding-bottom: 6px; padding-top: 8px; font: 14px/22px 'Source Code Pro', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Anonymous Pro', 'Droid Sans Mono', Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, 'PingFang SC', 'Microsoft YaHei', sans-serif; outline-style: none; padding-left: 56px; border-left: medium none; widows: 1; margin: 0px 0px 24px; letter-spacing: normal; outline-color: invert; padding-right: 16px; background-color: rgb(246,248,250); text-indent: 0px; -webkit-text-stroke-width: 0px"><code onclick="mdcp.signin(event)" class=" hljs asciidoc" style="box-sizing: border-box; font-size: 14px; word-wrap: break-word; font-family: 'Source Code Pro', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Anonymous Pro', 'Droid Sans Mono', Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: pre; min-width: 94%; overflow-x: auto; color: rgb(79,79,79) !important; outline-width: 0px; padding-bottom: 8px; padding-top: 8px; outline-style: none; padding-left: 8px; display: block; outline-color: invert; line-height: 22px; padding-right: 8px; background-color: rgb(246,248,250); border-radius: 4px"><span id="xzaudqz" class="hljs-header" style="box-sizing: border-box; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; color: rgb(0,153,0) !important; outline-width: 0px; outline-style: none; outline-color: invert">mysql> SELECT @@sql_mode; +------------------------------------------------------------------------------------------------------------------------+</span> <span id="mgbpgqp" class="hljs-header" style="box-sizing: border-box; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; color: rgb(0,153,0) !important; outline-width: 0px; outline-style: none; outline-color: invert">| @@sql_mode | +------------------------------------------------------------------------------------------------------------------------+</span> <span id="dzxhgma" class="hljs-header" style="box-sizing: border-box; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; color: rgb(0,153,0) !important; outline-width: 0px; outline-style: none; outline-color: invert">| STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | +------------------------------------------------------------------------------------------------------------------------+</span> 1 row in set (0.00 sec) <span id="vliwnfa" class="hljs-header" style="box-sizing: border-box; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; color: rgb(0,153,0) !important; outline-width: 0px; outline-style: none; outline-color: invert">mysql> SELECT @@GLOBAL.sql_mode; +------------------------------------------------------------------------------------------------------------------------+</span> <span id="uupojxh" class="hljs-header" style="box-sizing: border-box; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; color: rgb(0,153,0) !important; outline-width: 0px; outline-style: none; outline-color: invert">| @@GLOBAL.sql_mode | +------------------------------------------------------------------------------------------------------------------------+</span> <span id="qqlkuqp" class="hljs-header" style="box-sizing: border-box; word-wrap: break-word; font-family: 'Microsoft YaHei', 'SF Pro Display', Roboto, Noto, Arial, 'PingFang SC', sans-serif; color: rgb(0,153,0) !important; outline-width: 0px; outline-style: none; outline-color: invert">| STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | +------------------------------------------------------------------------------------------------------------------------+</span> 1 row in set (0.00 sec)</code></pre></pre></a><img src ="http://www.tkk7.com/huamengxing/aggbug/434627.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/huamengxing/" target="_blank">鍗庢ⅵ琛?/a> 2019-09-15 22:02 <a href="http://www.tkk7.com/huamengxing/archive/2019/09/15/434627.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>mysql zip 瀹夎5.7http://www.tkk7.com/huamengxing/archive/2019/09/14/434622.html鍗庢ⅵ琛?/dc:creator>鍗庢ⅵ琛?/author>Sat, 14 Sep 2019 14:51:00 GMThttp://www.tkk7.com/huamengxing/archive/2019/09/14/434622.htmlhttp://www.tkk7.com/huamengxing/comments/434622.htmlhttp://www.tkk7.com/huamengxing/archive/2019/09/14/434622.html#Feedback0http://www.tkk7.com/huamengxing/comments/commentRss/434622.htmlhttp://www.tkk7.com/huamengxing/services/trackbacks/434622.htmlMYSQL_HOME     瑙e帇璺緞   C:\DevelopTool\MySQL\mysql-5.7.25-winx64    

 

 

 Path     %MYSQL_HOME%\bin



>mysqld --initialize --user=mysql --console
mysqld -install 

鍏堝惎鍔ㄦ湇鍔★細

net start MySQL銆愭垨鑰呮槸MySQL57銆?/code>

淇敼瀵嗙爜
mysqladmin -uroot -p123456 password 123 


sc delete 鏈嶅姟鍚嶄緥濡傦細 sc delete mysql



https://www.cnblogs.com/july7/p/11489029.html

榪滅▼璁塊棶
use mysql;
GRANT ALL ON *.* TO root@'%' IDENTIFIED BY '瀵嗙爜' WITH GRANT OPTION;
flush privileges;


]]>
postman涓嶈兘鍚姩鐨勯棶棰?/title><link>http://www.tkk7.com/huamengxing/archive/2019/05/18/433802.html</link><dc:creator>鍗庢ⅵ琛?/dc:creator><author>鍗庢ⅵ琛?/author><pubDate>Sat, 18 May 2019 03:11:00 GMT</pubDate><guid>http://www.tkk7.com/huamengxing/archive/2019/05/18/433802.html</guid><wfw:comment>http://www.tkk7.com/huamengxing/comments/433802.html</wfw:comment><comments>http://www.tkk7.com/huamengxing/archive/2019/05/18/433802.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/huamengxing/comments/commentRss/433802.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/huamengxing/services/trackbacks/433802.html</trackback:ping><description><![CDATA[ 闇瑕佹坊鍔犱竴涓幆澧冨彉閲廝OSTMAN_DISABLE_GPU = true銆? <img src ="http://www.tkk7.com/huamengxing/aggbug/433802.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/huamengxing/" target="_blank">鍗庢ⅵ琛?/a> 2019-05-18 11:11 <a href="http://www.tkk7.com/huamengxing/archive/2019/05/18/433802.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>REST API URI璁捐http://www.tkk7.com/huamengxing/archive/2017/06/26/432624.html鍗庢ⅵ琛?/dc:creator>鍗庢ⅵ琛?/author>Mon, 26 Jun 2017 01:50:00 GMThttp://www.tkk7.com/huamengxing/archive/2017/06/26/432624.htmlhttp://www.tkk7.com/huamengxing/comments/432624.htmlhttp://www.tkk7.com/huamengxing/archive/2017/06/26/432624.html#Feedback0http://www.tkk7.com/huamengxing/comments/commentRss/432624.htmlhttp://www.tkk7.com/huamengxing/services/trackbacks/432624.html鍦ㄤ簡瑙EST API URI璁捐鐨勮鍒欎箣鍓嶏紝璁╂垜浠揩閫熸祻瑙堜竴浜涙垜浠皢瑕佽璁虹殑鏈銆?/p>

URIs

REST API浣跨敤緇熶竴璧勬簮鏍囪瘑絎︼紙URI錛夋潵瀵誨潃璧勬簮銆傚湪褰撲粖浜掕仈緗戜笂錛屽厖鏂ョ潃鍚勭鍚勬牱鐨刄RI璁捐瑙勫垯錛屾棦鏈夊儚//api.example.com/louvre/leonardo-da-vinci/mona-lisa榪欐牱鑳藉娓呮鐨勪紶杈続PI璧勬簮妯″瀷鐨勬枃绔狅紝涔熸湁寰堥毦鐞嗚В鐨勬枃绔狅紝渚嬪錛?a style="box-sizing: border-box; background-color: transparent; color: #337ab7; text-decoration: none;">//api.example.com/68dd0-a9d3-11e0-9f1c-0800200c9a66 錛汿im Berners-Lee鍦ㄤ粬鐨?#8220;Axioms of Web Architecture”涓鏂囦腑灝哢RI鐨勪笉閫忔槑搴︽葷粨鎴愪竴鍙ヨ瘽錛?/p>

鍞竴鍙互浣跨敤鏍囪瘑絎︾殑鏄紩鐢ㄥ璞°傚湪涓嶅彇娑堝紩鐢ㄦ椂錛屽氨涓嶅簲璇ユ煡鐪婾RI瀛楃涓茬殑鍐呭浠ヨ幏鍙栧叾浠栦俊鎭?nbsp;
——钂傚·浼撼鏂?- 鏉?/a>

瀹㈡埛绔繀欏婚伒寰猈eb鐨勯摼鎺ヨ寖渚嬶紝灝哢RI瑙嗕負涓嶉忔槑鏍囪瘑絎︺?/p>

REST API璁捐浜哄憳搴旇鍦ㄨ冭檻灝哛EST API璧勬簮妯″瀷浼犺揪緇欐綔鍦ㄧ殑瀹㈡埛绔紑鍙戣呯殑鍓嶆彁涓嬶紝鍒涢燯RI銆傚湪榪欑瘒鏂囩珷涓紝鎴戝皢灝濊瘯涓篟EST API URI 寮曞叆涓濂?a style="box-sizing: border-box; background-color: transparent; color: #337ab7; text-decoration: none;">璁捐瑙勫垯銆?/p>

鍏堣煩榪囪鍒欙紝URI鐨勯氱敤璇硶涔熼傜敤涓庢湰鏂囦腑鐨刄RI銆?a style="box-sizing: border-box; background-color: transparent; color: #337ab7; text-decoration: none;">RFC 3986瀹氫箟浜嗛氱敤URI璇硶錛屽涓嬫墍紺猴細

URI = scheme “://” authority “/” path [ “?” query ][ “#” fragment ]

瑙勫垯1錛歎RI緇撳熬涓嶅簲鍖呭惈錛?錛?/h2>

榪欐槸浣滀負URI璺緞涓鐞嗕腑鏈閲嶈鐨勮鍒欎箣涓錛屾鏂滄潬錛?錛変笉浼氬鍔犺涔夊鹼紝涓斿彲鑳藉鑷存販娣嗐俁EST API涓嶅厑璁鎬竴涓熬閮ㄧ殑鏂滄潬錛屼笉搴旇灝嗗畠浠寘鍚湪鎻愪緵緇欏鎴風鐨勯摼鎺ョ殑緇撳熬澶勩?/p>

璁稿Web緇勪歡鍜屾鏋跺皢騫崇瓑瀵瑰緟浠ヤ笅涓や釜URI錛?nbsp;
http://api.canvas.com/shapes/ 
http://api.canvas.com/shapes

浣嗘槸錛屽疄闄呬笂URI涓殑姣忎釜瀛楃閮戒細璁″叆璧勬簮鐨勫敮涓韜喚鐨勮瘑鍒腑銆?/span>

涓や釜涓嶅悓鐨刄RI鏄犲皠鍒頒袱涓笉鍚岀殑璧勬簮銆傚鏋淯RI涓嶅悓錛岄偅涔堣祫婧愪篃鏄姝わ紝鍙嶄箣浜︾劧銆傚洜姝わ紝REST API蹇呴』鐢熸垚鍜屼紶閫掔簿紜殑URI錛屼笉鑳藉蹇嶄換浣曠殑瀹㈡埛绔皾璇曚笉綺劇‘鐨勮祫婧愬畾浣嶃?/p>

鏈変簺API紕板埌榪欑鎯呭喌錛屽彲鑳借璁′負璁╁鎴風閲嶅畾鍚戝埌鐩稿簲娌℃湁灝炬枩鏉犵殑URI錛堜篃鏈夊彲鑳戒細榪斿洖301 - 鐢ㄦ潵璧勬簮閲嶅畾鍚戯級銆?/p>

瑙勫垯2錛氭鏂滄潬鍒嗛殧絎︼紙/錛夊繀欏葷敤鏉ユ寚紺哄眰綰у叧緋?/h2>

URI鐨勮礬寰勪腑鐨勬鏂滄潬錛?錛夊瓧絎︾敤浜庢寚紺鴻祫婧愪箣闂寸殑灞傛鍏崇郴銆?/p>

渚嬪錛?nbsp;
(http://api.canvas.com/shapes/polygons/quadrilaterals/squares 錛?/p>

瑙勫垯3錛氬簲浣跨敤榪炲瓧絎︼紙 - 錛夋潵鎻愰珮URI鐨勫彲璇繪?/h2>

涓轟簡浣挎偍鐨刄RI瀹規槗璁╀漢浠悊瑙o紝璇蜂嬌鐢ㄨ繛瀛楃錛?- 錛夊瓧絎︽潵鎻愰珮闀胯礬寰勪腑鍚嶇О鐨勫彲璇繪с傚湪璺緞涓紝搴旇浣跨敤榪炲瓧絎︿唬絀烘牸榪炴帴涓や釜鍗曡瘝 銆?/p>

渚嬪錛?nbsp;
http://api.example.com/blogs/guy-levin/posts/this-is-my-first-post

瑙勫垯4錛氫笉寰楀湪URI涓嬌鐢ㄤ笅鍒掔嚎錛坃錛?/h2>

涓浜涙枃鏈煡鐪嬪櫒涓轟簡鍖哄垎寮鴻皟URI錛屽父甯鎬細鍦║RI涓嬪姞涓婁笅鍒掔嚎銆傝繖鏍蜂笅鍒掔嚎錛坃錛夊瓧絎﹀彲鑳借鏂囨湰鏌ョ湅鍣ㄤ腑榛樿鐨勪笅鍒掔嚎閮ㄥ垎鍦伴伄钄芥垨瀹屽叏闅愯棌銆?/p>

涓洪伩鍏嶈繖縐嶆販娣嗭紝璇蜂嬌鐢ㄨ繛瀛楃錛?- 錛夎屼笉鏄笅鍒掔嚎

瑙勫垯5錛歎RI璺緞涓閫夊皬鍐欏瓧姣?/h2>

鏂逛究鏃訛紝URI璺緞涓閫夊皬鍐欏瓧姣嶏紝鍥犱負澶у啓瀛楁瘝鏈夋椂浼氬鑷翠竴浜涢棶棰樸俁FC 3986灝哢RI瀹氫箟涓哄尯鍒嗗ぇ灝忓啓錛屼絾scheme 鍜?host components闄ゅ銆?/p>

渚嬪錛?nbsp;
http://api.example.com/my-folder/my-doc

HTTP://API.EXAMPLE.COM/my-folder/my-doc 
榪欎釜URI寰堝ソ銆俇RI鏍煎紡瑙勮寖錛圧FC 3986錛夎涓鴻URI涓嶶RI錛?鐩稿悓銆?/p>

http://api.example.com/My-Folder/my-doc 
鑰岃繖涓猆RI涓嶶RI 1鍜?涓嶅悓錛岃繖鍙兘浼氬鑷翠笉蹇呰鐨勬販娣嗐?/p>

瑙勫垯6錛氭枃浠舵墿灞曞悕涓嶅簲鍖呭惈鍦║RI涓?/h2>

鍦╓eb涓婏紝錛?錛夊瓧絎﹂氬父鐢ㄤ簬鍒嗛殧URI鐨勬枃浠跺悕鍜屾墿灞曞悕銆?nbsp;
REST API涓嶅簲鍦║RI涓寘鍚漢閫犳枃浠舵墿灞曞悕錛屾潵鎸囩ず閭歡瀹炰綋鐨勬牸寮忋傜浉鍙嶏紝浠栦滑搴旇渚濊禆閫氳繃Content-Type涓殑header浼犻抦edia type錛屾潵紜畾濡備綍澶勭悊姝f枃鐨勫唴瀹廣?/p>

http://api.college.com/students/3248234/courses/2005/fall.json 
http://api.college.com/students/3248234/courses/2005/fall

濡備笂鎵紺猴細涓嶅簲浣跨敤鏂囦歡鎵╁睍鍚嶆潵琛ㄧず鏍煎紡銆?/p>

搴旈紦鍔盧EST API瀹㈡埛绔嬌鐢℉TTP鎻愪緵鐨勬牸寮忛夋嫨鏈哄埗Accept request header銆?/p>

涓轟簡鏄摼鎺ュ拰璋冭瘯鏇寸畝鍗曪紝REST API搴旇鏀寔閫氳繃鏌ヨ鍙傛暟鏉ユ敮鎸佸獟浣撶被鍨嬬殑閫夋嫨銆?/p>

瑙勫垯7錛氱鐐瑰悕縐版槸鍗曟暟榪樻槸澶嶆暟錛?/h2>

keep-it-simple鐨勫師鍒欏湪榪欓噷鍚屾牱閫傜敤銆傝櫧鐒朵竴浜?#8221;璇硶瀛﹀”浼氬憡璇変綘浣跨敤澶嶆暟鏉ユ弿榪拌祫婧愮殑鍗曚釜瀹炰緥鏄敊璇殑錛屼絾瀹為檯涓婁負浜嗕繚鎸乁RI鏍煎紡鐨勪竴鑷存у緩璁嬌鐢ㄥ鏁板艦寮忋?/p>

鏈潃API鎻愪緵鍟嗘洿瀹規槗瀹炴柦鍜孉PI浣跨敤鑰呮洿瀹規槗鎿嶄綔鐨勫師鍒欙紝鍙互涓嶅繀綰犵粨涓浜涘鎬殑澶嶆暟錛坧erson/people錛実oose/geese錛夈?/p>

浣嗘槸搴旇鎬庝箞澶勭悊灞傜駭鍏崇郴鍛紵濡傛灉涓涓叧緋誨彧鑳藉瓨鍦ㄤ簬鍙︿竴涓祫婧愪腑錛孯ESTful鍘熷垯灝變細鎻愪緵鏈夌敤鐨勬寚瀵箋傛垜浠潵鐪嬩竴涓嬭繖涓緥瀛愩傚鐢熸湁涓浜涜紼嬨傝繖浜涜紼嬪湪閫昏緫涓婃槧灝勫埌瀛︾敓緇堢錛屽涓嬫墍紺猴細

http://api.college.com/students/3248234/courses - 媯绱d涓?248234鐨勫鐢熷涔犵殑鎵鏈夎紼嬬殑娓呭崟銆?nbsp;
http://api.college.com/students/3248234/courses/physics -媯绱㈣瀛︾敓鐨勭墿鐞嗚紼?/p>

緇撹

褰撲綘鍦?a style="box-sizing: border-box; background-color: transparent; color: #337ab7; text-decoration: none;">璁捐REST API鏈嶅姟鏃訛紝鎮ㄥ繀欏繪敞鎰忚繖浜涚敱URI瀹氫箟鐨勮祫婧愩?/p>

姝e湪鏋勫緩鐨勬湇鍔′腑鐨勬瘡涓祫婧愬皢鑷沖皯鏈変竴涓猆RI鏍囪瘑瀹冦傝繖涓猆RI鏈濂芥槸鏈夋剰涔夌殑錛屼笖鑳藉厖鍒嗘弿榪拌祫婧愩俇RI搴旈伒寰彲棰勬祴鐨勫眰嬈$粨鏋勶紝鐢ㄦ潵鎻愰珮鍏跺彲鐞嗚В鎬э紝鍙敤鎬э細鍙嫻嬬殑鎰忎箟鍦ㄤ簬瀹冧滑鏄竴鑷寸殑錛屽畠鐨勫眰嬈$粨鏋勫湪鏁版嵁鍏崇郴涓婃槸鏈夋剰涔夌殑銆?/p>

RESTful API鏄負浣跨敤鑰呯紪鍐欑殑銆俇RI鐨勫悕縐板拰緇撴瀯搴旇鑳藉鍚戜嬌鐢ㄨ呬紶杈炬洿娓呮櫚鐨勫惈涔夈傞氳繃閬靛驚涓婅堪瑙勫垯錛屾偍灝嗗垱寤轟竴涓洿娓呮櫚鐨勭殑REST API涓庢洿鍙嬪ソ鐨勫鎴風銆傝繖浜涘茍涓嶆槸REST鐨勮鍒欐垨綰︽潫錛屼粎浠呮槸API鐨勫寮哄拰琛ュ厖銆?/p>

鎴戜篃寤鴻浣犳潵鐪嬬湅http://blog.restcase.com/5-basic-rest-api-design-guidelines/榪欑瘒鏂囩珷銆?/p>

鏈鍚庯紝鏈涘ぇ瀹剁墷璁幫細浣犲湪涓轟綘鐨勫鎴風璁捐API URI錛岃屼笉浠呬粎鏄負浣犵殑鏁版嵁銆?/p>

]]>
鍔犺澆鏂囦歡鐨勬柟寮?/title><link>http://www.tkk7.com/huamengxing/archive/2017/06/19/432615.html</link><dc:creator>鍗庢ⅵ琛?/dc:creator><author>鍗庢ⅵ琛?/author><pubDate>Mon, 19 Jun 2017 06:45:00 GMT</pubDate><guid>http://www.tkk7.com/huamengxing/archive/2017/06/19/432615.html</guid><wfw:comment>http://www.tkk7.com/huamengxing/comments/432615.html</wfw:comment><comments>http://www.tkk7.com/huamengxing/archive/2017/06/19/432615.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/huamengxing/comments/commentRss/432615.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/huamengxing/services/trackbacks/432615.html</trackback:ping><description><![CDATA[<p style="margin-top: 0pt; margin-bottom: 0pt; direction: ltr; unicode-bidi: embed; vertical-align: baseline;"><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:zh-CN;font-weight:bold">* </span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">this.getClass</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">().</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">getClassLoader</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">().</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">getResourceAsStream</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">("</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">testVariables.bpmn</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">")</span></p> <p style="margin-top: 0pt; margin-bottom: 0pt; direction: ltr; unicode-bidi: embed; vertical-align: baseline;"><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">       </span><span style="font-size:14.0pt; font-family:瀹嬩綋;color:#FF3300;language: zh-CN;font-weight:bold">浠?/span><u><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">classpath</span></u><span style="font-size:14.0pt;font-family:瀹嬩綋;color:#FF3300;language:zh-CN;font-weight:bold">鏍圭洰褰曚笅鍔犺澆鎸囧畾鍚嶇О鐨勬枃浠?/span></p> <p style="margin-top: 0pt; margin-bottom: 0pt; direction: ltr; unicode-bidi: embed; vertical-align: baseline;"><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:zh-CN;font-weight:bold"> * </span><span style="font-size:14.0pt; font-family:Verdana;color:#FF3300;language: en-US;font-weight:bold">this.getClass</span><span style="font-size:14.0pt; font-family:Verdana;color:#FF3300;language: en-US;font-weight:bold">().</span><span style="font-size:14.0pt;font-family: Verdana;color:#FF3300;language:en-US;font-weight:bold">getResourceAsStream</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">("</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">testVariables.bpmn</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">")    </span></p> <p style="margin-top: 0pt; margin-bottom: 0pt; direction: ltr; unicode-bidi: embed; vertical-align: baseline;"><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:zh-CN;font-weight:bold">       浠庡綋鍓嶅寘涓嬪姞杞芥寚瀹氬悕縐扮殑鏂囦歡</span></p> <p style="margin-top: 0pt; margin-bottom: 0pt; direction: ltr; unicode-bidi: embed; vertical-align: baseline;"><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:zh-CN;font-weight:bold"> * </span><span style="font-size:14.0pt; font-family:Verdana;color:#FF3300;language: en-US;font-weight:bold">this.getClass</span><span style="font-size:14.0pt; font-family:Verdana;color:#FF3300;language: en-US;font-weight:bold">().</span><span style="font-size:14.0pt;font-family: Verdana;color:#FF3300;language:en-US;font-weight:bold">getResourceAsStream</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">("/</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">testVariables.bpmn</span><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">")  </span></p> <p style="margin-top: 0pt; margin-bottom: 0pt; direction: ltr; unicode-bidi: embed; vertical-align: baseline;"><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:zh-CN;font-weight:bold">       浠?/span><u><span style="font-size:14.0pt;font-family:Verdana;color:#FF3300;language:en-US;font-weight:bold">classpath</span></u><span style="font-size:14.0pt;font-family:瀹嬩綋;color:#FF3300;language:zh-CN;font-weight:bold">鏍圭洰褰曚笅鍔犺澆鎸囧畾鍚嶇О鐨勬枃浠?/span></p><img src ="http://www.tkk7.com/huamengxing/aggbug/432615.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/huamengxing/" target="_blank">鍗庢ⅵ琛?/a> 2017-06-19 14:45 <a href="http://www.tkk7.com/huamengxing/archive/2017/06/19/432615.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>restfulhttp://www.tkk7.com/huamengxing/archive/2017/05/26/432551.html鍗庢ⅵ琛?/dc:creator>鍗庢ⅵ琛?/author>Fri, 26 May 2017 00:01:00 GMThttp://www.tkk7.com/huamengxing/archive/2017/05/26/432551.htmlhttp://www.tkk7.com/huamengxing/comments/432551.htmlhttp://www.tkk7.com/huamengxing/archive/2017/05/26/432551.html#Feedback0http://www.tkk7.com/huamengxing/comments/commentRss/432551.htmlhttp://www.tkk7.com/huamengxing/services/trackbacks/432551.html
package org.gdharley.activiti.integration.rest;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.Expression;
import org.activiti.engine.delegate.JavaDelegate;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.methods.*;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLContextBuilder;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpMethod;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;


/**
 * Created by gharley on 5/2/17.
 
*/
public class SimpleRestDelegate implements JavaDelegate {
    private static final Logger logger = LoggerFactory.getLogger(SimpleRestDelegate.class);

    protected Expression endpointUrl;
    protected Expression httpMethod;
    protected Expression isSecure;
    protected Expression payload;

//    涓涓狢ontent-Type鏄痑pplication/json鐨勮姹傦紝鍏蜂綋鐪嬭搗鏉ユ槸榪欐牱鐨勶細
//    POST /some-path HTTP/1.1
//    Content-Type: application/json
//
//    { "foo" : "bar", "name" : "John" }
//
//
//    { "foo" : "bar", "name" : "John" } 灝辨槸榪欎釜璇鋒眰鐨刾ayload



    protected Expression headers;
    protected Expression responseMapping;

    protected ObjectMapper objectMapper = new ObjectMapper();

    // Create a mixin to force the BasicNameValuePair constructor
    protected static abstract class BasicNameValuePairMixIn {
        private BasicNameValuePairMixIn(@JsonProperty("name") String name, @JsonProperty("value") String value) {
        }
    }

    public void execute(DelegateExecution execution) throws Exception {
        logger.info("Started Generic REST call delegate");

        if (endpointUrl == null || httpMethod == null) {
            throw new IllegalArgumentException("An endpoint URL and http method are required");
        }

        String restUrl = getExpressionAsString(endpointUrl, execution);
        String payloadStr = getExpressionAsString(payload, execution);
        String headersJSON = getExpressionAsString(headers, execution); // [{"name":"headerName", "value":"headerValue"}]
        String method = getExpressionAsString(httpMethod, execution);
        String rMapping = getExpressionAsString(responseMapping, execution);
        String secure = getExpressionAsString(isSecure, execution);
        String scheme = secure == "true" ? "https" : "http";

        // validate URI and create create request
        URI restEndpointURI = composeURI(restUrl, execution);

        logger.info("Using Generic REST URI " + restEndpointURI.toString());

        HttpRequestBase httpRequest = createHttpRequest(restEndpointURI, scheme, method, headersJSON, payloadStr, rMapping);

        // create http client
        CloseableHttpClient httpClient = createHttpClient(httpRequest, scheme, execution);

        // execute request
        HttpResponse response = executeHttpRequest(httpClient, httpRequest);

        // map response to process instance variables
        if (responseMapping != null) {
            mapResponse(response, rMapping, execution);
        }

        logger.info("Ended Generic REST call delegate");

    }

    protected URI composeURI(String restUrl, DelegateExecution execution)
            throws URISyntaxException {

        URIBuilder uriBuilder = null;
        uriBuilder = encodePath(restUrl, uriBuilder);
        return uriBuilder.build();
    }

    protected URIBuilder encodePath(String restUrl, URIBuilder uriBuilder) throws URISyntaxException {

        if (StringUtils.isNotEmpty(restUrl)) {

            // check if there are URL params
            if (restUrl.indexOf('?') > -1) {

                List<NameValuePair> params = URLEncodedUtils.parse(new URI(restUrl), "UTF-8");

                if (params != null && !params.isEmpty()) {
                    restUrl = restUrl.substring(0, restUrl.indexOf('?'));
                    uriBuilder = new URIBuilder(restUrl);
                    uriBuilder.addParameters(params);

                }
            } else {
                uriBuilder = new URIBuilder(restUrl);
            }
        }

        return uriBuilder;
    }

    protected HttpRequestBase createHttpRequest(URI restEndpointURI, String scheme, String httpMethod, String headers, String payload, String responseMapping) {

        if (StringUtils.isEmpty(httpMethod)) {
            throw new ActivitiException("no HTTP method provided");
        }
        if (restEndpointURI == null) {
            throw new ActivitiException("no REST endpoint URI provided");
        }

        HttpRequestBase httpRequest = null;
        HttpMethod parsedMethod = HttpMethod.valueOf(httpMethod.toUpperCase());
        StringEntity input;
        URIBuilder builder = new URIBuilder(restEndpointURI);

        switch (parsedMethod) {
            case GET:
                try {
                    httpRequest = new HttpGet(builder.build());
                    httpRequest = addHeadersToRequest(httpRequest, headers);
                } catch (URISyntaxException use) {
                    throw new ActivitiException("Error while building GET request", use);
                }
                break;
            case POST:
                try {
                    httpRequest = new HttpPost(builder.build());
                    input = new StringEntity(payload);
//                input.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
                    ((HttpPost) httpRequest).setEntity(input);
                    httpRequest = addHeadersToRequest(httpRequest, headers);
                    break;
                } catch (Exception e) {
                    throw new ActivitiException("Error while building POST request", e);
                }
            case PUT:
                try {
                    httpRequest = new HttpPut(builder.build());
                    input = new StringEntity(payload);
//                input.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
                    ((HttpPut) httpRequest).setEntity(input);
                    httpRequest = addHeadersToRequest(httpRequest, headers);
                    break;
                } catch (Exception e) {
                    throw new ActivitiException("Error while building PUT request", e);
                }
            case DELETE:
                try {
                    httpRequest = new HttpDelete(builder.build());
                    httpRequest = addHeadersToRequest(httpRequest, headers);
                } catch (URISyntaxException use) {
                    throw new ActivitiException("Error while building DELETE request", use);
                }
                break;
            default:
                throw new ActivitiException("unknown HTTP method provided");
        }

        return httpRequest;
    }


    protected CloseableHttpClient createHttpClient(HttpRequestBase request, String scheme, DelegateExecution execution) {

        SSLConnectionSocketFactory sslsf = null;

        // Allow self signed certificates and hostname mismatches.
        if (StringUtils.equalsIgnoreCase(scheme, "https")) {
            try {
                SSLContextBuilder builder = new SSLContextBuilder();
                builder.loadTrustMaterial(nullnew TrustSelfSignedStrategy());
                sslsf = new SSLConnectionSocketFactory(builder.build(), SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
            } catch (Exception e) {
                logger.warn("Could not configure HTTP client to use SSL", e);
            }
        }

        HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();

        if (sslsf != null) {
            httpClientBuilder.setSSLSocketFactory(sslsf);
        }

        return httpClientBuilder.build();
    }

    protected HttpResponse executeHttpRequest(CloseableHttpClient httpClient, HttpRequestBase httpRequest) {

        CloseableHttpResponse response = null;
        try {
            response = httpClient.execute(httpRequest);
        } catch (IOException e) {
            throw new ActivitiException("error while executing http request: " + httpRequest.getURI(), e);
        }

        if (response.getStatusLine().getStatusCode() >= 400) {
            throw new ActivitiException("error while executing http request " + httpRequest.getURI() + " with status code: "
                    + response.getStatusLine().getStatusCode());
        }

        return response;
    }

    protected void mapResponse(HttpResponse response, String responseMapping, DelegateExecution execution) {

        if (responseMapping == null || responseMapping.trim().length() == 0) {
            return;
        }

        JsonNode jsonNode = null;
        try {
            String jsonString = EntityUtils.toString(response.getEntity());
            jsonNode = objectMapper.readTree(jsonString);

        } catch (Exception e) {
            throw new ActivitiException("error while parsing response", e);
        }

        if (jsonNode == null) {
            throw new ActivitiException("didn't expect an empty response body");
        }
        execution.setVariable(responseMapping, jsonNode.toString());
    }

    protected HttpRequestBase addHeadersToRequest(HttpRequestBase httpRequest, String headerJSON) {
        Boolean contentTypeDetected = false;
        if (headerJSON != null) {
            // Convert JSON to array
            try {
                // configuration for Jackson/fasterxml
                objectMapper.addMixInAnnotations(BasicNameValuePair.class, BasicNameValuePairMixIn.class);
                NameValuePair[] headers = objectMapper.readValue(headerJSON, BasicNameValuePair[].class);
                for (NameValuePair header : headers) {
                    httpRequest.addHeader(header.getName(), header.getValue());
                    if (header.getName().equals(HTTP.CONTENT_TYPE)) {
                        contentTypeDetected = true;
                    }
                }
            } catch (Exception e) {
                throw new ActivitiException("Unable to parse JSON header array", e);
            }
        }
        // Now add content type if necessary
        if (!contentTypeDetected) {
            httpRequest.addHeader(HTTP.CONTENT_TYPE, "application/json");
        }
        return httpRequest;
    }

    /**
     * 
@return string value of expression.
     * 
@throws {@link IllegalArgumentException} when the expression resolves to a value which is not a string
     *                or if the value is null.
     
*/
    protected String getExpressionAsString(Expression expression, DelegateExecution execution) {
        if (expression == null) {
            return null;
        } else {
            Object value = expression.getValue(execution);
            if (value instanceof String) {
                return (String) value;
            } else {
                throw new IllegalArgumentException("Expression does not resolve to a string or is null: " + expression.getExpressionText());
            }
        }
    }
}


]]>
activiti緋葷粺琛ㄧ粨鏋?/title><link>http://www.tkk7.com/huamengxing/archive/2017/05/16/432532.html</link><dc:creator>鍗庢ⅵ琛?/dc:creator><author>鍗庢ⅵ琛?/author><pubDate>Tue, 16 May 2017 08:31:00 GMT</pubDate><guid>http://www.tkk7.com/huamengxing/archive/2017/05/16/432532.html</guid><wfw:comment>http://www.tkk7.com/huamengxing/comments/432532.html</wfw:comment><comments>http://www.tkk7.com/huamengxing/archive/2017/05/16/432532.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/huamengxing/comments/commentRss/432532.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/huamengxing/services/trackbacks/432532.html</trackback:ping><description><![CDATA[<div><h2>1銆佹榪?/h2><p>activiti緋葷粺涓鍏辨湁23涓〃錛屽寘鎷祦紼嬪畾涔夎〃銆佷竴鑸暟鎹俊鎭〃銆佹祦紼嬭繍琛屽疄渚嬭〃銆佹祦紼嬪巻鍙茶褰曡〃銆佺敤鎴風敤鎴風粍琛ㄣ?/p><h2>2銆丄ctiviti 嫻佺▼瀹氫箟琛?/h2><p>嫻佺▼瀹氫箟琛紝嫻佺▼瀹氫箟琛ㄤ篃鍙互鍙仛鏄潤鎬佽祫婧愬簱錛岄潤鎬佽祫婧愬寘鎷浘鐗囥佸畾涔夎鍒欑瓑銆傚畠鏈夐儴緗蹭俊鎭〃銆佹祦紼嬫ā鍨嬭〃銆佹祦紼嬪畾涔夎〃</p><p>1銆丄CT_RE_DEPLOYMENT錛堥儴緗蹭俊鎭〃錛?/p><p>鍖呮嫭錛氶儴緗叉祦紼嬪悕縐般佺被鍨嬨侀儴緗叉椂闂?/p><p>2銆丄CT_RE_MODEL錛堟ā鍨嬭〃錛?/p><p>鍚嶇О,key銆佺被鍨嬨佸垱寤烘椂闂淬佹渶鍚庝慨鏀規椂闂淬佺増鏈佹暟鎹簮淇℃伅銆侀儴緗睮D銆佺紪杈戞簮鍊糏D銆佺紪杈戞簮棰濆鍊糏D錛堝閿瓵CT_GE_BYTEARRAY 錛?/p><p>3銆丄CT_RE_PROCDEF錛堟祦紼嬪畾涔夎〃錛?nbsp;</p><p>鍖呮嫭嫻佺▼瀹氫箟銆佺被鍨嬨佹祦紼嬪悕縐般佹祦紼媖ey銆佺増鏈彿銆侀儴緗睮D銆佽祫婧愬悕縐般佸浘鐗囪祫婧愬悕縐般佹弿榪頒俊鎭佹槸鍚︿粠key鍚姩銆佹殏鍋滅姸鎬併?/p><h2>3銆丄ctiviti 榪愯瀹炰緥琛?/h2><p>榪愯瀹炰緥琛ㄨ褰曟祦紼嬫祦杞繃紼嬩腑浜х敓鐨勬暟鎹紝涓鑸暟鎹垎涓轟袱涓儴鍒嗘祦紼嬫暟鎹佷笟鍔℃暟鎹傛祦紼嬫暟鎹槸鎸嘺ctiviti嫻佺▼寮曟搸嫻佽漿榪囩▼涓殑鏁版嵁錛屽寘鎷祦紼嬫墽琛屽疄渚嬫暟鎹帴銆佷換鍔℃暟鎹佹墽琛屼換鍔′漢鍛樹俊鎭佸彉閲忎俊鎭備笟鍔℃暟鎹垯鏄祦紼嬭繃紼嬩腑淇濆瓨鐨勮〃鍗曟暟鎹紝渚嬪錛氬璇峰亣鐨勮鍋囧崟鏁版嵁銆佹姤閿鍗曟暟鎹佸鎵規剰瑙佷俊鎭瓑錛屾閮ㄥ垎鏁版嵁涓鑸渶瑕佽嚜宸卞緩鏁版嵁琛ㄨ繘琛屼繚瀛橈紝鍦ㄤ箣鍓嶇殑jbpm4涓病鏈変繚瀛樹笟鍔℃暟鎹?/p><p>1銆丄CT_RU_EVENT_SUBSCR錛堜簨浠跺瓙鑴氭湰錛変綔鐢ㄦ湭鐭?/p><p>浜嬩歡鍚嶇О錛圗VENT_NAME_錛夈佷簨浠剁被鍨?EVENT_TYPE_)銆佹祦紼嬫墽琛孖D(EXECUTION_ID_)銆佹祦紼嬪疄渚婭D(PROC_INST_ID_)銆佹椿鍔↖D(ACTIVITY_ID_)銆侀厤緗俊鎭?CONFIGURATION_)銆佸垱寤烘椂闂達紙CREATED_錛?/p><p>2銆丄CT_RU_EXECUTION錛堟墽琛屼腑嫻佺▼鎵ц錛夋牳蹇冩垜鐨勪唬鍔炰換鍔℃煡璇㈣〃</p><p>嫻佺▼瀹炰緥ID錛圥ROC_INST_ID_錛夛紝涓氬姟key錛圔USINESS_KEY_錛夈佺埗鎵ц嫻佺▼錛圥ARENT_ID_錛夈佹祦紼嬪畾涔塈d錛堝閿甈ROC_DEF_ID_錛夈佸疄渚媔d錛圓CT_ID_錛夈佹縺媧葷姸鎬侊紙IS_ACTIVE_錛夈佸茍鍙戠姸鎬侊紙is_concurrent錛夈乮s_scope銆乮s_evnet_scope銆佹殏鍋滅姸鎬侊紙suspension_state錛夈佺紦瀛樼粨鏉熺姸鎬侊紙cached_end_state錛?/p><p>3銆丄CT_RU_IDENTITYLINK錛堣韓浠借仈緋伙級</p><p>鐢ㄦ埛緇勶緝錛わ紙GROUP_ID_錛夈佺敤鎴風粍綾誨瀷(TYPE_)銆佺敤鎴稩D(USER_ID_)銆佷換鍔d錛堝閿細TASK_ID_錛夈佹祦紼嬪疄渚婭D錛堝閿細PROC_INST_ID_錛夈佹祦紼嬪畾涔塈d錛堝閿?PROC_DEF_ID_錛?/p><p>4銆丄CT_RU_JOB(榪愯涓殑浠誨姟)</p><p>5銆丄CT_RU_TASK錛堟墽琛屼腑瀹炴椂浠誨姟錛変唬鍔炰換鍔℃煡璇㈣〃</p><p>瀹炰緥id錛堝閿瓻XECUTION_ID_錛夈佹祦紼嬪疄渚婭D錛堝閿甈ROC_INST_ID_錛夈佹祦紼嬪畾涔塈D錛圥ROC_DEF_ID_錛夈佷換鍔″悕縐幫紙NAME_錛夈佺埗鑺備換鍔D錛圥ARENT_TASK_ID_錛?/p><p>銆佷換鍔℃弿榪幫紙DESCRIPTION_錛夈佷換鍔″畾涔塳ey錛圱ASK_DEF_KEY_錛夈佹墍灞炰漢錛圤WNER_錛夈佷唬鐞嗕漢鍛?(ASSIGNEE_)銆佷唬鐞嗗洟錛圖ELEGATION_錛夈佷紭鍏堟潈錛圥RIORITY_錛夈佸垱寤烘椂闂達紙CREATE_TIME_錛夈佹墽琛屾椂闂達紙DUE_DATE_錛夈佹殏鍋滅姸鎬侊紙SUSPENSION_STATE_錛?/p><p>6銆丄CT_RU_VARIABLE錛堝疄鏃跺彉閲忥級</p><p>鍙橀噺鍚嶇О錛圢AME_錛夈佺紪鐮佺被鍨?TYPE_)銆佹墽琛屽疄渚婭D(EXECUTION_ID_)銆佹祦紼嬪疄渚婭d(PROC_INST_ID_)銆佷換鍔d(TASK_ID_)銆佸瓧鑺傜粍ID錛圔YTEARRAY_ID_錛夈丏OUBLE_銆丩ONG_銆乀EXT_銆乀EXT2_</p><h2>3銆佹祦紼嬪巻鍙茶褰?/h2><p>嫻佺▼鍘嗗彶淇℃伅琛紝activiti鍘嗗彶璁板綍琛ㄥ寘鎷妭鐐逛俊鎭〃銆侀檮浠朵俊鎭〃銆佸巻鍙插鎵硅褰曡〃銆佺悊鎯寵緇嗕俊鎭〃銆佸巻鍙茶韓浠戒俊鎭〃銆佹祦紼嬪疄渚嬪巻鍙茶〃銆佷換鍔″巻鍙茶〃銆佸巻鍙插彉閲忚〃銆傦紙鑺傜偣淇℃伅琛ㄣ侀檮浠朵俊鎭〃銆佸巻鍙插鎵硅褰曡〃銆佺悊鎯寵緇嗕俊鎭〃銆佸巻鍙茶韓浠戒俊鎭〃錛夎繖浜涜〃鐩墠榪樻湭鐭ユ槸濡備綍鐢ㄧ殑銆傦紙嫻佺▼瀹炰緥鍘嗗彶琛ㄣ佷換鍔″巻鍙茶〃銆佸巻鍙插彉閲忥級涓変釜琛ㄥ彲浠ユ煡璇㈡垜宸插畬鎴愪換鍔°佷換鍔¤拷韙瓑銆?/p><p>1銆丄CT_HI_ACTINST錛堟椿鍔ㄥ疄渚嬩俊鎭級</p><p>嫻佺▼瀹氫箟ID錛圥ROC_DEF_ID_錛夈佹祦紼嬪疄渚婭D錛圥ROC_INST_ID_錛夈佹祦紼嬫墽琛孖D錛圗XECUTION_ID_錛夈佹椿鍔↖D錛圓CT_ID_錛夈佹椿鍔ㄥ悕縐幫紙TASK_ID_錛夈佹椿鍔ㄧ被鍨嬶紙ACT_TYPE_錛夈佷換鍔D銆侊紙TASK_ID_錛夈佽姹傛祦紼嬪疄渚婭D錛圕ALL_PROC_INST_ID_錛夈佷唬鐞嗕漢鍛橈紙ASSIGNEE_錛夈佸紑濮嬫椂闂達紙START_TIME_錛夈佺粨鏉熸椂闂?END_TIME_)銆佹椂闀匡紙DURATION_錛?/p><p>2銆丄CT_HI_ATTACHMENT錛堥檮浠朵俊鎭級</p><p>鐢ㄦ埛id錛圲SER_ID_錛夈佸悕縐幫紙NAME_錛夈佹弿榪幫紙DESCRIPTION_錛夈佺被鍨嬶紙TYPE_錛夈佷換鍔d錛圱ASK_ID_錛夈佹祦紼嬪疄渚婭D錛圥ROC_INST_ID_錛夈佽繛鎺ワ紙URL_錛夈佸唴瀹笽d錛圕ONTENT_ID_錛?/p><p>3銆丄CT_HI_COMMENT錛堝巻鍙插鎵逛俊鎭級</p><p>綾誨瀷錛圱YPE_錛夈佹椂闂達紙TIME_錛夈佺敤鎴稩d錛圲SER_ID_錛夈佷換鍔d錛圱ASK_ID_錛夈佹祦紼嬪疄渚婭d錛圥ROC_INST_ID_錛夈佹椿鍔紙ACTION_錛夈佹秷鎭紙MESSAGE_錛夈佸叏閮ㄦ秷鎭紙FULL_MSG_錛?/p><p>4銆丄CT_HI_DETAIL錛堝巻鍙茶緇嗕俊鎭級</p><p>鏁版嵁綾誨瀷錛圱YPE_錛夈佸垱寤烘椂闂?TIME_)銆佸悕縐?NAME_)銆佹祦紼嬪疄渚婭D錛圥ROC_INST_ID_錛夈佹墽琛屽疄渚婭d(EXECUTION_ID_)銆佷換鍔d(TASK_ID_)銆佹椿鍔ㄥ疄渚婭d(ACT_INST_ID_)銆佸彉閲忕被鍨?VAR_TYPE_)銆佸瓧鑺傛暟緇処d銆丏OUBLE_銆丩ONG_銆佸鹼紙TEXT_錛夈佸?錛圱EXT2_錛?/p><p>5銆丄CT_HI_IDENTITYLINK錛堝巻鍙茶韓浠戒俊鎭級</p><p>浠誨姟Id錛圱ASK_ID_錛夈佹祦紼嬪疄渚婭d錛圥ROC_INST_ID_錛夈乽serId錛圲SER_ID_錛夈佺敤鎴風粍綾誨瀷Type錛圱YPE_錛夈佺敤鎴風粍ID錛圙ROUP_ID_錛?/p><p>6銆丄CT_HI_PROCINST錛堝巻鍙叉祦紼嬪疄渚嬩俊鎭級鏍稿績琛?/p><p>嫻佺▼瀹炰緥ID錛圥ROC_INST_ID_錛夈佷笟鍔ey錛圔USINESS_KEY_錛夈佹祦紼嬪畾涔塈d錛圥ROC_DEF_ID_錛夈佸紑濮嬫椂闂達紙START_TIME_錛夈佺粨鏉熸椂闂達紙END_TIME_錛夈佹椂闀匡紙DURATION_錛夈佸彂璧蜂漢鍛業d錛圫TART_USER_ID_錛夈佸紑濮嬭妭鐐癸紙START_ACT_ID_錛夈佺粨鏉熻妭鐐癸紙END_ACT_ID_錛夈佽秴綰ф祦紼嬪疄渚婭d錛圫UPER_PROCESS_INSTANCE_ID_錛夈佸垹闄ょ悊鐢憋紙DELETE_REASON_錛?/p><p>7銆丄CT_HI_TASKINST錛堝巻鍙蹭換鍔℃祦紼嬪疄渚嬩俊鎭級鏍稿績琛?/p><p>嫻佺▼瀹炰緥ID錛圥ROC_INST_ID_錛夈佷換鍔″畾涔塊ey錛圔USINESS_KEY_錛夈佹祦紼嬪畾涔塈d錛圥ROC_DEF_ID_錛夈佹墽琛孖D錛圗XECUTION_ID_錛夈佸悕縐幫紙NAME_錛夈佺埗浠誨姟iD錛圥ARENT_TASK_ID_錛夈佹弿榪幫紙DESCRIPTION_錛夈佹墍灞炰漢錛圤WNER_錛夈佷唬鐞嗕漢錛圓SSIGNEE_錛夈佸紑濮嬫椂闂達紙START_TIME_錛夈佺粨鏉熸椂闂達紙END_TIME_錛夈佹椂闀匡紙DURATION_錛夈佸垹闄ょ悊鐢憋紙DELETE_REASON__錛夈佷紭鍏堢駭錛圥RIORITY_錛夈佸簲瀹屾垚鏃墮棿錛圖UE_DATE_錛夈佽〃鍗昸ey錛團ORM_KEY_錛?/p><p>8銆丄CT_HI_VARINST錛堝巻鍙插彉閲忎俊鎭級</p><p>嫻佺▼瀹炰緥ID錛圥ROC_INST_ID_錛夈佹墽琛孖D錛圗XECUTION_ID_錛夈佷換鍔d銆佸悕縐幫紙NAME_錛夈佸彉閲忥紙TASK_ID_錛夈佺被鍨嬶紙VAR_TYPE_錛夈佸瓧鑺傛暟緇処D錛圔YTEARRAY_ID_錛夈丏OUBLE_銆丩ONG_銆乀EXT_銆乀EXT2_</p><h2>4銆佷竴鑸暟鎹?/h2><p>1銆丄CT_GE_BYTEARRAY錛堝瓧鑺傛暟鎹〃錛?/p><p>鍚嶇О錛圢AME_錛夈侀儴緗睮d錛圖EPLOYMENT_ID_錛夈佸瓧鑺傛暟鎹紙BYTES_錛夈佸彂鐢熺殑錛圙ENERATED_錛?/p><p>2銆丄CT_GE_PROPERTY錛堜竴鑸睘鎬ц〃錛?/p><p>鍚嶇О錛圢AMe_錛夈佸?VALUe_)</p><h2>5銆佺敤鎴風敤鎴風粍琛?/h2><p>Activit 鐨勭敤鎴風敤鎴風粍琛紝鍖呮嫭鐢ㄦ埛淇℃伅銆佺敤鎴風粍淇℃伅銆佺敤鎴蜂笌鐢ㄦ埛緇勯棿鐨勫叧緋匯佺敤鎴蜂俊鎭笌鐢ㄦ埛涔嬮棿鐨勫叧緋匯傚湪瀹為檯寮鍙戜腑鏈噰鐢紝鐢ㄧ殑瀹為檯緋葷粺涓敤鎴楓?/p><p>1銆丄CT_ID_GROUP錛堢敤鎴風粍琛級</p><p>鍚嶇О錛圢AME_錛夈佺被鍨?TYPE_)</p><p>2銆丄CT_ID_USER錛堢敤鎴瘋〃錛?/p><p>濮?FIRST_)銆佸悕縐?LAST_)銆侀偖浠?EMAIL_)銆佸瘑鐮?PWD_)銆佸ご鍍廔d (PICTURE_ID_)</p><p>3銆丄CT_ID_INFO錛堢敤鎴蜂俊鎭〃錛?/p><p>鐢ㄦ埛Id(USER_ID_)銆佺被鍨?TYPE_)銆乫ormINPut鍚嶇О(KEY_)銆佸?VALUE_)銆佸瘑鐮?PASSWORD_)銆佺埗鑺傜偣(PARENT_ID_)</p><p>4銆丄CT_ID_MEMBERSHIP錛堢敤鎴風敤鎴風粍鍏寵仈琛級</p><p>鐢ㄦ埛Id(user_ID_)銆佺敤鎴風粍Id錛坓roup_Id錛?/p><p>Activiti琛ㄧ粨鏋勫垎鏋愬畬鎴愶紝鑺變簡5涓皬鏃訛紝榪樻湁寰堝闂涓嶆槑鐧姐傚悗緇參鎱㈠紑鍙戣繃紼嬩腑鍐嶇悊涓嬈¤〃涔嬮棿鍏崇郴鍚э紝鍒濇鎯蟲硶鍦ㄧ郴緇熶腑闇瑕佹墿寤鴻〃錛屾妸涓氬姟鏁版嵁鍜屾祦紼嬫暟鎹垎寮銆?/p></div><img src ="http://www.tkk7.com/huamengxing/aggbug/432532.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/huamengxing/" target="_blank">鍗庢ⅵ琛?/a> 2017-05-16 16:31 <a href="http://www.tkk7.com/huamengxing/archive/2017/05/16/432532.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Activiti宸ヤ綔嫻佸紩鎿庢暟鎹簱琛ㄧ粨鏋?/title><link>http://www.tkk7.com/huamengxing/archive/2017/05/15/432529.html</link><dc:creator>鍗庢ⅵ琛?/dc:creator><author>鍗庢ⅵ琛?/author><pubDate>Mon, 15 May 2017 14:23:00 GMT</pubDate><guid>http://www.tkk7.com/huamengxing/archive/2017/05/15/432529.html</guid><wfw:comment>http://www.tkk7.com/huamengxing/comments/432529.html</wfw:comment><comments>http://www.tkk7.com/huamengxing/archive/2017/05/15/432529.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/huamengxing/comments/commentRss/432529.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/huamengxing/services/trackbacks/432529.html</trackback:ping><description><![CDATA[     鎽樿: Activiti宸ヤ綔嫻佸紩鎿庢暟鎹簱琛ㄧ粨鏋?鏁版嵁搴撹〃鐨勫懡鍚?Acitiviti鏁版嵁搴撲腑琛ㄧ殑鍛藉悕閮芥槸浠CT_寮澶寸殑銆傜浜岄儴鍒嗘槸涓涓袱涓瓧絎︾敤渚嬭〃鐨勬爣璇嗐傛鐢ㄤ緥澶т綋涓庢湇鍔PI鏄尮閰嶇殑銆?l  ACT_RE_*:’RE’琛ㄧずrepository銆傚甫姝ゅ墠緙鐨勮〃鍖呭惈鐨勬槸闈欐佷俊鎭紝濡傦紝嫻佺▼瀹氫箟錛屾祦紼嬬殑璧勬簮錛堝浘鐗囷紝瑙勫垯絳夛級銆?l  ACT_RU_*:̵...  <a href='http://www.tkk7.com/huamengxing/archive/2017/05/15/432529.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/huamengxing/aggbug/432529.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/huamengxing/" target="_blank">鍗庢ⅵ琛?/a> 2017-05-15 22:23 <a href="http://www.tkk7.com/huamengxing/archive/2017/05/15/432529.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>jpa 瀛楁涓嶈鏄犲皠http://www.tkk7.com/huamengxing/archive/2017/05/10/432515.html鍗庢ⅵ琛?/dc:creator>鍗庢ⅵ琛?/author>Wed, 10 May 2017 08:59:00 GMThttp://www.tkk7.com/huamengxing/archive/2017/05/10/432515.htmlhttp://www.tkk7.com/huamengxing/comments/432515.htmlhttp://www.tkk7.com/huamengxing/archive/2017/05/10/432515.html#Feedback0http://www.tkk7.com/huamengxing/comments/commentRss/432515.htmlhttp://www.tkk7.com/huamengxing/services/trackbacks/432515.html

]]>
SNMP 鐩稿叧http://www.tkk7.com/huamengxing/archive/2017/03/22/432395.html鍗庢ⅵ琛?/dc:creator>鍗庢ⅵ琛?/author>Wed, 22 Mar 2017 07:28:00 GMThttp://www.tkk7.com/huamengxing/archive/2017/03/22/432395.htmlhttp://www.tkk7.com/huamengxing/comments/432395.htmlhttp://www.tkk7.com/huamengxing/archive/2017/03/22/432395.html#Feedback0http://www.tkk7.com/huamengxing/comments/commentRss/432395.htmlhttp://www.tkk7.com/huamengxing/services/trackbacks/432395.htmlSnmpwalk –v 2 –c public 192.168.20.114 1.3.6.1.2.1.2.2.1.3
snmpget -r:127.0.0.1 -o:.1.3.6.1.2.1.25.3.3.1.2
E:\>snmpget -r:127.0.0.1 -o:.1.3.6.1.2.1.1.1.0
SnmpGet v1.01 - Copyright (C) 2009 SnmpSoft Company
[ More useful network tools on http://www.snmpsoft.com ]
OID=.1.3.6.1.2.1.1.1.0
Type=OctetString
Value=Hardware: Intel64 Family 6 Model 60 Stepping 3 AT/AT COMPATIBLE - Software
: Windows Version 6.1 (Build 7601 Multiprocessor Free)
snmpwalk -v:2c -c:public -r:127.0.0.1


]]>
Druid 浠嬬粛http://www.tkk7.com/huamengxing/archive/2017/03/21/432392.html鍗庢ⅵ琛?/dc:creator>鍗庢ⅵ琛?/author>Mon, 20 Mar 2017 16:11:00 GMThttp://www.tkk7.com/huamengxing/archive/2017/03/21/432392.htmlhttp://www.tkk7.com/huamengxing/comments/432392.htmlhttp://www.tkk7.com/huamengxing/archive/2017/03/21/432392.html#Feedback0http://www.tkk7.com/huamengxing/comments/commentRss/432392.htmlhttp://www.tkk7.com/huamengxing/services/trackbacks/432392.htmlDruid鏄粈涔堬紵

Druid鏄竴涓狫DBC緇勪歡錛屽畠鍖呮嫭鍥涗釜閮ㄥ垎錛?/p>

http://download.csdn.net/download/feelnature/1580901
http://tomcat.apache.org/tomcat-8.5-doc/monitoring.html#Enabling_JMX_Remote

http://download.csdn.net/detail/qq_21163257/9695557

 

  • DruidDriver 浠g悊Driver錛岃兘澶熸彁渚涘熀浜嶧ilter錛岰hain妯″紡鐨勬彃浠朵綋緋匯?/div>
  • DruidDataSource 楂樻晥鍙鐞嗙殑鏁版嵁搴撹繛鎺ユ睜銆?/div>
  • SQLParser
  • 鎵╁睍緇勪歡
  • Binary: http://code.alibabatech.com/mvn/releases/com/alibaba/druid/0.1.2/druid-0.1.2.jar
  • Source: http://code.alibabatech.com/mvn/releases/com/alibaba/druid/0.1.2/druid-0.1.2-sources.jar

Druid鍙互鍋氫粈涔堬紵

  • 鍙互鐩戞帶鏁版嵁搴撹闂ц兘錛孌ruid鍐呯疆鎻愪緵浜嗕竴涓姛鑳藉己澶х殑StatFilter鎻掍歡錛岃兘澶熻緇嗙粺璁QL鐨勬墽琛屾ц兘錛岃繖瀵逛簬綰夸笂鍒嗘瀽鏁版嵁搴撹闂ц兘鏈夊府鍔┿?/div>
  • 鏇挎崲DBCP鍜孋3P0銆侱ruid鎻愪緵浜嗕竴涓珮鏁堛佸姛鑳藉己澶с佸彲鎵╁睍鎬уソ鐨勬暟鎹簱榪炴帴姹犮?/div>
  • 鏁版嵁搴撳瘑鐮佸姞瀵嗐傜洿鎺ユ妸鏁版嵁搴撳瘑鐮佸啓鍦ㄩ厤緗枃浠朵腑錛岃繖鏄笉濂界殑琛屼負錛屽鏄撳鑷村畨鍏ㄩ棶棰樸侱ruidDruiver鍜孌ruidDataSource閮芥敮鎸丳asswordCallback銆?/div>
  • SQL鎵ц鏃ュ織錛孌ruid鎻愪緵浜嗕笉鍚岀殑LogFilter錛岃兘澶熸敮鎸丆ommon-Logging銆丩og4j鍜孞dkLog錛屼綘鍙互鎸夐渶瑕侀夋嫨鐩稿簲鐨凩ogFilter錛岀洃鎺т綘搴旂敤鐨勬暟鎹簱璁塊棶鎯呭喌銆?/div>
  • 鎵╁睍JDBC錛屽鏋滀綘瑕佸JDBC灞傛湁緙栫▼鐨勯渶姹傦紝鍙互閫氳繃Druid鎻愪緵鐨凢ilter鏈哄埗錛屽緢鏂逛究緙栧啓JDBC灞傜殑鎵╁睍鎻掍歡銆?/div>

DruidDriver錛屾槸涓涓狿roxyJdbcDriver錛屽畠鎻愪緵浜咶ilter-Chain妯″紡鐨勬墿灞曟満鍒訛紝浣垮緱鍦↗dbc鎵╁睍緙栫▼鐗瑰埆鏂逛究銆?/p>

Druid鎻愪緵浜嗕竴浜涘唴緗殑鎵╁睍鏈哄埗錛屽寘鎷?u>Stat銆?u>Log銆?u>Trace銆丠A絳夋墿灞曘?/p>


DruidDataSource鏄竴涓暟鎹簱榪炴帴姹犵殑瀹炵幇錛屽畠鐨勮璁$洰鏍囨槸鎻愪緵涓涓綋鍓嶆渶濂界殑鏁版嵁搴撹繛鎺ユ睜錛屽湪鎬ц兘銆佹墿灞曟х瓑鏂歸潰鍙栧緱鏈鍚堥傜殑騫寵 錛屽彇浠BCP銆丆3P0絳夎繛鎺ユ睜銆?/p>

  • 楂樻ц兘銆傛祴璇曟暟鎹〃鏄庯紝Druid姣擠BCP銆丆3P0銆丅oneCP鐨勬ц兘閮藉ソ寰堝銆傚叿浣撹鐪?u>嫻嬭瘯鏁版嵁
  • 鍙鐞嗘э紝DruidDataSource鏈韓鎻愪緵浜嗗緢澶氱洃鎺у睘鎬э紝鍏蜂綋鐪?u>榪欓噷銆侱ruidDataSource鏀寔StatFilter錛屽叿浣撻厤緗湅 榪欓噷
  • 鍙墿灞曟э紝鎻愪緵鍩轟簬Filter-Chain妯″紡鐨勬墿灞曟満鍒躲傚叿浣撹嚜瀹氫箟鎵╁睍鐨勪緥瀛愮湅榪欓噷銆?/div>
  • 鏇挎崲DBCP錛岄厤緗拰DBCP鍏煎錛屽彲浠ユ柟渚挎浛鎹BCP銆?/div>
  • 閫傚悎澶ц妯″簲鐢ㄣ傜粨鍚圓libaba浣跨敤鏁版嵁搴撹繛鎺ユ睜鐨勭粡楠岋紝閬垮厤涓浜涘凡鐭ラ棶棰橈紝渚嬪鏁版嵁搴撲笉鍙敤鎭㈠涔嬪悗浜х敓鐨勮繛鎺ラ鏆撮棶棰樼瓑銆?/div>

璁捐

榪欐槸DruidDataSource鐨勮璁″浘紺猴細
http://code.alibabatech.com/svn/druid/trunk/doc/druid-pool.txt
濡傛灉鍙戠幇鏈変貢鐮侊紝璇烽夋嫨utf-8鐨勭紪鐮佹柟寮忔煡鐪嬨?/p>

Druid鎻愪緵涓涓墜宸ョ紪鍐欑殑楂樻ц兘鐨勬柟渚挎墿灞曠殑SQL Parser銆傚皢浼氭敮鎸丮ySQL銆丱racle絳夋祦琛屽叧緋繪暟鎹簱鐨凷QL Parser銆?/p>

Parser緇勪歡鍖呮嫭濡備笅鍑犱釜閮ㄥ垎錛?/p>

  • Lexer 璇嶆硶瑙f瀽
  • Parser錛孭arser鍖呮嫭ExprParser錛屽悇縐峉tatementParser銆?/div>
  • AST, Abstract Syntax Tree銆侾arserParse鍑烘潵鐨勭粨鏋滃氨鏄疉ST銆?/div>
  • Visitor銆傚AST鍋氬悇縐嶅鐞嗭紝姣斿FormatOutput錛岄亶鍘嗙瓑絳夈?/div>

綆浠?/h3>

 

Druid鎻愪緵浜嗗己澶х殑鐩戞帶鍔熻兘錛岃兘澶熺洃鎺ц繛鎺ユ睜琛屼負鍜孲QL鎵ц鎯呭喌錛岃浣犺兘澶熻緇嗕簡瑙e簲鐢ㄧ殑鏁版嵁搴撹闂涓恒?/p>

鐩戞帶瀵硅薄

  • Druid鐨勭粺璁′俊鎭畾涔変唬鐮佸疄鐜板湪com/alibaba/druid/stat涓嬨傛墍鏈夌殑Stat閮藉叏灞闈欐佸彉閲忕殑鏂瑰紡淇濆瓨錛岃繖鏍峰仛浣垮緱澶栭儴鑾峰彇鐩戞帶淇℃伅鏇村鏄撱?/div>
  • 鑾峰彇Druid鐩戞帶淇℃伅鐨勫叆鍙f槸com.alibaba.druid.stat.JdbcStatManager
  • Druid鐨勭洃鎺х粺璁′俊鎭兘鏄氳繃StatFilter鏉ュ疄鐜扮殑錛屽鏋滀綘闇瑕佹暟鎹簮榪涜鐩戞帶錛岄偅浣犻渶瑕佸惎鐢⊿tatFilter
 


]]>
spring 鐩稿叧緗戠珯浠嬬粛http://www.tkk7.com/huamengxing/archive/2017/03/19/432385.html鍗庢ⅵ琛?/dc:creator>鍗庢ⅵ琛?/author>Sun, 19 Mar 2017 14:39:00 GMThttp://www.tkk7.com/huamengxing/archive/2017/03/19/432385.htmlhttp://www.tkk7.com/huamengxing/comments/432385.htmlhttp://www.tkk7.com/huamengxing/archive/2017/03/19/432385.html#Feedback0http://www.tkk7.com/huamengxing/comments/commentRss/432385.htmlhttp://www.tkk7.com/huamengxing/services/trackbacks/432385.html http://spring.io/tools/sts http://www.loveweir.com/posts/view/19
https://github.com/rahulyewale/springmvcjpa
http://download.csdn.net/download/jiuqiyuliang/8640621
http://blog.csdn.net/suzunshou/article/details/49949005
https://repo1.maven.org/maven2/org/mybatis/mybatis/
http://blog.csdn.net/jiuqiyuliang/article/details/45132493/
https://github.com/mybatis/generator/releases

]]>
mysql瀵煎叆涔辯爜http://www.tkk7.com/huamengxing/archive/2016/07/21/431269.html鍗庢ⅵ琛?/dc:creator>鍗庢ⅵ琛?/author>Thu, 21 Jul 2016 05:33:00 GMThttp://www.tkk7.com/huamengxing/archive/2016/07/21/431269.htmlhttp://www.tkk7.com/huamengxing/comments/431269.htmlhttp://www.tkk7.com/huamengxing/archive/2016/07/21/431269.html#Feedback0http://www.tkk7.com/huamengxing/comments/commentRss/431269.htmlhttp://www.tkk7.com/huamengxing/services/trackbacks/431269.html浠婂ぉ浠巜indows涓婂鍑轟竴涓猻ql鎵ц鏂囦歡錛屽啀鍊掑叆鍒皍nbutn涓紝緇撴灉鍑虹幇涔辯爜錛屾姌鑵?-8鍒嗛挓錛?nbsp;
瑙e喅鏂瑰紡 
鍦ㄥ鍑簃ysql sql鎵ц鏂囦歡鐨勬椂鍊欙紝鎸囧畾涓涓嬬紪鐮佹牸寮忥細 
澶嶅埗浠g爜 浠g爜濡備笅:
mysqldump -uroot -p --default-character-set=utf8 mo錛坉bname錛?> E://xxxx.sql 
瀵煎叆鐨勬椂鍊橭K浜?nbsp;
鎵ц濡備笅 
澶嶅埗浠g爜 浠g爜濡備笅:
mysql -u root -p --default-character-set=utf8 
use dbname 
source /root/newsdata.sql 


]]>
yum 婧愭洿鏂?/title><link>http://www.tkk7.com/huamengxing/archive/2016/06/27/431029.html</link><dc:creator>鍗庢ⅵ琛?/dc:creator><author>鍗庢ⅵ琛?/author><pubDate>Mon, 27 Jun 2016 09:42:00 GMT</pubDate><guid>http://www.tkk7.com/huamengxing/archive/2016/06/27/431029.html</guid><wfw:comment>http://www.tkk7.com/huamengxing/comments/431029.html</wfw:comment><comments>http://www.tkk7.com/huamengxing/archive/2016/06/27/431029.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/huamengxing/comments/commentRss/431029.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/huamengxing/services/trackbacks/431029.html</trackback:ping><description><![CDATA[<h1></h1><div></div><div>CentOS</div><div></div><div></div><div>1銆佸浠?/div><div></div><div>mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup </div><div></div><div>2銆佷笅杞芥柊鐨凜entOS-Base.repo 鍒?etc/yum.repos.d/</div><div></div><div></div><div></div><div>CentOS 5</div><div> wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo  </div><div></div><div></div><div></div><div>CentOS 6</div><div> wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo  </div><div></div><div></div><div></div><div>CentOS 7</div><div> wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo  </div><div></div><div>3銆佷箣鍚庤繍琛寉um makecache鐢熸垚緙撳瓨</div><div></div><div>鐩稿叧閾炬帴</div><div>##瀹樻柟涓婚〉: http://www.centos.org/</div><div>##閭歡鍒楄〃: http://www.centos.org/modules/tinycontent/index.php?id=16</div><div>##璁哄潧: http://www.centos.org/modules/newbb/</div><div>##鏂囨。: http://www.centos.org/docs/</div><div>##Wiki: http://wiki.centos.org/</div><div></div><div><ul><li><a ></a></li></ul></div><img src ="http://www.tkk7.com/huamengxing/aggbug/431029.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/huamengxing/" target="_blank">鍗庢ⅵ琛?/a> 2016-06-27 17:42 <a href="http://www.tkk7.com/huamengxing/archive/2016/06/27/431029.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>杈撳叆鏁版嵁榪涜姝f佸寲http://www.tkk7.com/huamengxing/archive/2016/05/11/430448.html鍗庢ⅵ琛?/dc:creator>鍗庢ⅵ琛?/author>Wed, 11 May 2016 10:27:00 GMThttp://www.tkk7.com/huamengxing/archive/2016/05/11/430448.htmlhttp://www.tkk7.com/huamengxing/comments/430448.htmlhttp://www.tkk7.com/huamengxing/archive/2016/05/11/430448.html#Feedback0http://www.tkk7.com/huamengxing/comments/commentRss/430448.htmlhttp://www.tkk7.com/huamengxing/services/trackbacks/430448.html

瀵硅緭鍏ユ暟鎹繘琛屾鎬佸寲

 

涓轟簡浣跨緇忕綉緇滄湁鏁堬紝鎴戜滑蹇呴』瀵規暟鎹繘琛屾鎬佸寲銆傝繖鏄縺媧誨嚱鏁扮殑姝g‘璁$畻鎵闇瑕佺殑銆傛鎬佸寲鏄竴縐嶆暟瀛﹀鐞嗭紝灝嗘暟鎹漿鎹負 0..1 鎴?-1..1 鐨勮寖鍥淬傛鎬佸寲鍚庣殑鏁版嵁鍙互榪涜鍘繪鎬佸寲錛屽嵆杞崲鍥炲師鏉ョ殑鑼冨洿銆?br />

瑕佸皢紲炵粡緗戠粶杈撳嚭瑙g爜涓轟漢綾誨彲璇葷殑褰㈠紡錛岄渶瑕佸鏁版嵁榪涜鍘繪鎬佸寲銆傝阿澶╄阿鍦幫紝璐熻矗鏍囧噯鍖栧拰鍘繪爣鍑嗗寲錛屽洜姝や笉闇瑕佸疄鏂藉畠銆傚鏋滄偍瀵瑰畠鐨勫伐浣滃師鐞嗘劅鍒板ソ濂囷紝鎮ㄥ彲浠ュ垎鏋愪互涓嬩唬鐮侊細  


public static double INPUT_LOW = -20;
    public static double INPUT_HIGH = 20;
    public static double OUTPUT_HIGH = 1;
    public static double OUTPUT_LOW = -1;
    public static double normalize(final double value) {
        return ((value - INPUT_LOW) / (INPUT_HIGH - INPUT_LOW))
                * (OUTPUT_HIGH - OUTPUT_LOW) + OUTPUT_LOW;
        // return ((10f + 20f) / (40f)) * (2f) + OUTPUT_LOW;
    }
    public static double deNormalize(final double data) {
        double result = ((INPUT_LOW - INPUT_HIGH) * data - OUTPUT_HIGH
                * INPUT_LOW + INPUT_HIGH * OUTPUT_LOW)
                / (OUTPUT_LOW - OUTPUT_HIGH);
        return result;
    }

x=-5:.01:5;
   plot(x,tanh(x)),grid on;


]]>
cron4j浣跨敤璇存槑http://www.tkk7.com/huamengxing/archive/2016/05/07/430392.html鍗庢ⅵ琛?/dc:creator>鍗庢ⅵ琛?/author>Sat, 07 May 2016 07:39:00 GMThttp://www.tkk7.com/huamengxing/archive/2016/05/07/430392.htmlhttp://www.tkk7.com/huamengxing/comments/430392.htmlhttp://www.tkk7.com/huamengxing/archive/2016/05/07/430392.html#Feedback0http://www.tkk7.com/huamengxing/comments/commentRss/430392.htmlhttp://www.tkk7.com/huamengxing/services/trackbacks/430392.html1. Quickstart

The cron4j main entity is the scheduler. With a it.sauronsoftware.cron4j.Scheduler instance you can execute tasks at fixed moments, during all the year. A scheduler can execute a task once a minute, once every five minutes, Friday at 10:00, on February the 16th at 12:30 but only if it is Saturday, and so on.

The use of the cron4j scheduler is a four steps operation:

  1. Create your Scheduler instance.
  2. Schedule your actions. To schedule an action you have to tell the scheduler what it has to do and when. You can specify what using a java.lang.Runnable or a it.sauronsoftware.cron4j.Task instance, and you can specify when using a scheduling pattern, which can be represented with a string or with a it.sauronsoftware.cron4j.SchedulingPattern instance.
  3. Starts the scheduler.
  4. Stops the scheduler, when you don't need it anymore.

Consider this simple example:

import it.sauronsoftware.cron4j.Scheduler;  public class Quickstart {  	public static void main(String[] args) { 		// Creates a Scheduler instance. 		Scheduler s = new Scheduler(); 		// Schedule a once-a-minute task. 		s.schedule("* * * * *", new Runnable() { 			public void run() { 				System.out.println("Another minute ticked away..."); 			} 		}); 		// Starts the scheduler. 		s.start(); 		// Will run for ten minutes. 		try { 			Thread.sleep(1000L * 60L * 10L); 		} catch (InterruptedException e) { 			; 		} 		// Stops the scheduler. 		s.stop(); 	}  }

This example runs for ten minutes. At every minute change it will print the sad (but true) message "Another minute ticked away...".

Some other key concepts:

  • You can schedule how many tasks you want.
  • You can schedule a task when you want, also after the scheduler has been started.
  • You can change the scheduling pattern of an already scheduled task, also while the scheduler is running (reschedule operation).
  • You can remove a previously scheduled task, also while the scheduler is running (deschedule operation).
  • You can start and stop a scheduler how many times you want.
  • You can schedule from a file.
  • You can schedule from any source you want.
  • You can supply listeners to the scheduler in order to receive events about the executed task.
  • You can control any ongoing task.
  • You can manually launch a task, without using a scheduling pattern.
  • You can change the scheduler working Time Zone.
  • You can validate your scheduling patterns before using them with the scheduler.
  • You can predict when a scheduling pattern will cause a task execution.

Back to index

2. Scheduling patterns

A UNIX crontab-like pattern is a string split in five space separated parts. Each part is intended as:

  1. Minutes sub-pattern. During which minutes of the hour should the task been launched? The values range is from 0 to 59.
  2. Hours sub-pattern. During which hours of the day should the task been launched? The values range is from 0 to 23.
  3. Days of month sub-pattern. During which days of the month should the task been launched? The values range is from 1 to 31. The special value "L" can be used to recognize the last day of month.
  4. Months sub-pattern. During which months of the year should the task been launched? The values range is from 1 (January) to 12 (December), otherwise this sub-pattern allows the aliases "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov" and "dec".
  5. Days of week sub-pattern. During which days of the week should the task been launched? The values range is from 0 (Sunday) to 6 (Saturday), otherwise this sub-pattern allows the aliases "sun", "mon", "tue", "wed", "thu", "fri" and "sat".

The star wildcard character is also admitted, indicating "every minute of the hour", "every hour of the day", "every day of the month", "every month of the year" and "every day of the week", according to the sub-pattern in which it is used.

Once the scheduler is started, a task will be launched when the five parts in its scheduling pattern will be true at the same time.

Scheduling patterns can be represented with it.sauronsoftware.cron4j.SchedulingPattern instances. Invalid scheduling patterns are cause of it.sauronsoftware.cron4j.InvalidPatternExceptions. The SchedulingPattern class offers also a static validate(String) method, that can be used to validate a string before using it as a scheduling pattern.

Some examples:

5 * * * *
This pattern causes a task to be launched once every hour, at the begin of the fifth minute (00:05, 01:05, 02:05 etc.).

* * * * *
This pattern causes a task to be launched every minute.

* 12 * * Mon
This pattern causes a task to be launched every minute during the 12th hour of Monday.

* 12 16 * Mon
This pattern causes a task to be launched every minute during the 12th hour of Monday, 16th, but only if the day is the 16th of the month.

Every sub-pattern can contain two or more comma separated values.

59 11 * * 1,2,3,4,5
This pattern causes a task to be launched at 11:59AM on Monday, Tuesday, Wednesday, Thursday and Friday.

Values intervals are admitted and defined using the minus character.

59 11 * * 1-5
This pattern is equivalent to the previous one.

The slash character can be used to identify step values within a range. It can be used both in the form */c and a-b/c. The subpattern is matched every c values of the range 0,maxvalue or a-b.

*/5 * * * *
This pattern causes a task to be launched every 5 minutes (0:00, 0:05, 0:10, 0:15 and so on).

3-18/5 * * * *
This pattern causes a task to be launched every 5 minutes starting from the third minute of the hour, up to the 18th (0:03, 0:08, 0:13, 0:18, 1:03, 1:08 and so on).

*/15 9-17 * * *
This pattern causes a task to be launched every 15 minutes between the 9th and 17th hour of the day (9:00, 9:15, 9:30, 9:45 and so on... note that the last execution will be at 17:45).

All the fresh described syntax rules can be used together.

* 12 10-16/2 * *
This pattern causes a task to be launched every minute during the 12th hour of the day, but only if the day is the 10th, the 12th, the 14th or the 16th of the month.

* 12 1-15,17,20-25 * *
This pattern causes a task to be launched every minute during the 12th hour of the day, but the day of the month must be between the 1st and the 15th, the 20th and the 25, or at least it must be the 17th.

Finally cron4j lets you combine more scheduling patterns into one, with the pipe character:

0 5 * * *|8 10 * * *|22 17 * * *
This pattern causes a task to be launched every day at 05:00, 10:08 and 17:22.

Back to index

3. How to schedule, reschedule and deschedule a task

The simplest manner to build a task is to implement the well-known java.lang.Runnable interface. Once the task is ready, it can be scheduled with the it.sauronsoftware.cron4j.Scheduler.schedule(String, Runnable) method. This method throws an it.sauronsoftware.cron4j.InvalidPatternException when the supplied string does not represent a valid scheduling pattern.

Another way to build a task is to extend the it.sauronsoftware.cron4j.Task abstract class, which is more powerful and let the developer access some other cron4j features. This is better discussed in the "Building your own task" paragraph. Task instances can be scheduled with the schedule(String, Task) and the schedule(SchedulingPattern, Task) methods.

Scheduling methods available in the scheduler always return an ID used to recognize and retrieve the scheduled operation. This ID can be used later to reschedule the task (changing its scheduling pattern) with the reschedule(String, String) or the reschedule(String, SchedulingPattern) methods, and to deschedule the task (remove the task from the scheduler) with the deschedule(String) method.

The same ID can also be used to retrieve the scheduling pattern associated with a scheduled task, with the getSchedulingPattern(String) method, or to retrieve the task itself, with the getTask(String) method.

Back to index

4. How to schedule a system process

System processes can be easily scheduled using the ProcessTask class:

ProcessTask task = new ProcessTask("C:\\Windows\\System32\\notepad.exe"); Scheduler scheduler = new Scheduler(); scheduler.schedule("* * * * *", task); scheduler.start(); // ... 

Arguments for the process can be supplied by using a string array instead of a single command string:

String[] command = { "C:\\Windows\\System32\\notepad.exe", "C:\\File.txt" }; ProcessTask task = new ProcessTask(command); // ...

Environment variables for the process can be supplied using a second string array, whose elements have to be in the NAME=VALUE form:

String[] command = { "C:\\tomcat\\bin\\catalina.bat", "start" }; String[] envs = { "CATALINA_HOME=C:\\tomcat", "JAVA_HOME=C:\\jdks\\jdk5" }; ProcessTask task = new ProcessTask(command, envs); // ...

The default working directory for the process can be changed using a third parameter in the constructor:

String[] command = { "C:\\tomcat\\bin\\catalina.bat", "start" }; String[] envs = { "CATALINA_HOME=C:\\tomcat", "JAVA_HOME=C:\\jdks\\jdk5" }; File directory = "C:\\MyDirectory"; ProcessTask task = new ProcessTask(command, envs, directory); // ...

If you want to change the default working directory but you have not any environment variable, the envs parameter of the constructor can be set to null:

ProcessTask task = new ProcessTask(command, null, directory);

When envs is null the process inherits every environment variable of the current JVM:

Environment variables and the working directory can also be set by calling the setEnvs(String[]) and setDirectory(java.io.File) methods.

The process standard output and standard error channels can be redirected to files by using the setStdoutFile(java.io.File) and setStderrFile(java.io.File) methods:

ProcessTask task = new ProcessTask(command, envs, directory); task.setStdoutFile(new File("out.txt")); task.setStderrFile(new File("err.txt"));

In a siminal manner, the standard input channel can be read from an existing file, calling the setStdinFile(java.io.File) method:

ProcessTask task = new ProcessTask(command, envs, directory); task.setStdinFile(new File("in.txt"));

5. How to schedule processes from a file

The cron4j scheduler can also schedule a set of processes from a file.

You have to prepare a file, very similar to the ones used by the UNIX crontab, and register it in the scheduler calling the scheduleFile(File) method. The file can be descheduled by calling the descheduleFile(File) method. Scheduled files can be retrieved by calling the getScheduledFiles() method.

Scheduled files are parsed every minute. The scheduler will launch every process declared in the file whose scheduling pattern matches the current system time.

Syntax rules for cron4j scheduling files are reported in the "Cron parser" paragraph.

Back to index

6. Building your own task

A java.lang.Runnable object is the simplest task ever possible, but to gain control you need to extend the it.sauronsoftware.cron4j.Task class. In the plainest form, implementing Runnable or extending Task are very similar operations: while the first requires a run() method, the latter requires the implementation of execute(TaskExecutionContext). The execute(TaskExecutionContext) method provides a it.sauronsoftware.cron4j.TaskExecutionContext instance, which the Runnable.run() method does not provide. The context can be used in the following ways:

A custom task can be scheduled, launched immediately or returned by a task collector.

Back to index

7. Building your own collector

You can build and plug within the scheduler your own task source, via the task collector API.

The cron4j scheduler supports the registration of one or more it.sauronsoftware.cron4j.TaskCollector instances, with the addTaskCollector(TaskCollector) method. Registered collectors can be retrieved with the scheduler getTaskCollectors() method. A previously registered collector can be removed from the scheduler with the removeTaskCollector(TaskCollector) method. Collectors can be added, queried or removed at every moment, also when the scheduler is started and it is running.

Each registered task collector is queried by the scheduler once a minute. The scheduler calls the collector getTasks() method. The implementation must return a it.sauronsoftware.cron4j.TaskTable instance. A TaskTable is a table that associates tasks and scheduling patterns. The scheduler, once the table has been retrieved, will examine the reported entries, and it will execute every task whose scheduling pattern matches the current system time.

A custom collector can be used to tie the scheduler with an external task source, i.e. a database or a XML file, which can be managed and changed in its contents also at run time.

Back to index

8. Building your own scheduler listener

The it.sauronsoftware.cron4j.SchedulerListener API can be used to listen to scheduler events.

The SchedulerListener interface requires the implementation of the following methods:

See the "

Once your SchedulerListener instance is ready, you can register it on a Scheduler object by calling its addSchedulerListener(SchedulerListener) method. Already registered listeners can be removed by calling the removeSchedulerListener(SchedulerListener) method. The scheduler can also give back any registered listener, with the getSchedulerListeners() method.

SchedulerListeners can be added and removed at every moment, also while the scheduler is running.

Back to index

9. Executors

The scheduler, once it has been started and it is running, can be queried to give back its executors. An executor is similar to a thread. Executors is used by the scheduler to execute tasks.

By calling the Scheduler.getExecutingTasks() method you can obtain the currently ongoing executors.

You can also obtain an executor through a SchedulerListener instance (see the "Building your own scheduler listener" paragraph).

Each executor, represented by a it.sauronsoftware.cron4j.TaskExecutor instance, performs a different task execution.

The task can be retrieved with the getTask() method.

The executor status can be checked with the isAlive() method: it returns true if the executor is currently running.

If the executor is running, the current thread can be paused until the execution will be completed, calling the join() method.

The supportsStatusTracking() method returns true if the currently executing task supports status tracking. It means that the task communicates to the executor its status, represented by a string. The current status message can be retrieved by calling the executor getStatusMessage() method.

The supportsCompletenessTracking() method returns true if the currently executing task supports completeness tracking. It means that the task communicates to the executor its own completeness level. The current completeness level can be retrieved by calling the executor getCompleteness() method. Returned values are between 0 (task just started and still nothing done) and 1 (task completed).

The canBePaused() method returns true if the currently executing task supports execution pausing. It means that the task execution can be paused by calling the executor pause() method. The pause status of the executor can be checked with the isPaused() method. A paused executor can be resumed by calling its resume() method.

The canBeStopped() method returns true if the currently executing task supports execution interruption. It means that the task execution can be stopped by calling the executor stop() method. The interruption status of the executor can be checked with the isStopped() method. Stopped executors cannot be resumed.

The getStartTime() method returns a time stamp reporting the start time of the executor, or a value less than 0 if the executor has not been yet started.

The getScheduler() method returns the scheduler which is the owner of the executor.

The getGuid() method returns a textual GUID for the executor.

Executors offer also an event-driven API, through the it.sauronsoftware.cron4j.TaskExecutorListener class. A TaskExecutorListener can be added to a TaskExecutor with its addTaskExecutorListener(TaskExecutorListener) method. Listeners can be removed with the removeTaskExecutorListener(TaskExecutorListener) method, and they can also be retrieved with the getTaskExecutorListeners() method. A TaskExecutorListener must implement the following methods:

  • executionPausing(TaskExecutor)
    Called when the executor is requested to pause the ongoing task. The given parameter represents the source TaskExecutor instance.

  • executionResuming(TaskExecutor)
    Called when the executor is requested to resume the execution of the previously paused task. The given parameter represents the source TaskExecutor instance.

  • executionStopping(TaskExecutor)
    Called when the executor is requested to stop the task execution. The given parameter represents the source TaskExecutor instance.

  • executionTerminated(TaskExecutor, Throwable)
    Called when the executor has completed the task execution. The first parameter represents the source TaskExecutor instance, while the second is the optional exception that has caused the task to be terminated. If the task has been completed successfully, the given value is null.

  • statusMessageChanged(TaskExecutor, String)
    Called every time the execution status message changes. The first parameter represents the source TaskExecutor instance, while the second is the new message issued by the task.

  • completenessValueChanged(TaskExecutor, double)
    Called every time the execution completeness value changes. The first parameter represents the source TaskExecutor instance, while the second is the new completeness value (between 0 and 1) issued by the task.

Back to index

10. Manual task launch

If the scheduler is started and running, it is possible to manually launch a task, without scheduling it with a pattern. The method is Scheduler.launch(Task). The task will be immediately launched, and a TaskExecutor instace is returned to the caller. The returned object can be used to control the task execution (see the "

Back to index

11. Working with Time Zones

Scheduler instances, by default, work with the system default Time Zone. I.e. a scheduling pattern whose value is 0 2 * * * will activate its task at 02:00 AM according to the default system Time Zone. The scheduler can be requested to work with a different Time Zone, which is not the system default one. Call Scheduler.setTimeZone(TimeZone) and Scheduler.getTimeZone() to control this feature.

Once the default Time Zone has been changed, system current time is adapted to the supplied zone before comparing it with registered scheduling patterns. The result is that any supplied scheduling pattern is treated according to the specified Time Zone. Suppose this situation:

  • System time: 10:00
  • System time zone: GMT+1
  • Scheduler time zone: GMT+3

The scheduler, before comparing system time with patterns, translates 10:00 from GMT+1 to GMT+3. It means that 10:00 becomes 12:00. The resulted time is then used by the scheduler to activate tasks. So, in the given configuration at the given moment, any task scheduled as 0 12 * * * will be executed, while any 0 10 * * * will not.

Back to index

12. Daemon threads

The Java Virtual Machine exits when the only threads running are all daemon threads. The cron4j scheduler can be configured to spawn only daemon threads. To control this feature call the Scheduler.setDaemon(boolean) method. This method must be called before the scheduler is started. Default value is false. To check the scheduler current daemon status call the Scheduler.isDaemon() method.

Back to index

13. Predictor

The it.sauronsoftware.cron4j.Predictor class is able to predict when a scheduling pattern will be matched.

Suppose you want to know when the scheduler will execute a task scheduled with the pattern 0 3 * jan-jun,sep-dec mon-fri. You can predict the next n execution of the task using a Predictor instance:

String pattern = "0 3 * jan-jun,sep-dec mon-fri"; Predictor p = new Predictor(pattern); for (int i = 0; i < n; i++) { 	System.out.println(p.nextMatchingDate()); }

Back to index

14. Cron parser

The it.sauronsoftware.cron4j.CronParser class can be used to parse crontab-like formatted file and character streams.

If you want to schedule a list of tasks declared in a crontab-like file you don't need the CronParser, since you can do it by adding the file to the scheduler, with the Scheduler.scheduleFile(File) method.

Consider to use the CronParser if the Scheduler.scheduleFile(File) method is not enough for you. In example, you may need to fetch the task list from a remote source which is not representable as a java.io.File object (a document on a remote server, a DBMS result set and so on). To solve the problem you can implement your own it.sauronsoftware.cron4j.TaskCollector, getting the advantage of the CronParser to easily parse any crontab-like content.

You can parse a whole file/stream, but you can also parse a single line.

A line can be empty, can contain a comment or it can be a scheduling line.

A line containing no characters or a line with only space characters is considered an empty line.

A line whose first non-space character is a number sign (#) is considered a comment.

Empty lines and comment lines are ignored by the parser.

Any other kind of line is parsed as a scheduling line.

A valid scheduling line respects the following structure:

scheduling-pattern [options] command [args]
  • scheduling-pattern is a valid scheduling pattern, according with the definition given by the it.sauronsoftware.cron4j.SchedulingPattern class.
  • options is a list of optional information used by cron4j to prepare the task execution environment. See below for a more detailed description.
  • command is a system valid command, such an executable call.
  • args is a list of optional arguments for the command.

After the scheduling pattern item, other tokens in each line are space separated or delimited with double quotation marks (").

Double quotation marks delimited items can take advantage of the following escape sequences:

  • \" - quotation mark
  • \\ - back slash
  • \/ - slash
  • \b - back space
  • \f - form feed
  • \n - new line
  • \r - carriage return
  • \t - horizontal tab
  • \ufour-hex-digits - the character at the given Unicode index

The options token collection can include one or more of the following elements:

  • IN:file-path - Redirects the command standard input channel to the specified file.
  • OUT:file-path - Redirects the command standard output channel to the specified file.
  • ERR:file-path - Redirects the command standard error channel to the specified file.
  • ENV:name=value - Defines an environment variable in the scope of the command.
  • DIR:directory-path - Sets the path of the working directory for the command. This feature is not supported if the executing JVM is less than 1.3.

It is also possible to schedule the invocation of a method of a Java class in the scope of the parser ClassLoader. The method has to be static and it must accept an array of strings as its sole argument. To invoke a method of this kind the syntax is:

scheduling-pattern java:className#methodName [args]

The #methodName part can be omitted: in this case the main(String[]) method will be assumed.

Please note that static methods are invoked within the scheduler same JVM, without spawning any external process. Thus IN, OUT, ERR, ENV and DIR options can't be applied.

Invalid scheduling lines are discarded without blocking the parsing procedure, but an error message is sent to the application standard error channel.

Valid examples:

0 5 * * * sol.exe 0,30 * * * * OUT:C:\ping.txt ping 10.9.43.55 0,30 4 * * * "OUT:C:\Documents and Settings\Carlo\ping.txt" ping 10.9.43.55 0 3 * * * ENV:JAVA_HOME=C:\jdks\1.4.2_15 DIR:C:\myproject OUT:C:\myproject\build.log C:\myproject\build.bat "Nightly Build" 0 4 * * * java:mypackage.MyClass#startApplication myOption1 myOption2


]]>
闃塊噷浜慙inux瀹夎杞歡闀滃儚婧?/title><link>http://www.tkk7.com/huamengxing/archive/2016/04/30/430316.html</link><dc:creator>鍗庢ⅵ琛?/dc:creator><author>鍗庢ⅵ琛?/author><pubDate>Sat, 30 Apr 2016 13:11:00 GMT</pubDate><guid>http://www.tkk7.com/huamengxing/archive/2016/04/30/430316.html</guid><wfw:comment>http://www.tkk7.com/huamengxing/comments/430316.html</wfw:comment><comments>http://www.tkk7.com/huamengxing/archive/2016/04/30/430316.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/huamengxing/comments/commentRss/430316.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/huamengxing/services/trackbacks/430316.html</trackback:ping><description><![CDATA[<p style="padding: 0px; margin-top: 0px; margin-right: 0px; margin-left: 0px; border: 0px; text-align: justify; word-wrap: break-word; word-break: break-all; text-indent: 2em; color: #444444; font-family: 'Microsoft YaHei', 寰蔣闆呴粦, Helvetica, Arial, 'Lucida Grande', Tahoma, sans-serif; line-height: 22px; background-color: #ffffff;"><span style="padding: 0px; margin: 0px; text-indent: 2em;">闃塊噷浜慙inux瀹夎杞歡闀滃儚婧?/span></p><p style="padding: 0px; margin-top: 0px; margin-right: 0px; margin-left: 0px; border: 0px; text-align: justify; word-wrap: break-word; word-break: break-all; text-indent: 2em; color: #444444; font-family: 'Microsoft YaHei', 寰蔣闆呴粦, Helvetica, Arial, 'Lucida Grande', Tahoma, sans-serif; line-height: 22px; background-color: #ffffff;">闃塊噷浜戞槸鏈榪戞柊鍑虹殑涓涓暅鍍忔簮銆傚緱鐩婁笌闃塊噷浜戠殑楂橀熷彂灞曪紝榪欎箞澶х殑闇姹傦紝鑲畾浼氭帹鍑鴻嚜宸辯殑闀滃儚婧愩?br style="padding: 0px; margin: 0px;" />闃塊噷浜慙inux瀹夎闀滃儚婧愬湴鍧錛歨ttp://mirrors.aliyun.com/</p><p style="padding: 0px; margin-top: 0px; margin-right: 0px; margin-left: 0px; border: 0px; text-align: justify; word-wrap: break-word; word-break: break-all; text-indent: 2em; color: #444444; font-family: 'Microsoft YaHei', 寰蔣闆呴粦, Helvetica, Arial, 'Lucida Grande', Tahoma, sans-serif; line-height: 22px; background-color: #ffffff;">CentOS緋葷粺鏇存崲杞歡瀹夎婧?br style="padding: 0px; margin: 0px;" />絎竴姝ワ細澶囦喚浣犵殑鍘熼暅鍍忔枃浠訛紝浠ュ厤鍑洪敊鍚庡彲浠ユ仮澶嶃?/p><p style="padding: 0px; margin-top: 0px; margin-right: 0px; margin-left: 0px; border: 0px; text-align: justify; word-wrap: break-word; word-break: break-all; text-indent: 2em; color: #444444; font-family: 'Microsoft YaHei', 寰蔣闆呴粦, Helvetica, Arial, 'Lucida Grande', Tahoma, sans-serif; line-height: 22px; background-color: #ffffff;">mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup<br style="padding: 0px; margin: 0px;" />絎簩姝ワ細涓嬭澆鏂扮殑CentOS-Base.repo 鍒?etc/yum.repos.d/<br style="padding: 0px; margin: 0px;" />CentOS 5</p><p style="padding: 0px; margin-top: 0px; margin-right: 0px; margin-left: 0px; border: 0px; text-align: justify; word-wrap: break-word; word-break: break-all; text-indent: 2em; color: #444444; font-family: 'Microsoft YaHei', 寰蔣闆呴粦, Helvetica, Arial, 'Lucida Grande', Tahoma, sans-serif; line-height: 22px; background-color: #ffffff;">wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo<br style="padding: 0px; margin: 0px;" />CentOS 6</p><p style="padding: 0px; margin-top: 0px; margin-right: 0px; margin-left: 0px; border: 0px; text-align: justify; word-wrap: break-word; word-break: break-all; text-indent: 2em; color: #444444; font-family: 'Microsoft YaHei', 寰蔣闆呴粦, Helvetica, Arial, 'Lucida Grande', Tahoma, sans-serif; line-height: 22px; background-color: #ffffff;">wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo<br style="padding: 0px; margin: 0px;" />絎笁姝ワ細榪愯yum makecache鐢熸垚緙撳瓨</p><p style="padding: 0px; margin-top: 0px; margin-right: 0px; margin-left: 0px; border: 0px; text-align: justify; word-wrap: break-word; word-break: break-all; text-indent: 2em; color: #444444; font-family: 'Microsoft YaHei', 寰蔣闆呴粦, Helvetica, Arial, 'Lucida Grande', Tahoma, sans-serif; line-height: 22px; background-color: #ffffff;">yum clean all</p><p style="padding: 0px; margin-top: 0px; margin-right: 0px; margin-left: 0px; border: 0px; text-align: justify; word-wrap: break-word; word-break: break-all; text-indent: 2em; color: #444444; font-family: 'Microsoft YaHei', 寰蔣闆呴粦, Helvetica, Arial, 'Lucida Grande', Tahoma, sans-serif; line-height: 22px; background-color: #ffffff;">yum makecache</p><img src ="http://www.tkk7.com/huamengxing/aggbug/430316.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/huamengxing/" target="_blank">鍗庢ⅵ琛?/a> 2016-04-30 21:11 <a href="http://www.tkk7.com/huamengxing/archive/2016/04/30/430316.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鏈嶅姟鍣ㄥ垵濮嬪畨瑁?/title><link>http://www.tkk7.com/huamengxing/archive/2016/03/23/429781.html</link><dc:creator>鍗庢ⅵ琛?/dc:creator><author>鍗庢ⅵ琛?/author><pubDate>Wed, 23 Mar 2016 07:15:00 GMT</pubDate><guid>http://www.tkk7.com/huamengxing/archive/2016/03/23/429781.html</guid><wfw:comment>http://www.tkk7.com/huamengxing/comments/429781.html</wfw:comment><comments>http://www.tkk7.com/huamengxing/archive/2016/03/23/429781.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.tkk7.com/huamengxing/comments/commentRss/429781.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/huamengxing/services/trackbacks/429781.html</trackback:ping><description><![CDATA[<div> yum -y update</div><div></div><div></div><div></div><div></div><div>centos6 mysql5.5 yum瀹夎</div><div></div><div>  </div><div></div><div> </div><div>榛樿浣跨敤centos yum瀹夎鐨刴ysql涓嶆槸5.5鐗堟湰鐨勶紝鎴戜滑闇瑕佸鍔犱袱涓柊鐨剅epo</div><div></div><div>rpm -Uvh http://mirror.steadfast.net/epel/6/i386/epel-release-6-8.noarch.rpm</div><div></div><div>rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm</div><div></div><div>centos6涓媝hp php-fpm鐨剏um瀹夎</div><div></div><div>鏌ョ湅涓涓嬫槸涓嶆槸鏈塵ysql 5.5浜?/div><div></div><div>yum --enablerepo=remi,remi-test list mysql mysql-server</div><div></div><div>瀹夎mysql5.5</div><div></div><div>yum --enablerepo=remi,remi-test install mysql mysql-server</div><div></div><div>鍚姩mysql5.5</div><div></div><div>/etc/init.d/mysqld start</div><div></div><div>璁劇疆寮鏈哄惎鍔?/div><div></div><div>chkconfig --levels 345 mysqld on</div><div></div><div>瑕佸惎鐢∕ySQL 瀹夊叏璁劇疆璇瘋緭鍏ヤ互涓嬪懡浠?/div><div></div><div>/usr/bin/mysql_secure_installation<br /><br /><br /><p>CentOS/RHEL 7.x:</p><div><table><tbody><tr><td><pre>rpm <span style="color: #660033;">-Uvh</span> https:<span style="font-weight: bold;">//</span>dl.fedoraproject.org<span style="font-weight: bold;">/</span>pub<span style="font-weight: bold;">/</span>epel<span style="font-weight: bold;">/</span>epel-release-latest-7.noarch.rpm rpm <span style="color: #660033;">-Uvh</span> https:<span style="font-weight: bold;">//</span>mirror.webtatic.com<span style="font-weight: bold;">/</span>yum<span style="font-weight: bold;">/</span>el7<span style="font-weight: bold;">/</span>webtatic-release.rpm</pre></td></tr></tbody></table></div><p>CentOS/RHEL 6.x:</p><div><table><tbody><tr><td><pre>rpm <span style="color: #660033;">-Uvh</span> https:<span style="font-weight: bold;">//</span>dl.fedoraproject.org<span style="font-weight: bold;">/</span>pub<span style="font-weight: bold;">/</span>epel<span style="font-weight: bold;">/</span>epel-release-latest-6.noarch.rpm rpm <span style="color: #660033;">-Uvh</span> https:<span style="font-weight: bold;">//</span>mirror.webtatic.com<span style="font-weight: bold;">/</span>yum<span style="font-weight: bold;">/</span>el6<span style="font-weight: bold;">/</span>latest.rpm</pre></td></tr></tbody></table></div><p>CentOS/RHEL 5.x:</p><div><table><tbody><tr><td><pre>rpm <span style="color: #660033;">-Uvh</span> https:<span style="font-weight: bold;">//</span>dl.fedoraproject.org<span style="font-weight: bold;">/</span>pub<span style="font-weight: bold;">/</span>epel<span style="font-weight: bold;">/</span>epel-release-latest-5.noarch.rpm rpm <span style="color: #660033;">-Uvh</span> http:<span style="font-weight: bold;">//</span>mirror.webtatic.com<span style="font-weight: bold;">/</span>yum<span style="font-weight: bold;">/</span>el5<span style="font-weight: bold;">/</span>latest.rpm</pre></td></tr></tbody></table></div><p>Now you can install PHP 5.5’s mod_php SAPI (along with an opcode cache) by doing:</p><div><table><tbody><tr><td><pre><span style="color: #c20cb9; font-weight: bold;">yum install</span> php55w php55w-opcache</pre></td></tr></tbody></table></div><p>You can alternatively install PHP 5.5’s php-fpm SAPI (along with an opcode cache by doing:</p><br /><br /><br /><br /></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div>  rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm</div><div>  <br /><br /><div></div></div><div>rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm</div><div>rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm</div><div>濡傛灉鎯沖垹闄や笂闈㈠畨瑁呯殑鍖咃紝閲嶆柊瀹夎</div><div>rpm -qa | grep webstatic</div><div>rpm -e  涓婇潰鎼滅儲鍒扮殑鍖呭嵆鍙?/div><div></div><div>3.榪愯yum install</div><div>  yum install php55w php55w-cli php55w-common php55w-gd php55w-ldap php55w-mbstring php55w-mcrypt php55w-mysql php55w-pdo php55w-xml</div><div></div><div>yum install php56w php56w-cli php56w-common php56w-gd php56w-ldap php56w-mbstring php56w-mcrypt php56w-mysql php56w-pdo php56w-xml<br /><br />php 鍙﹀涓縐嶆柟寮?br /> Remi瀹樻柟緗戠珯錛歨ttp://rpms.famillecollet.com/<div></div><div>娣誨姞Remi婧愶紝涓嶇32浣嶈繕鏄?4浣嶇殑緋葷粺錛岃繍琛屼笅闈㈠懡浠わ細</div><div></div><div>rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm</div><div></div><div> Remi婧愰粯璁ゆ槸娌℃湁鍚敤鐨勶紝鎴戜滑鏉ュ惎鐢≧emi婧愶紝淇敼 /etc/yum.repos.d/remi.repo 鏂囦歡錛屾妸鏂囦歡鍐呯殑 enabled=0 鏀逛負 enabled=1 錛屾敞鎰忥細鏀規枃浠跺唴鏈?涓?enabled=0 鎴戜滑淇敼 [remi]涓嬮潰鐨勶紝涓嶈淇敼[remi-test]涓嬮潰鐨勩?/div><div></div><div> 鍒拌繖閲寉um婧愮殑閰嶇疆緇撴潫錛屼笅闈㈠畨瑁呰蔣浠跺氨綆鍗曚簡銆傚畨瑁呮椂鍊欐湁璇㈤棶y/n鐨勬椂鍊欓兘鏄痽</div><div></div><div>瀹夎php,php-fpm浠ュ強php鎵╁睍錛?/div><div></div><div>yum install php php-fpm php-bcmatch php-gd php-mbstring php-mcrypt php-mysql php-pdo   php-dom<br /><br /><br />wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.15/phpMyAdmin-4.0.10.15-english.zip<br /></div></div><div> </div><img src ="http://www.tkk7.com/huamengxing/aggbug/429781.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/huamengxing/" target="_blank">鍗庢ⅵ琛?/a> 2016-03-23 15:15 <a href="http://www.tkk7.com/huamengxing/archive/2016/03/23/429781.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://by4471.com" target="_blank">久久亚洲中文字幕精品一区四</a>| <a href="http://139699.com" target="_blank">永久免费看bbb</a>| <a href="http://6969xxoo.com" target="_blank">日本一区二区三区免费高清</a>| <a href="http://51huanxin.com" target="_blank">国产成人免费爽爽爽视频</a>| <a href="http://wyj4.com" target="_blank">日产乱码一卡二卡三免费</a>| <a href="http://htsp777.com" target="_blank">亚洲乱码中文字幕综合234</a>| <a href="http://msjdyd.com" target="_blank">亚洲综合av永久无码精品一区二区</a>| <a href="http://caoliusq1024.com" target="_blank">日韩精品亚洲aⅴ在线影院</a>| <a href="http://5r7b.com" target="_blank">亚洲色成人网一二三区</a>| <a href="http://51ruilon.com" target="_blank">亚洲精品无码不卡在线播放</a>| <a href="http://dd99com.com" target="_blank">免费人成大片在线观看播放</a>| <a href="http://918989b.com" target="_blank">两个人看www免费视频</a>| <a href="http://bbby6.com" target="_blank">91九色精品国产免费</a>| <a href="http://6969aaa.com" target="_blank">国产一区二区三区在线免费 </a>| <a href="http://wxbhnkyy39.com" target="_blank">免费看的黄色大片</a>| <a href="http://newbuybay.com" target="_blank">亚洲国产精品13p</a>| <a href="http://616kb.com" target="_blank">亚洲AV永久纯肉无码精品动漫</a>| <a href="http://18eeuus.com" target="_blank">亚洲大香伊人蕉在人依线</a>| <a href="http://w6446.com" target="_blank">真人无码作爱免费视频</a>| <a href="http://5g6z.com" target="_blank">精品国产污污免费网站</a>| <a href="http://woaianli.com" target="_blank">日韩吃奶摸下AA片免费观看</a>| <a href="http://ikybh.com" target="_blank">国产精品xxxx国产喷水亚洲国产精品无码久久一区 </a>| <a href="http://douhuowang.com" target="_blank">久久久精品免费视频</a>| <a href="http://963315.com" target="_blank">免费精品一区二区三区在线观看</a>| <a href="http://heifengmi.com" target="_blank">国产亚洲AV夜间福利香蕉149</a>| <a href="http://sdzhly.com" target="_blank">亚洲第一网站免费视频</a>| <a href="http://wangquanai.com" target="_blank">免费的黄网站男人的天堂</a>| <a href="http://246210.com" target="_blank">免费A级毛片无码A∨中文字幕下载 </a>| <a href="http://xxnxgay.com" target="_blank">青青草原1769久久免费播放</a>| <a href="http://h47h.com" target="_blank">毛片视频免费观看</a>| <a href="http://5666my.com" target="_blank">亚洲综合国产精品第一页</a>| <a href="http://kanboy.com" target="_blank">亚洲免费网站在线观看</a>| <a href="http://jiucaoji.com" target="_blank">ssswww日本免费网站片</a>| <a href="http://6266tv.com" target="_blank">美女网站免费福利视频</a>| <a href="http://aplus178.com" target="_blank">曰韩亚洲av人人夜夜澡人人爽</a>| <a href="http://www-44334.com" target="_blank">亚洲乱码卡三乱码新区</a>| <a href="http://wjjccw.com" target="_blank">999zyz**站免费毛片</a>| <a href="http://nblfkj.com" target="_blank">国产高清在线免费视频</a>| <a href="http://haha02.com" target="_blank">亚洲AV无码乱码在线观看富二代</a>| <a href="http://321fafa.com" target="_blank">国产精品亚洲专区无码牛牛</a>| <a href="http://3x79.com" target="_blank">18禁止看的免费污网站</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>