我可以转储一个性能在的JBoss 6个的一个目录中文件的某处,并从类路径把它捡起来?加载性能
甚至更好,有没有人知道像$JBOSS_HOME/server/default/deploy/jboss-logging.xml
配置文件背后的机制?对该文件的更改似乎触发了一个事件,因此正在运行的实例可以处理修改(而不必反弹AS)。
我可以转储一个性能在的JBoss 6个的一个目录中文件的某处,并从类路径把它捡起来?加载性能
甚至更好,有没有人知道像$JBOSS_HOME/server/default/deploy/jboss-logging.xml
配置文件背后的机制?对该文件的更改似乎触发了一个事件,因此正在运行的实例可以处理修改(而不必反弹AS)。
可能性是在./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
在JBoss中,6用途:./deploy/properties-service.xml
关于JBoss AS7 properties-service.xml不再存在,下面是解决方案:
在JBoss EAP 6(AS 7)中,它们使这更加容易。
这可以在主启动脚本中添加或参数
./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>