<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>two8g</title>
    <description>易斌鑫的个人博客</description>
    <link>http://two8g.com/</link>
    <atom:link href="http://two8g.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Sat, 29 Jul 2023 02:40:00 +0000</pubDate>
    <lastBuildDate>Sat, 29 Jul 2023 02:40:00 +0000</lastBuildDate>
    <generator>Jekyll v3.9.3</generator>
    
      <item>
        <title>Vim Cheat Sheet</title>
        <description>&lt;p&gt;&lt;a href=&quot;https://duckduckgo.com/?q=vim+cheat+sheet&amp;amp;ia=cheatsheet&amp;amp;iax=1&quot;&gt;1.vim cheat sheet on duckduckgo&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://vim.rtorr.com/&quot;&gt;2.Vim Cheat Sheet&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://github.com/LeCoupa/awesome-cheatsheets/blob/master/tools/vim.txt&quot;&gt;3.vim cheatsheets on github&lt;/a&gt;&lt;/p&gt;

&lt;h1 id=&quot;vim&quot;&gt;Vim&lt;/h1&gt;

&lt;h2 id=&quot;content&quot;&gt;Content&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;#global&quot;&gt;Global&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#cursor-movement&quot;&gt;Cursor movement&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#insert-mode&quot;&gt;Insert mode&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#editing&quot;&gt;Editing&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#marking-text-visual-mode&quot;&gt;Marking text (visual mode)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#visual-commands&quot;&gt;Visual commands&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;global&quot;&gt;Global&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;:h[elp] keyword&lt;/strong&gt; - open help for keyword&lt;br /&gt;
&lt;strong&gt;:sav[eas] file&lt;/strong&gt; - save file as&lt;br /&gt;
&lt;strong&gt;:clo[se]&lt;/strong&gt; - close current pane&lt;br /&gt;
&lt;strong&gt;:ter[minal]&lt;/strong&gt; - open a terminal window&lt;br /&gt;
&lt;strong&gt;K&lt;/strong&gt; - open man page for word under the cursor&lt;/p&gt;

&lt;h2 id=&quot;cursor-movement&quot;&gt;Cursor movement&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;h&lt;/strong&gt; - move cursor left&lt;br /&gt;
&lt;strong&gt;j&lt;/strong&gt; - move cursor down&lt;br /&gt;
&lt;strong&gt;k&lt;/strong&gt; - move cursor up&lt;br /&gt;
&lt;strong&gt;l&lt;/strong&gt; - move cursor right&lt;br /&gt;
&lt;strong&gt;gj&lt;/strong&gt; - move cursor down (multi-line text)&lt;br /&gt;
&lt;strong&gt;gk&lt;/strong&gt; - move cursor up (multi-line text)&lt;br /&gt;
&lt;strong&gt;H&lt;/strong&gt; - move to top of screen&lt;br /&gt;
&lt;strong&gt;M&lt;/strong&gt; - move to middle of screen&lt;br /&gt;
&lt;strong&gt;L&lt;/strong&gt; - move to bottom of screen&lt;br /&gt;
&lt;strong&gt;w&lt;/strong&gt; - jump forwards to the start of a word&lt;br /&gt;
&lt;strong&gt;W&lt;/strong&gt; - jump forwards to the start of a word (words can contain punctuation)&lt;br /&gt;
&lt;strong&gt;e&lt;/strong&gt; - jump forwards to the end of a word&lt;br /&gt;
&lt;strong&gt;E&lt;/strong&gt; - jump forwards to the end of a word (words can contain punctuation)&lt;br /&gt;
&lt;strong&gt;b&lt;/strong&gt; - jump backwards to the start of a word&lt;br /&gt;
&lt;strong&gt;B&lt;/strong&gt; - jump backwards to the start of a word (words can contain punctuation)&lt;br /&gt;
&lt;strong&gt;ge&lt;/strong&gt; - jump backwards to the end of a word&lt;br /&gt;
&lt;strong&gt;gE&lt;/strong&gt; - jump backwards to the end of a word (words can contain punctuation)&lt;br /&gt;
&lt;strong&gt;%&lt;/strong&gt; - move to matching character (default supported pairs: ‘()’, ‘{}’, ‘[]’ - use :h matchpairs in vim for more info)&lt;br /&gt;
&lt;strong&gt;0&lt;/strong&gt; - jump to the start of the line&lt;br /&gt;
&lt;strong&gt;^&lt;/strong&gt; - jump to the first non-blank character of the line&lt;br /&gt;
&lt;strong&gt;$&lt;/strong&gt; - jump to the end of the line&lt;br /&gt;
&lt;strong&gt;g_&lt;/strong&gt; - jump to the last non-blank character of the line&lt;br /&gt;
&lt;strong&gt;gg&lt;/strong&gt; - go to the first line of the document&lt;br /&gt;
&lt;strong&gt;G&lt;/strong&gt; - go to the last line of the document&lt;br /&gt;
&lt;strong&gt;5gg&lt;/strong&gt; or &lt;strong&gt;5G&lt;/strong&gt; - go to line 5&lt;br /&gt;
&lt;strong&gt;gd&lt;/strong&gt; - move to local declaration&lt;br /&gt;
&lt;strong&gt;gD&lt;/strong&gt; - move to global declaration&lt;br /&gt;
&lt;strong&gt;fx&lt;/strong&gt; - jump to next occurrence of character x&lt;br /&gt;
&lt;strong&gt;tx&lt;/strong&gt; - jump to before next occurrence of character x&lt;br /&gt;
&lt;strong&gt;Fx&lt;/strong&gt; - jump to the previous occurrence of character x&lt;br /&gt;
&lt;strong&gt;Tx&lt;/strong&gt; - jump to after previous occurrence of character x&lt;br /&gt;
&lt;strong&gt;;&lt;/strong&gt; - repeat previous f, t, F or T movement&lt;br /&gt;
&lt;strong&gt;,&lt;/strong&gt; - repeat previous f, t, F or T movement, backwards&lt;br /&gt;
&lt;strong&gt;}&lt;/strong&gt; - jump to next paragraph (or function/block, when editing code)&lt;br /&gt;
&lt;strong&gt;{&lt;/strong&gt; - jump to previous paragraph (or function/block, when editing code)&lt;br /&gt;
&lt;strong&gt;zz&lt;/strong&gt; - center cursor on screen&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;e&lt;/strong&gt; - move screen down one line (without moving cursor)&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;y&lt;/strong&gt; - move screen up one line (without moving cursor)&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;b&lt;/strong&gt; - move back one full screen&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;f&lt;/strong&gt; - move forward one full screen&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;d&lt;/strong&gt; - move forward 1/2 a screen&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;u&lt;/strong&gt; - move back 1/2 a screen&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt; Prefix a cursor movement command with a number to repeat it. For example, &lt;strong&gt;4j&lt;/strong&gt; moves down 4 lines.&lt;/p&gt;

&lt;h2 id=&quot;insert-mode&quot;&gt;Insert mode&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;i&lt;/strong&gt; - insert before the cursor&lt;br /&gt;
&lt;strong&gt;I&lt;/strong&gt; - insert at the beginning of the line&lt;br /&gt;
&lt;strong&gt;a&lt;/strong&gt; - insert (append) after the cursor&lt;br /&gt;
&lt;strong&gt;A&lt;/strong&gt; - insert (append) at the end of the line&lt;br /&gt;
&lt;strong&gt;o&lt;/strong&gt; - append (open) a new line below the current line&lt;br /&gt;
&lt;strong&gt;O&lt;/strong&gt; - append (open) a new line above the current line&lt;br /&gt;
&lt;strong&gt;ea&lt;/strong&gt; - insert (append) at the end of the word&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;h&lt;/strong&gt; - delete the character before the cursor during insert mode&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;w&lt;/strong&gt; - delete word before the cursor during insert mode&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;j&lt;/strong&gt; - begin new line during insert mode&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;t&lt;/strong&gt; - indent (move right) line one shiftwidth during insert mode&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;d&lt;/strong&gt; - de-indent (move left) line one shiftwidth during insert mode&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;n&lt;/strong&gt; - insert (auto-complete) next match before the cursor during insert mode&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;p&lt;/strong&gt; - insert (auto-complete) previous match before the cursor during insert mode&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;rx&lt;/strong&gt; - insert the contents of register x&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;ox&lt;/strong&gt; - Temporarily enter normal mode to issue one normal-mode command x.&lt;br /&gt;
&lt;strong&gt;Esc&lt;/strong&gt; - exit insert mode&lt;/p&gt;

&lt;h2 id=&quot;editing&quot;&gt;Editing&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;r&lt;/strong&gt; - replace a single character.&lt;br /&gt;
&lt;strong&gt;R&lt;/strong&gt; - replace more than one character, until &lt;strong&gt;ESC&lt;/strong&gt; is pressed.&lt;br /&gt;
&lt;strong&gt;J&lt;/strong&gt; - join line below to the current one with one space in between&lt;br /&gt;
&lt;strong&gt;gJ&lt;/strong&gt; - join line below to the current one without space in between&lt;br /&gt;
&lt;strong&gt;gwip&lt;/strong&gt; - reflow paragraph&lt;br /&gt;
&lt;strong&gt;g~&lt;/strong&gt; - switch case up to motion&lt;br /&gt;
&lt;strong&gt;gu&lt;/strong&gt; - change to lowercase up to motion&lt;br /&gt;
&lt;strong&gt;gU&lt;/strong&gt; - change to uppercase up to motion&lt;br /&gt;
&lt;strong&gt;cc&lt;/strong&gt; - change (replace) entire line&lt;br /&gt;
&lt;strong&gt;c$&lt;/strong&gt; or &lt;strong&gt;C&lt;/strong&gt; - change (replace) to the end of the line&lt;br /&gt;
&lt;strong&gt;ciw&lt;/strong&gt; - change (replace) entire word&lt;br /&gt;
&lt;strong&gt;cw&lt;/strong&gt; or &lt;strong&gt;ce&lt;/strong&gt; - change (replace) to the end of the word&lt;br /&gt;
&lt;strong&gt;s&lt;/strong&gt; - delete character and substitute text&lt;br /&gt;
&lt;strong&gt;S&lt;/strong&gt; - delete line and substitute text (same as cc)&lt;br /&gt;
&lt;strong&gt;xp&lt;/strong&gt; - transpose two letters (delete and paste)&lt;br /&gt;
&lt;strong&gt;u&lt;/strong&gt; - undo&lt;br /&gt;
&lt;strong&gt;U&lt;/strong&gt; - restore (undo) last changed line&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;r&lt;/strong&gt; - redo&lt;br /&gt;
&lt;strong&gt;.&lt;/strong&gt; - repeat last command&lt;/p&gt;

&lt;h2 id=&quot;marking-text-visual-mode&quot;&gt;Marking text (visual mode)&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;v&lt;/strong&gt; - start visual mode, mark lines, then do a command (like y-yank)&lt;br /&gt;
&lt;strong&gt;V&lt;/strong&gt; - start linewise visual mode&lt;br /&gt;
&lt;strong&gt;o&lt;/strong&gt; - move to other end of marked area&lt;br /&gt;
&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;v&lt;/strong&gt; - start visual block mode&lt;br /&gt;
&lt;strong&gt;O&lt;/strong&gt; - move to other corner of block&lt;br /&gt;
&lt;strong&gt;aw&lt;/strong&gt; - mark a word&lt;br /&gt;
&lt;strong&gt;ab&lt;/strong&gt; - a block with ()&lt;br /&gt;
&lt;strong&gt;aB&lt;/strong&gt; - a block with {}&lt;br /&gt;
&lt;strong&gt;at&lt;/strong&gt; - a block with &amp;lt;&amp;gt; tags&lt;br /&gt;
&lt;strong&gt;ib&lt;/strong&gt; - inner block with ()&lt;br /&gt;
&lt;strong&gt;iB&lt;/strong&gt; - inner block with {}&lt;br /&gt;
&lt;strong&gt;it&lt;/strong&gt; - inner block with &amp;lt;&amp;gt; tags&lt;br /&gt;
&lt;strong&gt;Esc&lt;/strong&gt; - exit visual mode&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt; Instead of &lt;strong&gt;b&lt;/strong&gt; or &lt;strong&gt;B&lt;/strong&gt; one can also use &lt;strong&gt;(&lt;/strong&gt; or &lt;strong&gt;{&lt;/strong&gt; respectively.&lt;/p&gt;

&lt;h2 id=&quot;visual-commands&quot;&gt;Visual commands&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&amp;gt;&lt;/strong&gt; - shift text right&lt;br /&gt;
&lt;strong&gt;&amp;lt;&lt;/strong&gt; - shift text left&lt;br /&gt;
&lt;strong&gt;y&lt;/strong&gt; - yank (copy) marked text&lt;br /&gt;
&lt;strong&gt;d&lt;/strong&gt; - delete marked text&lt;br /&gt;
&lt;strong&gt;~&lt;/strong&gt; - switch case&lt;br /&gt;
&lt;strong&gt;u&lt;/strong&gt; - change marked text to lowercase&lt;br /&gt;
&lt;strong&gt;U&lt;/strong&gt; - change marked text to uppercase&lt;/p&gt;
</description>
        <pubDate>Wed, 09 Nov 2022 00:00:00 +0000</pubDate>
        <link>http://two8g.com/tool/2022/11/09/vim-cheat-sheet.html</link>
        <guid isPermaLink="true">http://two8g.com/tool/2022/11/09/vim-cheat-sheet.html</guid>
        
        <category>vim</category>
        
        <category>cheatsheet</category>
        
        
        <category>Tool</category>
        
      </item>
    
      <item>
        <title>Pwa Aia</title>
        <description>&lt;h1 id=&quot;native-or-web&quot;&gt;Native or Web?&lt;/h1&gt;

&lt;p&gt;Native:
    Android Apps
    iOS Apps
    PC Apps
    Android Instant Apps
Wed:
    PC Web
    PWA
    WXApp(微信小程序)&lt;/p&gt;

&lt;p&gt;一起来探讨探讨前端的微信小程序，PWA(Progressive Web Apps)，AIA(Android Instant Apps)&lt;/p&gt;

&lt;h2 id=&quot;回顾&quot;&gt;回顾&lt;/h2&gt;

&lt;p&gt;2013年8月，微信公众平台更新，推出服务号。
2016年9月 微信小程序内测，11月开发公测。&lt;/p&gt;

&lt;p&gt;2017年1月微信小程序&lt;/p&gt;

&lt;h2 id=&quot;细说&quot;&gt;细说&lt;/h2&gt;

&lt;h3 id=&quot;progressive-web-apps&quot;&gt;Progressive Web Apps&lt;/h3&gt;

&lt;p&gt;PWA是Google提出的一种新用户体验的web应用形态。
2015年6月 Alex Russell的一篇博客&lt;a href=&quot;https://infrequently.org/2015/06/progressive-apps-escaping-tabs-without-losing-our-soul/&quot;&gt;Progressive Web Apps: Escaping Tabs Without Losing Our Soul&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;此类应用包含TLS, Service Workers, Manifests, and Responsive Design特性.&lt;/p&gt;

&lt;h2 id=&quot;讨论&quot;&gt;讨论&lt;/h2&gt;

&lt;p&gt;https://developers.google.com/web/progressive-web-apps/
https://developer.android.com/topic/instant-apps/index.html
https://infrequently.org/2015/06/progressive-apps-escaping-tabs-without-losing-our-soul/
http://harttle.com/2017/01/28/pwa-explore.html
https://www.clickz.com/progressive-web-apps-versus-android-instant-apps-which-is-better-for-brands/111446/&lt;/p&gt;
</description>
        <pubDate>Fri, 27 Oct 2017 00:00:00 +0000</pubDate>
        <link>http://two8g.com/2017/10/27/PWA-AIA.html</link>
        <guid isPermaLink="true">http://two8g.com/2017/10/27/PWA-AIA.html</guid>
        
        
      </item>
    
      <item>
        <title>Github Pages</title>
        <description>&lt;h1 id=&quot;github-pages&quot;&gt;Github Pages&lt;/h1&gt;

&lt;p&gt;Github提供的个人或者项目站点功能。&lt;/p&gt;

&lt;p&gt;站点内容托管在Github仓库，使用者只需编辑，提交修改，网站自动上线。&lt;/p&gt;

&lt;p&gt;每个账号或组织可拥有一个个人/组织站点，无限制个数的项目站点。&lt;/p&gt;

&lt;h2 id=&quot;个人组织站点&quot;&gt;个人/组织站点&lt;/h2&gt;

&lt;p&gt;项目仓库以account.github.io或者organization.github.io命名&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/GithubPages/user_or_organization_site_repository.png&quot; alt=&quot;user_or_organization_site_repository&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;项目站点&quot;&gt;项目站点&lt;/h2&gt;

&lt;p&gt;项目站点可以选择主题创建或者直接创建&lt;/p&gt;

&lt;p&gt;选择Github提供的主题创建，加入Github项目的Settings,在GitHub Pages板块选择主题然后编辑页面内容。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/GithubPages/launch-theme-chooser@2x.png&quot; alt=&quot;launch-theme-chooser&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Github Pages的主题都是通过Jekyll生成的。&lt;/p&gt;

&lt;p&gt;已知站点主题使用者：&lt;/p&gt;

&lt;p&gt;Architect主题: &lt;a href=&quot;http://brettwooldridge.github.io/HikariCP/&quot;&gt;HikariCP&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Tue, 24 Oct 2017 00:00:00 +0000</pubDate>
        <link>http://two8g.com/2017/10/24/Github-Pages.html</link>
        <guid isPermaLink="true">http://two8g.com/2017/10/24/Github-Pages.html</guid>
        
        
      </item>
    
      <item>
        <title>MQ And Domain Event</title>
        <description>&lt;h1 id=&quot;消息队列与领域事件&quot;&gt;消息队列与领域事件&lt;/h1&gt;

&lt;h2 id=&quot;消息队列&quot;&gt;消息队列&lt;/h2&gt;

&lt;h3 id=&quot;两种模式&quot;&gt;两种模式&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;Point-ti-Point: Queue (点对点： 队列)&lt;/li&gt;
  &lt;li&gt;Pub/Sub: Topic (发布/订阅： 主题)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;非持久订阅&quot;&gt;（非）持久订阅&lt;/h3&gt;

&lt;p&gt;发布/订阅分为非持久订阅(Redis pub/sub)和持久订阅(ActiveMQ). 持久订阅：
发布者在订阅者处于非活动状态时发布的消息，将在订阅者再次处于活跃状态时重新发布。&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;Point-to-Point&lt;/th&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;Pub/Sub&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;一个消费者(&lt;strong&gt;不可重复消费&lt;/strong&gt;)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;多个订阅者(&lt;strong&gt;可重复消费&lt;/strong&gt;)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;拉&lt;/strong&gt;模式(懒/轮询)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;strong&gt;推&lt;/strong&gt;模型&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;异步&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;“同步”&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;生成-消费队列&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;观察者&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;领域事件&quot;&gt;领域事件&lt;/h2&gt;

&lt;p&gt;消息队列和事件驱动有密不可分的关系。&lt;/p&gt;

&lt;blockquote&gt;
  &lt;blockquote&gt;
    &lt;p&gt;领域事件（Domain Events）是领域驱动设计（Domain Driven Design，DDD）中的一个概念。&lt;/p&gt;
  &lt;/blockquote&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;blockquote&gt;
    &lt;p&gt;&lt;strong&gt;在DDD中有一条原则：一个业务用例对应一个事务，一个事务对应一个&lt;em&gt;聚合根&lt;/em&gt;，也即在一次事务中，只能对一个聚合根进行操作。&lt;/strong&gt;&lt;/p&gt;
  &lt;/blockquote&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;blockquote&gt;
    &lt;p&gt;在DDD中有一条原则：一个业务用例对应一个事务，一个事务对应一个聚合根，也即在一次事务中，只能对一个聚合根进行操作。但是在实际应用中，我们经常发现一个用例需要修改多个聚合根的情况，并且不同的聚合根还处于不同的限界上下文中。比如，当你在电商网站上买了东西之后，你的积分会相应增加。这里的购买行为可能被建模为一个订单（Order）对象，而积分可以建模成账户（Account）对象的某个属性，订单和账户均为聚合根，并且分别属于订单系统和账户系统。显然，我们需要在订单和积分之间维护数据一致性，通常的做法是在同一个事务中同时更新两者，但是这会存在以下问题：&lt;/p&gt;
  &lt;/blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;违背DDD中”单个事务修改单个聚合根”的设计原则；&lt;/li&gt;
  &lt;li&gt;需要在不同的系统之间采用重量级的分布式事务（Distributed Transactioin，也叫XA事务或者全局事务）；&lt;/li&gt;
  &lt;li&gt;在不同系统之间产生强耦合。&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;通过引入领域事件，我们可以很好地解决上述问题。 总的来说，领域事件给我们带来以下好处：
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;解耦微服务（限界上下文）；&lt;/li&gt;
  &lt;li&gt;帮助我们深入理解领域模型；&lt;/li&gt;
  &lt;li&gt;提供审计和报告的数据来源；&lt;/li&gt;
  &lt;li&gt;迈向事件溯源（Event Sourcing）和CQRS等。&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;http://insights.thoughtworkers.org/wp-content/uploads/2017/04/5-OrderPlacedEvent.png&quot; alt=&quot;“电商订单”例子&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://insights.thoughtworkers.org/use-domain-events-in-microservices/&quot;&gt;领域事件&lt;/a&gt;&lt;/p&gt;

</description>
        <pubDate>Wed, 19 Apr 2017 00:00:00 +0000</pubDate>
        <link>http://two8g.com/%E8%AE%BE%E8%AE%A1/2017/04/19/MQ-DomainEvent.html</link>
        <guid isPermaLink="true">http://two8g.com/%E8%AE%BE%E8%AE%A1/2017/04/19/MQ-DomainEvent.html</guid>
        
        <category>消息</category>
        
        <category>发布订阅</category>
        
        <category>事件驱动</category>
        
        <category>领域事件</category>
        
        
        <category>设计</category>
        
      </item>
    
      <item>
        <title>Object</title>
        <description>&lt;h1 id=&quot;object的getclass方法&quot;&gt;Object的getClass方法&lt;/h1&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Object&lt;/code&gt;类是所有类层级的根,包括数组.&lt;/p&gt;

&lt;p&gt;主要定义的方法有&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;getClass&lt;/code&gt;、&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hashCode&lt;/code&gt;、&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;equals&lt;/code&gt;、&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;clone&lt;/code&gt;,&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;toString&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;native&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;?&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;getClass&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;native&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;hashCode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;boolean&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;equals&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Object&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;native&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Object&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;clone&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;throws&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;CloneNotSupportedException&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getClass&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;@&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toHexString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hashCode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;其中&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hashCode&lt;/code&gt;、&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;equals&lt;/code&gt;,&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;toString&lt;/code&gt;都通过java代码提供实现.而&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;getClass&lt;/code&gt;、&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;clone&lt;/code&gt;是native,即由平台相关代码实现,其中&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;getClass&lt;/code&gt;是&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;final&lt;/code&gt;的.&lt;/p&gt;

&lt;p&gt;下面依次讨论上面5个方法.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;getClass方法&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;getClass&lt;/code&gt;方法定义如下&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;native&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;?&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;getClass&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;该方法获取的是Obejct的运行时的class,返回的一个Class对象,如何一个Obejct都关联一个&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;java.lang.Class&lt;/code&gt;的实例的引用.
另外注意&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Class&amp;lt;?&amp;gt;&lt;/code&gt;的形式.实际表示是&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Class&amp;lt;? extends |X|&amp;gt;&lt;/code&gt;,其实. 其中&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;|X|&lt;/code&gt;是对象的static type()的类型擦除结果.&lt;/p&gt;

&lt;p&gt;这里设计两个概念&lt;em&gt;static type&lt;/em&gt;和&lt;em&gt;类型擦除&lt;/em&gt;. 先说&lt;em&gt;static type&lt;/em&gt;,&lt;/p&gt;

&lt;p&gt;&lt;em&gt;static type&lt;/em&gt;字面理解即静态类型,那上面是静态类型呢?既然有静态类型,那是不是还有动态类型呢?&lt;/p&gt;

&lt;p&gt;首先要指出,&lt;em&gt;static type&lt;/em&gt;确切的说是&lt;em&gt;compile-time type&lt;/em&gt;指编译时类型.而&lt;em&gt;dynamic type&lt;/em&gt;(动态类型)是&lt;em&gt;runtime type&lt;/em&gt;指运行时类型.
注意千万不要和静态类型语言和动态类型语言概念(两种语言分类)混淆.所以我们改用&lt;em&gt;compile-time type&lt;/em&gt;和&lt;em&gt;runtime type&lt;/em&gt;进行说明,避免混淆.
不过这里的&lt;em&gt;static type&lt;/em&gt;与&lt;em&gt;静态类型语言&lt;/em&gt;也有点关系. (我对这理解还不够深入,大家最好看看权威文档. 我主要参考了这个&lt;a href=&quot;http://stackoverflow.com/questions/14963943/what-is-the-difference-between-a-compile-time-type-vs-run-time-type-for-any-obje&quot;&gt;讨论&lt;/a&gt;)&lt;/p&gt;

&lt;blockquote&gt;
  &lt;blockquote&gt;
    &lt;p&gt;Java is a statically typed language, so the compiler will attempt to determine the types of everything and make sure that everything is type safe. Unfortunately static type inference is inherently limited. The compiler has to be conservative, and is also unable to see runtime information. Therefore, it will be unable to prove that certain code is typesafe, even if it really is.&lt;/p&gt;
  &lt;/blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;意思是说,JAVA是静态类型语言.所以编译器需要尝试确认所有东西的的类型来保证类型安全.但是,静态类型语言的推到是有一定限制的.编译器采取保守手段, 它无法获得运行时信息. 所以, 编译器无法保证代码的类型安全, 即使代码确实是安全的.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;blockquote&gt;
    &lt;p&gt;The run time type refers to the actual type of the variable at runtime. As the programmer, you hopefully know this better than the compiler, so you can suppress warnings when you know that it is safe to do so.&lt;/p&gt;
  &lt;/blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;运行时类型是指,代码时间运行时的类型. 作为程序员,你希望比编译器更好的清除代码,所以,当你知道代码是类型安全的时候你可以屏蔽警告.&lt;/p&gt;

&lt;p&gt;我的理解是. &lt;em&gt;compile-time type&lt;/em&gt;就是我们声明参数或变量时的类型.而&lt;em&gt;runtime type&lt;/em&gt;就是实际运行时对象的真实类型. 而getClass方法返回的参数类型的只能是&lt;em&gt;compile-time type&lt;/em&gt;. 因为前面说的,编译器获取不到运行时信息. 所以在使用getClass方法时,这样写是正确的:&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerList&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ArrayList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;Class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;?&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerListClass&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getClass&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;ArrayList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerList_1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ArrayList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;Class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;?&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ArrayList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerListClass_1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerList_1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getClass&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;而下面这样的写法,是无法编译通过的.&lt;/p&gt;
&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerList&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ArrayList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;Class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;?&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ArrayList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerListClass&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getClass&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;理解了上面的静态类型和动态类型就非常容易理解JAVA面向对象的多态特性,以及类型转换知识.&lt;/p&gt;

&lt;p&gt;然后说说&lt;em&gt;类型擦除&lt;/em&gt;.&lt;em&gt;类型擦除&lt;/em&gt;是JAVA泛型支持特性的知识.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;blockquote&gt;
    &lt;p&gt;Java泛型（generics）是JDK 5中引入的一个新特性，允许在定义类和接口的时候使用类型参数（type parameter）。声明的类型参数在使用时用具体的类型来替换。泛型最主要的应用是在JDK 5中的新集合类框架中.&lt;/p&gt;
  &lt;/blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;而对于类型擦除,例如: List&lt;String&gt; 的类型擦除类型为 List.&lt;/String&gt;&lt;/p&gt;

&lt;p&gt;以下代码是正确的:&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;Object&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;o&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;Class&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;oClass&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getClass&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;str&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;Class&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sClass&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getClass&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerList&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ArrayList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;Class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;?&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerListClass&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getClass&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;ArrayList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerList_1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ArrayList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;Class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;?&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ArrayList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerListClass_1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;integerList_1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getClass&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;理解了静态类型/动态类型和类型擦除,以下代码就很容易明白了&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Object oa = new Object();
Object ob = new Object();
Class oaClass = oa.getClass();
Class obClass = ob.getClass();
System.out.println(oaClass == obClass); //true

List&amp;lt;Integer&amp;gt; integerList = new ArrayList&amp;lt;&amp;gt;();
Class&amp;lt;? extends List&amp;gt; integerListClass = integerList.getClass();
ArrayList&amp;lt;Integer&amp;gt; integerList_1 = new ArrayList&amp;lt;&amp;gt;();
Class&amp;lt;? extends ArrayList&amp;gt; integerListClass_1 = integerList_1.getClass();
List&amp;lt;Integer&amp;gt; integerList_2 = new LinkedList&amp;lt;&amp;gt;();
Class&amp;lt;? extends List&amp;gt; integerListClass_2 = integerList_2.getClass();
List&amp;lt;String&amp;gt; stringList_3 = new ArrayList&amp;lt;&amp;gt;();
Class&amp;lt;? extends List&amp;gt; stringListClass_3 = stringList_3.getClass();

System.out.println(integerListClass == integerListClass_1); //true
System.out.println(integerListClass == integerListClass_2); //false
System.out.println(integerListClass == stringListClass_3); //true

System.out.println(integerListClass); // class java.util.ArrayList
System.out.println(integerListClass_2);// class java.util.LinkedList
System.out.println(stringListClass_3);// class java.util.ArrayList
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Wed, 29 Mar 2017 00:00:00 +0000</pubDate>
        <link>http://two8g.com/java/2017/03/29/Object.html</link>
        <guid isPermaLink="true">http://two8g.com/java/2017/03/29/Object.html</guid>
        
        <category>java</category>
        
        <category>object</category>
        
        <category>getClass</category>
        
        <category>泛型</category>
        
        
        <category>java</category>
        
      </item>
    
      <item>
        <title>gitlab ci</title>
        <description>&lt;h1 id=&quot;gitlab-ci尝试&quot;&gt;gitlab-ci尝试&lt;/h1&gt;

&lt;h2 id=&quot;写在前面&quot;&gt;写在前面&lt;/h2&gt;

&lt;p&gt;DRY,一切程序能做的事,不要手动重复做.
既然我已经搭建好了gitlab,jenkins,maven-nexus…为何不更进异步呢?&lt;/p&gt;

&lt;h2 id=&quot;gitlab-ci&quot;&gt;gitlab-ci&lt;/h2&gt;

&lt;h2 id=&quot;runners&quot;&gt;Runners&lt;/h2&gt;

&lt;h3 id=&quot;runners-安装&quot;&gt;Runners 安装&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.gitlab.com/runner/install/linux-repository.html#install-gitlab-runner-using-the-official-gitlab-repositories&quot;&gt;Install GitLab Runner using the official GitLab repositories&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;root@xxx ~]# curl &lt;span class=&quot;nt&quot;&gt;-sSL&lt;/span&gt; https://get.docker.com/ | sh
+ sh &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'sleep 3; yum -y -q install docker-engine'&lt;/span&gt;
Repository base is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository updates is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository extras is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository centosplus is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
warning: rpmts_HdrFromFdno: Header V4 RSA/SHA1 Signature, key ID 2c52609d: NOKEY
Importing GPG key 0x2C52609D:
 Userid: &lt;span class=&quot;s2&quot;&gt;&quot;Docker Release Tool (releasedocker) &amp;lt;docker@docker.com&amp;gt;&quot;&lt;/span&gt;
 From  : https://yum.dockerproject.org/gpg

If you would like to use Docker as a non-root user, you should now consider
adding your user to the &lt;span class=&quot;s2&quot;&gt;&quot;docker&quot;&lt;/span&gt; group with something like:

  &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;usermod &lt;span class=&quot;nt&quot;&gt;-aG&lt;/span&gt; docker your-user

Remember that you will have to log out and back &lt;span class=&quot;k&quot;&gt;in for &lt;/span&gt;this to take effect!

&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;root@xxx ~]# curl &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt; https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh | &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
101  6488    0  6488    0     0   2003      0 &lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt;:--:--  0:00:03 &lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt;:--:-- 10364
Detected operating system as centos/6.
Checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;curl...
Detected curl...
Downloading repository file: https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/config_file.repo?os&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;centos&amp;amp;dist&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;6&amp;amp;source&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;script
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
Installing pygpgme to verify GPG signatures...
Loaded plugins: security
Repository base is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository updates is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository extras is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository centosplus is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
https://packages.gitlab.com/runner/gitlab-ci-multi-runner/el/6/SRPMS/repodata/repomd.xml: &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;repomd.xml&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;repository: runner_gitlab-ci-multi-runner-source. Please verify its path and try again
Installing yum-utils...
Loaded plugins: security
Repository base is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository updates is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository extras is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository centosplus is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
https://packages.gitlab.com/runner/gitlab-ci-multi-runner/el/6/SRPMS/repodata/repomd.xml: &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;repomd.xml&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;repository: runner_gitlab-ci-multi-runner-source. Please verify its path and try again
Generating yum cache &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;runner_gitlab-ci-multi-runner...
Repository base is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository updates is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository extras is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository centosplus is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Importing GPG key 0xE15E78F4:
 Userid: &lt;span class=&quot;s2&quot;&gt;&quot;GitLab B.V. (package repository signing key) &amp;lt;packages@gitlab.com&amp;gt;&quot;&lt;/span&gt;
 From  : https://packages.gitlab.com/runner/gitlab-ci-multi-runner/gpgkey

The repository is setup! You can now &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;packages.
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;root@xxx ~]# &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;yum &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;gitlab-ci-multi-runner
Loaded plugins: security
Repository base is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository updates is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository extras is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
Repository centosplus is listed more than once &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration
runner_gitlab-ci-multi-runner-source/signature                                                                                                                                               |  836 B     00:00
Retrieving key from https://packages.gitlab.com/runner/gitlab-ci-multi-runner/gpgkey
Importing GPG key 0xE15E78F4:
 Userid: &lt;span class=&quot;s2&quot;&gt;&quot;GitLab B.V. (package repository signing key) &amp;lt;packages@gitlab.com&amp;gt;&quot;&lt;/span&gt;
 From  : https://packages.gitlab.com/runner/gitlab-ci-multi-runner/gpgkey
Is this ok &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;y/N]: y
runner_gitlab-ci-multi-runner-source/signature                                                                                                                                               |  951 B     00:06 ...
runner_gitlab-ci-multi-runner-source/primary                                                                                                                                                 |  175 B     00:00
Setting up Install Process
Resolving Dependencies
&lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Running transaction check
&lt;span class=&quot;nt&quot;&gt;---&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Package gitlab-ci-multi-runner.x86_64 0:1.11.0-1 will be installed
&lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Processing Dependency: git &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;package: gitlab-ci-multi-runner-1.11.0-1.x86_64
&lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Running transaction check
&lt;span class=&quot;nt&quot;&gt;---&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Package git.x86_64 0:1.7.1-4.el6_7.1 will be installed
&lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Processing Dependency: perl-Git &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 1.7.1-4.el6_7.1 &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;package: git-1.7.1-4.el6_7.1.x86_64
&lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Processing Dependency: perl&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Git&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;package: git-1.7.1-4.el6_7.1.x86_64
&lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Running transaction check
&lt;span class=&quot;nt&quot;&gt;---&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Package perl-Git.noarch 0:1.7.1-4.el6_7.1 will be installed
&lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; Finished Dependency Resolution

Dependencies Resolved

&lt;span class=&quot;o&quot;&gt;====================================================================================================================================================================================================================&lt;/span&gt;
 Package                                                Arch                                   Version                                          Repository                                                     Size
&lt;span class=&quot;o&quot;&gt;====================================================================================================================================================================================================================&lt;/span&gt;
Installing:
 gitlab-ci-multi-runner                                 x86_64                                 1.11.0-1                                         runner_gitlab-ci-multi-runner                                  25 M
Installing &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;dependencies:
 git                                                    x86_64                                 1.7.1-4.el6_7.1                                  base                                                          4.6 M
 perl-Git                                               noarch                                 1.7.1-4.el6_7.1                                  base                                                           28 k

Transaction Summary
&lt;span class=&quot;o&quot;&gt;====================================================================================================================================================================================================================&lt;/span&gt;
Install       3 Package&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;s&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

Total download size: 30 M
Installed size: 80 M
Is this ok &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;y/N]: y
Downloading Packages:
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1/3&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;: git-1.7.1-4.el6_7.1.x86_64.rpm                                                                                                                                                        | 4.6 MB     00:04
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2/3&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;: gitlab-ci-multi-runner-1.11.0-1.x86_64.rpm                                                                                                                                            |  25 MB     00:02
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;3/3&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;: perl-Git-1.7.1-4.el6_7.1.noarch.rpm                                                                                                                                                   |  28 kB     00:00
&lt;span class=&quot;nt&quot;&gt;--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/span&gt;
Total                                                                                                                                                                               3.6 MB/s |  30 MB     00:08
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : git-1.7.1-4.el6_7.1.x86_64                                                                                                                                                                       1/3
  Installing : perl-Git-1.7.1-4.el6_7.1.noarch                                                                                                                                                                  2/3
  Installing : gitlab-ci-multi-runner-1.11.0-1.x86_64                                                                                                                                                           3/3
GitLab Runner: creating gitlab-runner...
  Verifying  : perl-Git-1.7.1-4.el6_7.1.noarch                                                                                                                                                                  1/3
  Verifying  : gitlab-ci-multi-runner-1.11.0-1.x86_64                                                                                                                                                           2/3
  Verifying  : git-1.7.1-4.el6_7.1.x86_64                                                                                                                                                                       3/3

Installed:
  gitlab-ci-multi-runner.x86_64 0:1.11.0-1

Dependency Installed:
  git.x86_64 0:1.7.1-4.el6_7.1                                                                           perl-Git.noarch 0:1.7.1-4.el6_7.1

Complete!

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;runners使用&quot;&gt;Runners使用&lt;/h3&gt;

&lt;p&gt;https://docs.gitlab.com/runner/commands/README.html&lt;/p&gt;

&lt;h4 id=&quot;register&quot;&gt;Register&lt;/h4&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;root@xxx ~]# gitlab-runner register
Running &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;system-mode.                            
                                                   
Please enter the gitlab-ci coordinator URL &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;e.g. https://gitlab.com/&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;:
https://gitlab.com/
Please enter the gitlab-ci token &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;this runner:
xyzxyz
Please enter the gitlab-ci description &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;this runner:
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;xxx]: simple
Please enter the gitlab-ci tags &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;this runner &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;comma separated&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;:
simple,shell
Whether to run untagged builds &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;/false]:
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;: 
Registering runner... succeeded                     &lt;span class=&quot;nv&quot;&gt;runner&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;yBdLVN_L
Please enter the executor: docker, parallels, shell, ssh, docker+machine, docker-ssh, virtualbox, docker-ssh+machine, kubernetes:
shell	
Runner registered successfully. Feel free to start it, but &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;it&lt;span class=&quot;s1&quot;&gt;'s running already the config should be automatically reloaded! 
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;参考&quot;&gt;参考&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://gitlab.com/help/ci/README.md&quot;&gt;gitlab-ci-help&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://doc.gitlab.cc/ce/ci/README.html&quot;&gt;gitlab-ci-help中文&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://gitlab.com/help/ci/yaml/README.md&quot;&gt;.gitlab-ci.yml语法&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.jianshu.com/p/1c1ecd3ce7c0&quot;&gt;Gitlab CI 简介&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://gitlab.com/help/ci/runners/README.md&quot;&gt;Runners&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/#installation&quot;&gt;Runners Install&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
</description>
        <pubDate>Wed, 01 Mar 2017 00:00:00 +0000</pubDate>
        <link>http://two8g.com/dev/ops/2017/03/01/gitlab-ci.html</link>
        <guid isPermaLink="true">http://two8g.com/dev/ops/2017/03/01/gitlab-ci.html</guid>
        
        <category>gitlab</category>
        
        <category>ci</category>
        
        <category>持续集成</category>
        
        <category>自动部署</category>
        
        
        <category>Dev/Ops</category>
        
      </item>
    
      <item>
        <title>RESTful-API-DOCUMENT</title>
        <description>&lt;h1 id=&quot;restful-api-设计与自动文档生成工具&quot;&gt;RESTful-API 设计与自动文档生成工具&lt;/h1&gt;

&lt;h2 id=&quot;工具&quot;&gt;工具&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://raml.org/&quot;&gt;RAML&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://swagger.io/&quot;&gt;Swagger&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://apiblueprint.org/&quot;&gt;API Blueprint&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.mashery.com/api/io-docs&quot;&gt;IO Docs&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.mashape.com/&quot;&gt;Mashape&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Web_Application_Description_Language&quot;&gt;WADL&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;http://www.mikestowe.com/blog/2014/07/raml-vs-swagger-vs-api-blueprint.php
http://www.mikestowe.com/2014/12/api-spec-comparison-tool.php
http://hanzheng.github.io/tech/2015/01/05/RESTful-API-Design-Tool.html
https://yq.aliyun.com/articles/773&lt;/p&gt;

</description>
        <pubDate>Wed, 03 Aug 2016 00:00:00 +0000</pubDate>
        <link>http://two8g.com/restful/api/2016/08/03/RESTful-API-DOCUMENT.html</link>
        <guid isPermaLink="true">http://two8g.com/restful/api/2016/08/03/RESTful-API-DOCUMENT.html</guid>
        
        <category>RESTful</category>
        
        <category>API</category>
        
        
        <category>RESTful</category>
        
        <category>API</category>
        
      </item>
    
      <item>
        <title>nexus repository</title>
        <description>&lt;h2 id=&quot;目录&quot;&gt;目录&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;#网页上传jar包&quot;&gt;网页上传jar包&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#maven发布jar&quot;&gt;maven发布jar&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#使用nexus私服&quot;&gt;使用nexus私服&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;网页上传jar包&quot;&gt;网页上传jar包&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/images/nexus.jpg&quot; alt=&quot;nexus.jpg&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;maven发布jar&quot;&gt;maven发布jar&lt;/h3&gt;

&lt;p&gt;(1).在maven的&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conf/setting.xml&lt;/code&gt;配置nexus私服的管理账号&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-XML&quot;&gt;&amp;lt;server&amp;gt;
    &amp;lt;id&amp;gt;nexus-releases&amp;lt;/id&amp;gt;
    &amp;lt;username&amp;gt;user&amp;lt;/username&amp;gt;
    &amp;lt;password&amp;gt;pwd&amp;lt;/password&amp;gt;
&amp;lt;/server&amp;gt;
&amp;lt;server&amp;gt;
    &amp;lt;id&amp;gt;nexus-snapshots&amp;lt;/id&amp;gt;
    &amp;lt;username&amp;gt;user&amp;lt;/username&amp;gt;
    &amp;lt;password&amp;gt;pwd&amp;lt;/password&amp;gt;
&amp;lt;/server&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;id可自己定义一个名称,下面代码中的id必须与之对应&lt;/p&gt;

&lt;p&gt;(2).在项目的pom.xml中配置&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-XML&quot;&gt;&amp;lt;distributionManagement&amp;gt;
    &amp;lt;repository&amp;gt;
        &amp;lt;id&amp;gt;nexus-releases&amp;lt;/id&amp;gt;
        &amp;lt;name&amp;gt;Nexus Release Repository&amp;lt;/name&amp;gt;
        &amp;lt;url&amp;gt;http://nexushost:28081/nexus/content/repositories/releases/&amp;lt;/url&amp;gt;
    &amp;lt;/repository&amp;gt;
    &amp;lt;snapshotRepository&amp;gt;
        &amp;lt;id&amp;gt;nexus-snapshots&amp;lt;/id&amp;gt;
        &amp;lt;name&amp;gt;Nexus Snapshot Repository&amp;lt;/name&amp;gt;
        &amp;lt;url&amp;gt;http://nexushost:28081/nexus/content/repositories/snapshots/&amp;lt;/url&amp;gt;
    &amp;lt;/snapshotRepository&amp;gt;
&amp;lt;/distributionManagement&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(3).&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mvn deploy&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;在已经打包好的项目目录下运行&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mvn deploy&lt;/code&gt;发布jar到nexus服务&lt;/p&gt;

&lt;h3 id=&quot;使用nexus私服&quot;&gt;使用nexus私服&lt;/h3&gt;

&lt;p&gt;(1).在maven的&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conf/setting.xml&lt;/code&gt;的mirrors下配置nexus私服&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-XML&quot;&gt;&amp;lt;mirrors&amp;gt;
    &amp;lt;mirror&amp;gt;
      &amp;lt;id&amp;gt;nexus-central&amp;lt;/id&amp;gt;
      &amp;lt;mirrorOf&amp;gt;*&amp;lt;/mirrorOf&amp;gt;
      &amp;lt;url&amp;gt;http://nexushost:28081/nexus/content/repositories/central/&amp;lt;/url&amp;gt;
    &amp;lt;/mirror&amp;gt;
    &amp;lt;mirror&amp;gt;
      &amp;lt;id&amp;gt;nexus-releases&amp;lt;/id&amp;gt;
      &amp;lt;mirrorOf&amp;gt;*&amp;lt;/mirrorOf&amp;gt;
      &amp;lt;url&amp;gt;http://nexushost:28081/nexus/content/repositories/releases/&amp;lt;/url&amp;gt;
    &amp;lt;/mirror&amp;gt;
    &amp;lt;mirror&amp;gt;
      &amp;lt;id&amp;gt;nexus-snapshots&amp;lt;/id&amp;gt;
      &amp;lt;mirrorOf&amp;gt;*&amp;lt;/mirrorOf&amp;gt;
      &amp;lt;url&amp;gt;http://nexushost:28081/nexus/content/repositories/snapshots/&amp;lt;/url&amp;gt;
    &amp;lt;/mirror&amp;gt;
&amp;lt;/mirrors&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;其中central是个代理镜像仓库,默认路由映射到maven中央仓库,当下载中央仓库资源后会存储到该镜像仓库中&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Repository ID: central
Repository Name: Central
Repository Type: proxy
Repository Policy: Release
Repository Format: maven2
Contained in groups: 
   Public Repositories
Remote URL: https://repo1.maven.org/maven2/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;或者使用一个public mirror url代替&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-XML&quot;&gt;&amp;lt;mirror&amp;gt;
  &amp;lt;id&amp;gt;nexus-central&amp;lt;/id&amp;gt;
  &amp;lt;mirrorOf&amp;gt;*&amp;lt;/mirrorOf&amp;gt;
  &amp;lt;url&amp;gt;http://nexushost:28081/nexus/content/groups/public/&amp;lt;/url&amp;gt;
&amp;lt;/mirror&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(1’)或者通过mirrors和profiles配置私服&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-XML&quot;&gt;&amp;lt;mirrors&amp;gt;
    &amp;lt;mirror&amp;gt;
      &amp;lt;id&amp;gt;central&amp;lt;/id&amp;gt;
      &amp;lt;mirrorOf&amp;gt;*&amp;lt;/mirrorOf&amp;gt;
      &amp;lt;name&amp;gt;Human Readable Name for this Mirror.&amp;lt;/name&amp;gt;
      &amp;lt;url&amp;gt;http://localhost:8081/nexus/content/groups/public/&amp;lt;/url&amp;gt;
    &amp;lt;/mirror&amp;gt;
&amp;lt;/mirrors&amp;gt;
&amp;lt;profiles&amp;gt;
    &amp;lt;profile&amp;gt;
      &amp;lt;id&amp;gt;nexus&amp;lt;/id&amp;gt;
      &amp;lt;repositories&amp;gt;
        &amp;lt;repository&amp;gt;
          &amp;lt;id&amp;gt;nexus&amp;lt;/id&amp;gt;
          &amp;lt;name&amp;gt;Nexus&amp;lt;/name&amp;gt;
          &amp;lt;url&amp;gt;http://localhost:8081/nexus/content/groups/public/&amp;lt;/url&amp;gt;
            &amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;releases&amp;gt;
            &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;
          &amp;lt;/releases&amp;gt;
          &amp;lt;snapshots&amp;gt;
            &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;
          &amp;lt;/snapshots&amp;gt;
        &amp;lt;/repository&amp;gt;
      &amp;lt;/repositories&amp;gt;
    &amp;lt;/profile&amp;gt;
&amp;lt;/profiles&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(1’‘)或者在POM中配置Nexus私服&lt;/p&gt;

&lt;p&gt;这样的配置只对当前的Maven项目有效&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-XML&quot;&gt;&amp;lt;repositories&amp;gt;
  &amp;lt;repository&amp;gt;
      &amp;lt;id&amp;gt;nexus&amp;lt;/id&amp;gt;
      &amp;lt;name&amp;gt;Nexus Repository&amp;lt;/name&amp;gt;
      &amp;lt;url&amp;gt;http://nexushost:28081/nexus/content/groups/public/&amp;lt;/url&amp;gt;
      &amp;lt;releases&amp;gt;
          &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;
      &amp;lt;/releases&amp;gt;
      &amp;lt;snapshots&amp;gt;
          &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;
      &amp;lt;/snapshots&amp;gt;
  &amp;lt;/repository&amp;gt;
&amp;lt;/repositories&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(2).在pom下配置依赖即可&lt;/p&gt;

&lt;p&gt;参考博客:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://tianweili.github.io/blog/2015/03/17/linux-nexus-maven-private-server/&quot;&gt;http://tianweili.github.io/blog/2015/03/17/linux-nexus-maven-private-server/&lt;/a&gt;
&lt;a href=&quot;http://my.oschina.net/liangbo/blog/195739&quot;&gt;http://my.oschina.net/liangbo/blog/195739&lt;/a&gt;
&lt;a href=&quot;http://www.cnblogs.com/quanyongan/archive/2013/04/24/3037589.html&quot;&gt;http://www.cnblogs.com/quanyongan/archive/2013/04/24/3037589.html&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Fri, 15 Apr 2016 00:00:00 +0000</pubDate>
        <link>http://two8g.com/nexus/2016/04/15/nexus-repository.html</link>
        <guid isPermaLink="true">http://two8g.com/nexus/2016/04/15/nexus-repository.html</guid>
        
        <category>nexus</category>
        
        <category>maven</category>
        
        <category>java</category>
        
        
        <category>nexus</category>
        
      </item>
    
      <item>
        <title>Logstash and ELK</title>
        <description>&lt;h1 id=&quot;lagstash笔记1&quot;&gt;lagstash笔记(1)&lt;/h1&gt;

&lt;h2 id=&quot;download&quot;&gt;download&lt;/h2&gt;

&lt;p&gt;https://www.elastic.co/downloads/logstash&lt;/p&gt;

&lt;h2 id=&quot;documents&quot;&gt;documents&lt;/h2&gt;

&lt;p&gt;https://www.elastic.co/guide/en/logstash/current/index.html&lt;/p&gt;

&lt;h2 id=&quot;first-tasted&quot;&gt;first tasted&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bin/logstash -e 'input { stdin { } } output { stdout {} }'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Settings: Default pipeline workers: 4
Logstash startup completed
I'm two8g
2016-03-26T02:52:03.667Z two8gPC I'm two8g
Hello logstash
2016-03-26T02:52:21.417Z two8gPC Hello logstash
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Logstash adds timestamp and IP address information to the message. Exit
Logstash by issuing a CTRL-D&lt;/p&gt;

&lt;h2 id=&quot;setting-up-an-advanced-logstash-pipeline&quot;&gt;Setting Up an Advanced Logstash Pipeline&lt;/h2&gt;

&lt;p&gt;Logstash 管道流包含一个或多个input,filter,output插件集合 Logstash
配置文件定义管道流。当启动一个Logstash实例时，使用 -f &amp;lt;path/to/file&amp;gt;
指定配置文件来设置管道流。&lt;/p&gt;

&lt;p&gt;一个Logstash管道流有两个必选响input，output，一个可选项filter. input plugins:
consume data from a source filter plugins: modify the data as you
specify the output: plugins write the data to a destination&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/ELK/logstash/basic_logstash_pipeline.png&quot; alt=&quot;pipeline&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;parsing-apache-logs-into-elasticsearch&quot;&gt;Parsing Apache Logs into Elasticsearch&lt;/h2&gt;

&lt;h3 id=&quot;configuring-logstash-for-file-input&quot;&gt;Configuring Logstash for File Input&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;first-pipeline.conf&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;input {
     file {
         path =&amp;gt; &quot;/path/to/logstash-tutorial.log&quot;
         start_position =&amp;gt; beginning ①
         ignore_older =&amp;gt; 0 ②
     }
 }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;① 设置数据读取的起始位置，默认监控新数据行，like tail -f.&lt;/p&gt;

&lt;p&gt;② 默认忽略最后修改时间超过86400s，或许我们不想忽略如何文件&lt;/p&gt;

&lt;h3 id=&quot;parsing-web-logs-with-the-grok-filter-plugin&quot;&gt;Parsing Web Logs with the Grok Filter Plugin&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grok&lt;/code&gt; 是 Logstash 默认支持的filter插件之一。相关插件文档：
https://www.elastic.co/guide/en/logstash/current/working-with-plugins.html&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grok&lt;/code&gt; 查找日志中的 patterns , 需要你配置你想要搜集的 patterns。&lt;/p&gt;

&lt;p&gt;日志&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] &quot;GET /presentations/logstash-monitorama-2013/images/kibana-search.png
 HTTP/1.1&quot; 200 203023 &quot;http://semicomplete.com/presentations/logstash-monitorama-2013/&quot; &quot;Mozilla/5.0 (Macintosh; Intel
 Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;Information&lt;/th&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;Field Name&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;IP Address&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;clientip&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;User ID&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;ident&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;User Authentication&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;auth&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;timestamp&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;timestamp&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;HTTP Verb&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;verb&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;Request body&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;request&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;HTTP Version&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;httpversion&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;HTTP Status Code&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;response&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;Bytes served&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;bytes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;Referrer URL&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;referrer&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;User agent&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;agent&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;配置filter&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;filter {
     grok {
         match =&amp;gt; { &quot;message&quot; =&amp;gt; &quot;%{COMBINEDAPACHELOG}&quot;}
     }
 }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;过滤后结果&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-JSON&quot;&gt;{
 &quot;clientip&quot; : &quot;83.149.9.216&quot;,
 &quot;ident&quot; : ,
 &quot;auth&quot; : ,
 &quot;timestamp&quot; : &quot;04/Jan/2015:05:13:42 +0000&quot;,
 &quot;verb&quot; : &quot;GET&quot;,
 &quot;request&quot; : &quot;/presentations/logstash-monitorama-2013/images/kibana-search.png&quot;,
 &quot;httpversion&quot; : &quot;HTTP/1.1&quot;,
 &quot;response&quot; : &quot;200&quot;,
 &quot;bytes&quot; : &quot;203023&quot;,
 &quot;referrer&quot; : &quot;http://semicomplete.com/presentations/logstash-monitorama-2013/&quot;,
 &quot;agent&quot; : &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36&quot;
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;indexing-parsed-data-into-elasticsearch&quot;&gt;Indexing Parsed Data into Elasticsearch&lt;/h2&gt;
</description>
        <pubDate>Sat, 26 Mar 2016 00:00:00 +0000</pubDate>
        <link>http://two8g.com/elk/2016/03/26/logstash-elk.html</link>
        <guid isPermaLink="true">http://two8g.com/elk/2016/03/26/logstash-elk.html</guid>
        
        <category>Logstash</category>
        
        <category>日志</category>
        
        <category>ELK</category>
        
        
        <category>ELK</category>
        
      </item>
    
      <item>
        <title>java version</title>
        <description>&lt;h1 id=&quot;java-版本介绍&quot;&gt;JAVA 版本介绍&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;#Java SE&quot;&gt;Java SE&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#Java EE&quot;&gt;Java EE&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#Java ME&quot;&gt;Java ME&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#Java EA&quot;&gt;Java EA&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;java-se&quot;&gt;Java SE&lt;/h2&gt;

&lt;p&gt;Java平台标准版本，又称J2SE。&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers, as well as in today's demanding embedded environments. Java offers the rich user interface, performance, versatility, portability, and security that today's applicationsrequire.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;java-ee&quot;&gt;Java EE&lt;/h2&gt;

&lt;p&gt;Java平台企业版本，又称J2EE。&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Java Platform, Enterprise Edition (Java EE) is the standard in community-driven enterprise software. Java EE is developed using the Java Community Process, with contributions from industry experts, commercial and open source organizations, Java User Groups, and countless individuals. Each release integrates new features that align with industry needs, improves application portability, and increases developer productivity.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;java-me&quot;&gt;Java ME&lt;/h2&gt;

&lt;p&gt;Java平台微小版本，又称J2ME。&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Java Platform, Micro Edition (Java ME) provides a robust, flexible environment for applications running on embedded and mobile devices in the Internet of Things: micro-controllers, sensors, gateways, mobile phones, personal digital assistants (PDAs), TV set-top boxes, printers and more. Java ME includes flexible user interfaces, robust security, built-in network protocols, and support for networked and offline applications that can be downloaded dynamically. Applications based on Java ME are portable across many devices, yet leverage each device's native capabilities. 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;java-ea&quot;&gt;JAVA EA&lt;/h2&gt;

&lt;p&gt;java 平台预览版本。EA 代表“提前获取”(Early Access)，也就是说，EA
是软件即将发布的版本的预览版本。&lt;/p&gt;
</description>
        <pubDate>Tue, 22 Mar 2016 14:45:25 +0000</pubDate>
        <link>http://two8g.com/java/2016/03/22/java_versions.html</link>
        <guid isPermaLink="true">http://two8g.com/java/2016/03/22/java_versions.html</guid>
        
        
        <category>JAVA</category>
        
      </item>
    
  </channel>
</rss>
