將Java進行到底
          將Java進行到底
          posts - 15,  comments - 66,  trackbacks - 0
          昨天發現缺陷管理工具JIRA,目前版本是3.3.3,安裝使用了一下。感覺很好。
          下載地址:http://www.atlassian.com/software/jira/
          我下載的是JIRA Enterprise: Evaluation版本,同時申請一個30的Licence。
          破解比較簡單,有關Licence的代碼在atlassian-extras-0.7.10.jar中。
          1、反編譯包中的文件:com.atlassian.license.DefaultLicense.class。改成下面:
          // Decompiled by DJ v3.8.8.85 Copyright 2005 Atanas Neshkov  Date: 2005-11-5 17:41:28
          // Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
          // Decompiler options: packimports(3)
          // Source File Name:   DefaultLicense.java

          package com.atlassian.license;

          import java.util.*;

          // Referenced classes of package com.atlassian.license:
          //            License, LicenseType

          public class DefaultLicense
              
          implements License
          {

              
          public DefaultLicense(Date dateCreated, Date datePurchased, String organisation, LicenseType licenseType, int users)
              
          {
                  
          this.dateCreated = dateCreated;
                  
          this.datePurchased = datePurchased;
                  
          this.organisation = organisation;
                  
          this.licenseType = licenseType;
                  
          this.users = users;
              }


              
          public Date getDateCreated()
              
          {
                  
          return dateCreated;
              }


              
          public Date getDatePurchased()
              
          {
                  
          return datePurchased;
              }


              
          public String getOrganisation()
              
          {
                  
          return organisation;
              }


              
          public LicenseType getLicenseType()
              
          {
                  
          return licenseType;
              }


              
          public String toString()
              
          {
                  
          return licenseType.getNiceName() + " licensed to " + organisation;
              }


              
          public boolean isExpired()
              
          {
                  
          return false;

              }


              
          public Date getExpiryDate()
              
          {
                  
          return null;
              }


              
          public boolean isLicenseLevel(Collection levels)
              
          {
                  
          for(Iterator iterator = levels.iterator(); iterator.hasNext();)
                  
          {
                      String level 
          = (String)iterator.next();
                      
          if(getLicenseType().getDescription().toLowerCase().indexOf(level.toLowerCase()) != -1)
                          
          return true;
                  }


                  
          return false;
              }


              
          public int getUsers()
              
          {
                  
          if(licenseType.requiresUserLimit())
                      
          return users;
                  
          else
                      
          return -1;
              }


              
          public static long EVALUATION_PERIOD = 0x9fa52400L;
              
          protected Date dateCreated;
              
          protected Date datePurchased;
              
          protected String organisation;
              
          protected LicenseType licenseType;
              
          private int users;

          }


          其實就該了兩個方法:

              public boolean isExpired()
              
          {
                  
          return false;

              }


              
          public Date getExpiryDate()
              
          {
                  
          return null;
              }

          2、把編譯好的class文件復制到atlassian-extras-0.7.10.jar中,覆蓋原來文件。
          3、啟動服務器,成功。
          我把我破解后的class附上:http://www.aygfsteel.com/Files/freddychu/DefaultLicense.zip。
          如果不能下,請留下email.

          posted @ 2005-11-05 18:18 風蕭蕭 閱讀(7550) | 評論 (51)編輯 收藏
          Apache的網站  http://www.apache.org/ 訪問不了,我正在看xmlBean啊。難道沒錢請網管?呵呵 ^_^
          posted @ 2005-10-27 20:30 風蕭蕭 閱讀(1122) | 評論 (0)編輯 收藏
          這周嘗試使用了一下Acegi安全框架,有了些膚淺的認識。
          1、這個框架還需要不斷完善,而且這個項目也在不斷進行中。比如:看到以前的例子,版本是0.6的,需要在web.xml里配置多個filter,到了0.8.3,就只要配置一個filter,把以前的多個filter移到了spring的配置文件中實現了。還有userCache的實現也變化了。
          2、配置還是有些復雜。在spring的配置文件里要寫不少bean。參見 整合前臺技術acegi+spring+struts
          3、如何實現角色的動態定義,我還沒找到相關實現,似乎目前不支持。
          4、存放用戶信息在表users,授權信息放在authorities表。在我們實際開發當中往往這兩個表非常大,字段很多。這里就需要做些適當的擴展咯。

          這個框架整體還是非常靈活的,值得我們在些輕量級的應用中使用。
          posted @ 2005-10-27 12:58 風蕭蕭 閱讀(1460) | 評論 (3)編輯 收藏
          Acegi是Spring的一個擴展框架,專注于解決應用中的安全問題。
          今天花了一下午加一晚上,終于做了一個基于Acegi的自己的HelloWorld。
          感覺在RDBMS的認證方式的擴展上有些不靈活。默認是基于開源的數據庫HSQLDB的,實現這個機制的是JdbcDaoImpl.java類??戳藄ourcecode,發現類里面寫死了兩個SQL語句:
              public static final String DEF_USERS_BY_USERNAME_QUERY = "SELECT username,password,enabled FROM users WHERE username = ?";
              public static final String DEF_AUTHORITIES_BY_USERNAME_QUERY = "SELECT username,authority FROM authorities WHERE username = ?";

          相關代碼沒進一步看,發現有幾個Polo類,如User.java和上面的語句對應,所以,這個語句的字段不能隨便改。JdbcDaoImpl類的源代碼建議通過繼承來擴展,我覺得不是很好,應為Sql語句在父類里寫死了。在實際應用中,users表結構比這復雜的多。
          想抽空,重新寫一個JdbcDaoImp類,替換一下。
          posted @ 2005-10-24 00:23 風蕭蕭 閱讀(806) | 評論 (2)編輯 收藏
          夜已深,網上閑逛,看到竟然有個Java的Blog群,實在太好了,這下不用老看新浪了。哈哈。
          posted @ 2005-10-20 23:12 風蕭蕭 閱讀(309) | 評論 (0)編輯 收藏
          僅列出標題
          共2頁: 上一頁 1 2 

          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(8)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          相冊

          收藏夾

          myfriends

          opensource

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 肃宁县| 靖安县| 滨海县| 邳州市| 曲周县| 遂昌县| 玉溪市| 腾冲县| 白水县| 平谷区| 乐东| 太和县| 峡江县| 晋江市| 四会市| 海宁市| 大兴区| 丹凤县| 佛山市| 栖霞市| 藁城市| 蒲城县| 汽车| 武胜县| 岱山县| 东丽区| 新野县| 德惠市| 河源市| 迁西县| 阜南县| 封开县| 介休市| 江山市| 汉寿县| 泸水县| 彰化市| 左权县| 临西县| 斗六市| 聂拉木县|