<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 88, comments - 3, trackbacks - 0, articles - 0
      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

    介紹centos7如何安裝3.0以上的新版本mongodb
    https://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat/

    posted @ 2016-03-23 10:14 Milo的海域 閱讀(185) | 評論 (0)編輯 收藏

    1. 默認的3個classloader: BootstrapClassloader (Native實現), ExtClassloader, AppClassloader (Java實現)
    2. 3個加載器并不是真正的父子繼承關系,而是邏輯上的,JVM啟動先創建ExtClassloader instance,然后構造AppClassloader的時候傳入ExtClassloader實例作為parent
            Launcher.ExtClassLoader extcl;
            
    try {
                extcl 
    = Launcher.ExtClassLoader.getExtClassLoader();
            } 
    catch (IOException var10) {
                
    throw new InternalError("Could not create extension class loader", var10);
            }

            
    try {
                
    this.loader = Launcher.AppClassLoader.getAppClassLoader(extcl);
            } 
    catch (IOException var9) {
                
    throw new InternalError("Could not create application class loader", var9);
            }

    關于雙親委派原理: 在加載類的時候,會看看parent有沒有設定,如果設定了 就調用parent.loadClass方法,如果沒設定(==null)也就是parent應該是BootstrapClassloader, 會調用native的findBootstrapClass來加載類,代碼:
                    try {
                        
    if(this.parent != null) {
                            c 
    = this.parent.loadClass(name, false);
                        } 
    else {
                            c 
    = this.findBootstrapClassOrNull(name);
                        }
                    } 
    catch (ClassNotFoundException var10) {
                        ;
                    }

    目的是按照一定優先級別裝載系統的lib,系統ext目錄的lib,以及classpath的lib,防止系統的默認行為或者類的實現被修改。

    3. java 類的動態加載
    Java內置的ClassLoader總會在加載一個Class之前檢查這個Class是否已經被加載過,已經被加載過的Class不會加載第二次。因此要想重新加載Class,我們需要實現自己的ClassLoader。
    另外一個問題是,每個被加載的Class都需要被鏈接(link),這是通過執行ClassLoader.resolve()來實現的,這個方法是 final的,因此無法重寫。Resove()方法不允許一個ClassLoader實例link一個Class兩次,因此,當你需要重新加載一個 Class的時候,你需要重新New一個你自己的ClassLoader實例。

    posted @ 2016-03-16 15:40 Milo的海域 閱讀(315) | 評論 (0)編輯 收藏


    maven-shade-plugin 用來打可執行jar包, 可以把所有依賴的三方庫都包括進來
    exec-maven-plugin 可以執行外部命令, 在項目中對python代碼進行編譯, 配合maven-assembly-plugin來生成package
    maven-assembly-plugin 用來構建項目發行包, 要配合xml配置文件來組織包的結構,基本思路是從build環境copy到outputDirectory
    license-maven-plugin 用來生成項目用到的3方庫的版權匯總 或者其他的一些用法
    maven-dependency-plugin 用來生成項目庫之間的依賴關系
    appassembler-maven-plugin 可以為項目生成優雅的啟動腳本 支持linux/win
    rpm-maven-plugin 用來為項目構建rpm安裝包
    maven-compiler-plugin 指定項目的jdk的編譯兼容版本以及encoding類別

    posted @ 2016-01-26 11:41 Milo的海域 閱讀(262) | 評論 (0)編輯 收藏

    快捷鍵migrating
    定位選中字符串下個匹配的位置
    eclipse: ctrl + k
    idea: ctrl + F3       

    eclipse: ctrl + q
    idea: ctrl + shift + backspace
    回到上一次編輯的位置

    持續更新

    posted @ 2015-11-25 16:46 Milo的海域 閱讀(123) | 評論 (0)編輯 收藏

    發現一個不錯的介紹shell中冒號的用法的文章
    http://codingstandards.iteye.com/blog/1160298

    posted @ 2015-11-09 15:11 Milo的海域 閱讀(244) | 評論 (0)編輯 收藏

    項目用mvn exec:exec指令來啟動server, 工作中需要調式server初始化的過程, 很容易想到mvnDebug, 但是發現設置的斷點都沒有hit, 反復調式多次都是如此,折騰了1個多小時, 突然看到stackoverflow 上有人說exec:exec是獨立進程模式, mvnDebug的一些debug選項都被append到了父進程了. idea設置斷點就然并卵了.

    知道了問題所在解決就容易了, 只要修改pom.xml, 然后直接mvn exec:exec就能正常調式了
                <build>
                    <plugins>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>exec-maven-plugin</artifactId>
                            <version>${mvnexec.version}</version>
                            <executions>
                                <execution>
                                    <goals>
                                        <goal>exec</goal>
                                    </goals>
                                </execution>
                            </executions>
                            <configuration>
                                <includeProjectDependencies>true</includeProjectDependencies>
                                <executable>java</executable>
                                <workingDirectory>${basedir}/config/sim</workingDirectory>
                                <classpathScope>runtime</classpathScope>
                                <arguments>
                                    <argument>-agentlib:jdwp
    =transport=dt_socket,server=y,suspend=y,address=4000</argument>
                                    <argument>-classpath</argument>
                                    <classpath/>
                                    <argument>com.ymiao.Main</argument>
                                    <argument>server</argument>
                                    <argument>${basedir}/config/sim/sim.yml</argument>
                                </arguments>
                            </configuration>
                        </plugin>
                    </plugins>
                </build>

    總結就是exec:exec是要獨立一個新進程來執行程序的, exec:java就相反, 其實用mvnDebug + exec:java也是理論可行的

    posted @ 2015-10-21 17:12 Milo的海域 閱讀(832) | 評論 (0)編輯 收藏

    After Centos 7.1 tobe installed on my t400, my wireless link "Intel 5100 AGN" cannot be managed by NetworkManager, which show in "PCI unknown" state.

    Googled many pages, most of them introduced how to scan wifi links by command line tool "iw", i tried all steps supplied by the pages but was blocked at the last step to get dynamical ipaddress by dhclient command "sudo dhclient wlp3s0 -v". The dhclient always complain "NO DHCPOFFERS received." (I doubted there should be some tricky to play with dhclient but which i am not faimiar with.. sad.. )

    But i think there would be some extending tool for NetworkManager to manager wifi, then i google "NetworkManager wifi", i got "NetwrokManager-wifi plugin" from link https://www.centos.org/forums/viewtopic.php?f=47&t=52810

    After following steps , i finally make wifi work well on centos 7.1

    • yum install NetworkManager-wifi
    • reboot machine (i tried logout and login, not work) 

    Problem is NetworkManager-wifi is not installed by default on centos 7.1, (would it be my mistake when install OS? strange..)

    posted @ 2015-09-17 10:41 Milo的海域 閱讀(390) | 評論 (1)編輯 收藏

    http://onlywei.github.io/explain-git-with-d3

    posted @ 2015-09-09 15:57 Milo的海域 閱讀(244) | 評論 (0)編輯 收藏

    項目中要用到MBean,于是快速體驗下,體驗過程中發現2個問題:

    1. 自定義的Mbean的普通method能在jconsole的Mbeans里顯示出來,但是涉及到geters/seters就無法顯示了
    2. 如果MBean注冊到下面形式創建的MBeanServer在Jconsole上無法顯示的
      MBeanServer server = MBeanServerFactory.createMBeanServer();
      但是如果注冊到下面的形式創建的Server在Jconsole上是可以顯示MBean的
      MBeanServer server = ManagementFactory.getPlatformMBeanServer();       

    stackoverflow上也有人發現這個問題

        http://stackoverflow.com/questions/7424009/mbeans-registered-to-mbean-server-not-showing-up-in-jconsole

    posted @ 2015-09-08 10:53 Milo的海域 閱讀(516) | 評論 (0)編輯 收藏

    http://www.ourd3js.com/wordpress/

    posted @ 2015-08-26 11:22 Milo的海域 閱讀(252) | 評論 (0)編輯 收藏

    僅列出標題
    共9頁: 上一頁 1 2 3 4 5 6 7 8 9 下一頁 
    主站蜘蛛池模板: 亚洲人成网站999久久久综合| 九九九国产精品成人免费视频| 四虎永久免费地址在线网站| 中文字幕的电影免费网站| 亚洲视频一区二区三区| 国产成人免费a在线资源| 国产午夜精品久久久久免费视| 亚洲人成电影网站久久| 久久久久久久亚洲精品| 1024免费福利永久观看网站| 免费夜色污私人影院网站电影 | 亚洲明星合成图综合区在线| 日韩免费无砖专区2020狼| 久久免费精彩视频| 黑人粗长大战亚洲女2021国产精品成人免费视频| 久久亚洲精品无码播放| 成年在线观看免费人视频草莓| 91视频精品全国免费观看| 亚洲国产成人久久综合| 亚洲人成电影在在线观看网色| 日本a级片免费看| 亚欧在线精品免费观看一区 | 四虎www免费人成| 99re6热视频精品免费观看| 男人免费视频一区二区在线观看 | 亚洲成a∨人片在无码2023| 久久精品国产亚洲av麻豆色欲| 免费一级毛片不卡在线播放| 精品国产sm捆绑最大网免费站| 成av免费大片黄在线观看| 在线亚洲精品视频| 中文字幕亚洲综合久久综合| 亚洲精品人成在线观看| 亚洲尤码不卡AV麻豆| 又粗又硬免费毛片| 免费看片免费播放| 在线a级毛片免费视频| 91久久青青草原线免费| 美女在线视频观看影院免费天天看| 免费中文字幕视频| 亚洲国产成人手机在线观看|