2010-11-02 35 views
0

我可以轉儲一個性能在的JBoss 6個的一個目錄中文件的某處,並從類路徑把它撿起來?加載性能

甚至更​​好,有沒有人知道像$JBOSS_HOME/server/default/deploy/jboss-logging.xml配置文件背後的機制?對該文件的更改似乎觸發了一個事件,因此正在運行的實例可以處理修改(而不必反彈AS)。

回答

2

可能性是在./conf/jboss-service.xml中配置SystemPropertiesService

這允許您配置系統性能原地的,或從屬性加載它們文件:

<server> 
    <mbean code="org.jboss.varia.property.SystemPropertiesService" 
      name="jboss.util:type=Service,name=SystemProperties"> 

     <!-- Load properties from each of the given comma seperated URLs --> 
     <attribute name="URLList"> 
      http://somehost/some-location.properties, 
      ./conf/somelocal.properties 
     </attribute> 

     <!-- Set propertuies using the properties file style. --> 
     <attribute name="Properties"> 
      property1=This is the value of my property 
      property2=This is the value of my other property 
     </attribute> 

    </mbean> 
</server> 

有關詳細信息,請參閱:http://docs.jboss.org/jbossas/admindevel326/html/ch10.html

0

在JBoss中,6用途:./deploy/properties-service.xml

1

在JBoss EAP 6(AS 7)中,它們使這更加容易。

  1. 傳遞屬性文件作爲啓動參數

這可以在主啓動腳本中添加或參數

./standalone.sh --properties=/Users/john.galt/dev/config/ds/jboss.properties 

如果這些屬性被讀取,它們將在渲染傳遞服務器日誌作爲第一條語句。

3:58:41,633 DEBUG [org.jboss.as.config] (MSC service thread 1-6) Configured system properties: 
     DSsettings.password = password 
     DSsettings.user-name = admin 
     DSsettings.connection-url = jdbc:oracle:fat:@activedb:1521:DEV 
     [Standalone] = 
     awt.nativeDoubleBuffering = true 

注:由於這些設置是在服務器日誌中記錄,確保無明文密碼是在屬性文件中的生產

  • 使用在系統屬性 通過您可以使用以下語法使用這些系統屬性。在數據源 實施例使用文件

    <xa-datasource jndi-name="java:jboss/ds" pool-name="cPool" jta="true" enabled="true" use-ccm="true"> 
        <xa-datasource-property name="URL"> 
    
         ${DSsettings.connection_url} 
    
        </xa-datasource-property> 
    
        <driver>oracle</driver> 
        ... 
        <security> 
    
         <user-name>${DSsettings.user-name}</user-name> 
    
         <password>${DSsettings.password}</password> 
    
        </security> 
        ... 
    
    </xa-datasource>