rboss 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/.gitignore +9 -0
  2. data/Gemfile +4 -0
  3. data/Rakefile +1 -0
  4. data/bin/jboss-profile +90 -0
  5. data/bin/twiddle +230 -0
  6. data/examples/jboss_profile/jbb_profile_1.yaml +32 -0
  7. data/examples/jboss_profile/jbb_profile_2.yaml +32 -0
  8. data/examples/jboss_profile/jboss_profile.yaml +7 -0
  9. data/examples/monitor/simple_monitor.rb +61 -0
  10. data/lib/rboss.rb +25 -0
  11. data/lib/rboss/component_processor.rb +177 -0
  12. data/lib/rboss/components/component.rb +52 -0
  13. data/lib/rboss/components/datasource.rb +198 -0
  14. data/lib/rboss/components/deploy_folder.rb +104 -0
  15. data/lib/rboss/components/hypersonic_replacer.rb +58 -0
  16. data/lib/rboss/components/jbossweb.rb +117 -0
  17. data/lib/rboss/components/jmx.rb +88 -0
  18. data/lib/rboss/components/mod_cluster.rb +81 -0
  19. data/lib/rboss/components/org/6.0/deploy_folder.rb +33 -0
  20. data/lib/rboss/components/org/jmx.rb +59 -0
  21. data/lib/rboss/components/profile_folder.rb +44 -0
  22. data/lib/rboss/components/resource.rb +53 -0
  23. data/lib/rboss/components/run_conf.rb +90 -0
  24. data/lib/rboss/components/run_conf.yaml +22 -0
  25. data/lib/rboss/components/service_script.rb +55 -0
  26. data/lib/rboss/components/slimming.rb +124 -0
  27. data/lib/rboss/components/soa-p/hypersonic_replacer.rb +79 -0
  28. data/lib/rboss/components/soa-p/jmx.rb +47 -0
  29. data/lib/rboss/components/xadatasource.rb +67 -0
  30. data/lib/rboss/file_processor.rb +107 -0
  31. data/lib/rboss/jboss_path.rb +53 -0
  32. data/lib/rboss/jboss_profile.rb +344 -0
  33. data/lib/rboss/resources/jboss_init_redhat.sh.erb +140 -0
  34. data/lib/rboss/resources/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml +282 -0
  35. data/lib/rboss/resources/mod_cluster.sar/mod_cluster-1.1.2.Final.jar +0 -0
  36. data/lib/rboss/resources/run.conf.erb +62 -0
  37. data/lib/rboss/twiddle.rb +25 -0
  38. data/lib/rboss/twiddle/base_monitor.rb +57 -0
  39. data/lib/rboss/twiddle/mbean.rb +82 -0
  40. data/lib/rboss/twiddle/monitor.rb +144 -0
  41. data/lib/rboss/twiddle/scanner.rb +92 -0
  42. data/lib/rboss/twiddle/twiddle.rb +71 -0
  43. data/lib/rboss/utils.rb +33 -0
  44. data/lib/rboss/version.rb +25 -0
  45. data/rboss.gemspec +20 -0
  46. data/test/datasource_test.rb +211 -0
  47. data/test/deploy_folder_test.rb +126 -0
  48. data/test/mbean_test.rb +53 -0
  49. data/test/test_helper.rb +124 -0
  50. data/test/test_suite.rb +35 -0
  51. metadata +109 -0
@@ -0,0 +1,140 @@
1
+ #!/bin/sh
2
+ #
3
+ # $Id: jboss_init_redhat.sh 99350 2010-01-13 17:05:27Z bshim $
4
+ #
5
+ # chkconfig: 345 90 10
6
+ # description: Initializes service jboss
7
+ #
8
+ # JBoss Control Script
9
+ #
10
+ # To use this script run it as root - it will switch to the specified user
11
+ #
12
+ # Here is a little (and extremely primitive) startup/shutdown script
13
+ # for RedHat systems. It assumes that JBoss lives in /usr/local/jboss,
14
+ # it's run by user 'jboss' and JDK binaries are in /usr/local/jdk/bin.
15
+ # All this can be changed in the script itself.
16
+ #
17
+ # Either modify this script for your requirements or just ensure that
18
+ # the following variables are set correctly before calling the script.
19
+ JBOSS_ADMIN_USER="<%= @config[:jmx_user] %>"
20
+ JBOSS_ADMIN_PWD="<%= @config[:jmx_password] %>"
21
+ #1099
22
+ JBOSS_JNP_PORT="<%= @config[:jnp_port] %>"
23
+
24
+ #define where jboss is - this is the directory containing directories log, bin, conf etc
25
+ #/opt/jboss
26
+ JBOSS_HOME=${JBOSS_HOME:-"<%= @config[:jboss_home] %>"}
27
+
28
+ #define the user under which jboss will run, or use 'RUNASIS' to run as the current user
29
+ JBOSS_USER=${JBOSS_USER:-"<%= @config[:jboss_user] %>"}
30
+
31
+ #make sure java is in your path
32
+ #/usr/java/default
33
+ JAVAPTH=${JAVAPTH:-"<%= @config[:java_path] %>"}
34
+
35
+ #configuration to use, usually one of 'minimal', 'default', 'all', 'production'
36
+ JBOSS_CONF=${JBOSS_CONF:-"<%= @config[:profile] %>"}
37
+
38
+ #if JBOSS_HOST specified, use -b to bind jboss services to that address
39
+ JBOSS_BIND_ADDR=${JBOSS_HOST:-"<%= @config[:bind_address] %>"}
40
+
41
+ #define the script to use to start jboss
42
+ JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF -b $JBOSS_BIND_ADDR"}
43
+
44
+ if [ "$JBOSS_USER" = "RUNASIS" ]; then
45
+ SUBIT=""
46
+ else
47
+ SUBIT="su - $JBOSS_USER -c "
48
+ fi
49
+
50
+ if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then
51
+ # ensure the file exists
52
+ touch $JBOSS_CONSOLE
53
+ if [ ! -z "$SUBIT" ]; then
54
+ chown $JBOSS_USER $JBOSS_CONSOLE
55
+ fi
56
+ fi
57
+
58
+ if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then
59
+ echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE"
60
+ echo "WARNING: ignoring it and using /dev/null"
61
+ JBOSS_CONSOLE="/dev/null"
62
+ fi
63
+
64
+ #define what will be done with the console log
65
+ JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"}
66
+
67
+ JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"
68
+
69
+ JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"$JBOSS_HOME/bin/shutdown.sh -s jnp://$JBOSS_BIND_ADDR:$JBOSS_JNP_PORT -u $JBOSS_ADMIN_USER -p '$JBOSS_ADMIN_PWD'"}
70
+
71
+
72
+ if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then
73
+ export PATH=$PATH:$JAVAPTH
74
+ fi
75
+
76
+ if [ ! -d "$JBOSS_HOME" ]; then
77
+ echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME
78
+ exit 1
79
+ fi
80
+
81
+ function jbossPID()
82
+ {
83
+ # try get the JVM PID
84
+ local jbossPID="x"
85
+ jbossPID=$(ps -eo pid,cmd | grep "org.jboss.Main" | grep "${JBOSS_BIND_ADDR} " | grep "${JBOSS_CONF}" | grep -v grep | cut -c1-6)
86
+
87
+ echo "$jbossPID"
88
+ }
89
+
90
+ stop() {
91
+ echo "stop JBoss (instance $JBOSS_CONF at $JBOSS_BIND_ADDR)..."
92
+
93
+ if [ -z "$SUBIT" ]; then
94
+ $JBOSS_CMD_STOP
95
+ else
96
+ echo "JBOSS_CMD_STOP = $JBOSS_CMD_STOP"
97
+ $SUBIT "$JBOSS_CMD_STOP"
98
+ fi
99
+
100
+ sleep 20
101
+
102
+ # try get the JVM PID
103
+ PID=$(jbossPID)
104
+ if [ "x$PID" = "x" ]
105
+ then
106
+ echo "JBoss (instance $JBOSS_CONF at $JBOSS_BIND_ADDR) stopped!"
107
+ else
108
+ echo "process still running..."
109
+ echo "killing JBoss (JVM process) [PID $PID]"
110
+ kill -9 $PID
111
+ fi
112
+ }
113
+
114
+ case "$1" in
115
+ start)
116
+
117
+ echo "Cleaning work and tmp..."
118
+ rm -rf $JBOSS_HOME/server/<%= @config[:profile] %>/work/*
119
+ rm -rf $JBOSS_HOME/server/<%= @config[:profile] %>/tmp/*
120
+
121
+ echo "JBOSS_CMD_START = $JBOSS_CMD_START"
122
+
123
+ cd $JBOSS_HOME/bin
124
+ if [ -z "$SUBIT" ]; then
125
+ eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &
126
+ else
127
+ $SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &"
128
+ fi
129
+ ;;
130
+ stop)
131
+ stop
132
+ ;;
133
+ restart)
134
+ $0 stop
135
+ $0 start
136
+ ;;
137
+ *)
138
+ echo "usage: $0 (start|stop|restart|help)"
139
+ esac
140
+
@@ -0,0 +1,282 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Beans that provide JBoss AS-side functionality for mod_cluster. These
4
+ beans are all "On Demand", i.e. that are not installed unless requested.
5
+ -->
6
+ <deployment xmlns="urn:jboss:bean-deployer:2.0">
7
+
8
+ <!-- Entry point: catalina lifecycle listener -->
9
+ <bean name="ModClusterListener" class="org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter">
10
+ <constructor>
11
+ <parameter class="org.jboss.modcluster.ContainerEventHandler"><inject bean="HAModClusterService"/></parameter>
12
+ <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
13
+ </constructor>
14
+ <depends>WebServer</depends>
15
+ </bean>
16
+
17
+ <!-- The core mod_cluster service -->
18
+ <bean name="ModClusterService" class="org.jboss.modcluster.ModClusterService" mode="On Demand">
19
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ModClusterServiceMBean.class)</annotation>
20
+ <constructor>
21
+ <parameter class="org.jboss.modcluster.config.ModClusterConfig"><inject bean="ModClusterConfig"/></parameter>
22
+ <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider"><inject bean="DynamicLoadBalanceFactorProvider"/></parameter>
23
+ </constructor>
24
+ </bean>
25
+
26
+ <!-- The core mod_cluster service, implemented as an HA singleton -->
27
+ <bean name="HAModClusterService" class="org.jboss.modcluster.ha.HAModClusterService" mode="On Demand">
28
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ha.HAModClusterServiceMBean.class)</annotation>
29
+ <constructor>
30
+ <parameter class="org.jboss.modcluster.config.ha.HAModClusterConfig"><inject bean="ModClusterConfig"/></parameter>
31
+ <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider"><inject bean="DynamicLoadBalanceFactorProvider"/></parameter>
32
+ <parameter class="org.jboss.ha.framework.interfaces.HAPartition"><inject bean="HAPartition"/></parameter>
33
+ <parameter class="org.jboss.ha.framework.interfaces.HASingletonElectionPolicy"><bean class="org.jboss.ha.singleton.HASingletonElectionPolicySimple"/></parameter>
34
+ </constructor>
35
+ </bean>
36
+
37
+ <!-- Configure this node's communication with the load balancer -->
38
+ <bean name="ModClusterConfig" class="org.jboss.modcluster.config.ha.HAModClusterConfig" mode="On Demand">
39
+
40
+ <!-- Comma separated list of address:port listing the httpd servers
41
+ where mod_cluster is running. -->
42
+ <property name="proxyList">${jboss.mod_cluster.proxyList,jboss.modcluster.proxyList:}</property>
43
+ <!-- URL prefix to send with commands to mod_cluster. Default is no prefix. -->
44
+ <!--property name="proxyURL"></property-->
45
+
46
+ <!-- mod_advertise is a small httpd module that advertises the
47
+ availability of httpd servers via multicast, allowing
48
+ ModClusterService to discover the httpd front-end instead of/in
49
+ addition to having them defined in proxyList. -->
50
+ <!-- Whether to listen for advertise messages -->
51
+ <property name="advertise">${jboss.mod_cluster.advertise:true}</property>
52
+ <!-- Multicast address on which to listen for advertisements -->
53
+ <property name="advertiseGroupAddress">${jboss.mod_cluster.advertise.address,jboss.modcluster.advertise.address,jboss.partition.udpGroup:224.0.1.105}</property>
54
+ <!-- Port to listen to for advertisements -->
55
+ <property name="advertisePort">${jboss.mod_cluster.advertise.port,jboss.modcluster.advertise.port:23364}</property>
56
+
57
+ <!-- Comma delimited list of contexts that should *not* be auto-registered with httpd. -->
58
+ <!-- ROOT indicates the root context. -->
59
+ <!-- Context may be qualified by host using a colon, e.g. host1:context1 -->
60
+ <!-- If no host is defined, localhost is assumed. -->
61
+ <property name="excludedContexts">${jboss.mod_cluster.excludedContexts,jboss.modcluster.excludedContexts:ROOT,admin-console,invoker,jbossws,jmx-console,juddi,web-console}</property>
62
+ <property name="autoEnableContexts">${jboss.mod_cluster.autoEnableContexts:true}</property>
63
+
64
+ <!-- Security key the proxy is going to send with advertise messages.
65
+ Default is none. -->
66
+ <!--property name="advertiseSecurityKey"></property-->
67
+
68
+ <!-- Whether to use SSL to communicate with mod_cluster. Note this
69
+ has nothing to do with handling of https requests by JBoss Web -->
70
+ <property name="ssl">false</property>
71
+
72
+ <!-- Configuration values for the load balancer itself (must be the
73
+ same on all nodes in the cluster). These will be passed to the
74
+ load balancer. -->
75
+ <property name="stickySession">true</property>
76
+ <property name="stickySessionForce">false</property>
77
+ <property name="stickySessionRemove">false</property>
78
+ <property name="maxAttempts">1</property>
79
+ <property name="workerTimeout">-1</property>
80
+ </bean>
81
+
82
+ <!-- Provides information to ModClusterService informing it how much load
83
+ this server should take. This impl calculates load factor from a
84
+ number of metrics and adjusts the value periodically based on runtime
85
+ conditions, using to the JBossWeb engine's backgroundProcessorDelay. -->
86
+ <bean name="DynamicLoadBalanceFactorProvider" class="org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider" mode="On Demand">
87
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor",exposedInterface=org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProviderMBean.class)</annotation>
88
+ <constructor>
89
+ <parameter>
90
+ <!-- Define the load metrics to use in your load balance factor calculation here -->
91
+ <set elementClass="org.jboss.modcluster.load.metric.LoadMetric">
92
+ <inject bean="BusyConnectorsLoadMetric"/>
93
+ <inject bean="HeapMemoryUsageLoadMetric"/>
94
+ </set>
95
+ </parameter>
96
+ </constructor>
97
+ <!-- The number of historical load values used to determine load factor -->
98
+ <!--property name="history">9</property-->
99
+ <!-- The exponential decay factor for historical load values -->
100
+ <!--property name="decayFactor">2</property-->
101
+ </bean>
102
+
103
+ <!-- Default load metrics/sources -->
104
+ <!-- The JBossWeb connector thread pool usage as a ratio of busy threads to max thread pool size -->
105
+ <!-- Analogous to method=B in mod_jk -->
106
+ <bean name="BusyConnectorsLoadMetric" class="org.jboss.modcluster.load.metric.impl.BusyConnectorsLoadMetric" mode="On Demand">
107
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=BusyConnectors",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
108
+ <constructor>
109
+ <parameter><inject bean="ThreadPoolLoadMetricSource"/></parameter>
110
+ </constructor>
111
+ <!-- The weight determines the significance of this metric with respect
112
+ to others in the overall load balance factor calculation -->
113
+ <property name="weight">2</property>
114
+ </bean>
115
+ <!-- Queries all JBossWeb ThreadPool mbeans -->
116
+ <bean name="ThreadPoolLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.ThreadPoolLoadMetricSource" mode="On Demand">
117
+ <constructor>
118
+ <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
119
+ <!-- Object name pattern for connector thread pools -->
120
+ <!--parameter>jboss.web:type=ThreadPool,*</parameter-->
121
+ </constructor>
122
+ </bean>
123
+
124
+ <!-- The heap memory usage as a ratio of used heap to max heap size -->
125
+ <!-- N.B. This load metric is its own source -->
126
+ <bean name="HeapMemoryUsageLoadMetric" class="org.jboss.modcluster.load.metric.impl.HeapMemoryUsageLoadMetric" mode="On Demand">
127
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=HeapMemoryUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
128
+ <!--property name="weight">1</property-->
129
+ </bean>
130
+
131
+
132
+ <!-- Alternative load balance factor providers -->
133
+
134
+ <!-- Basic impl that returns a static load balance factor.
135
+ This would replace the DynamicLoadBalanceFactorProvider
136
+ used above.
137
+ -->
138
+ <bean name="SimpleLoadBalanceFactorProvider" class="org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProvider" mode="On Demand">
139
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor",exposedInterface=org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProviderMBean.class)</annotation>
140
+ <property name="loadBalanceFactor">1</property>
141
+ </bean>
142
+
143
+ <!--
144
+ Alternative load metrics, grouped by source.
145
+ To use these, inject them into the set passed to the
146
+ DynamicLoadBalanceFactorProvider bean's constructor above.
147
+ -->
148
+
149
+ <!-- CPU usage -->
150
+ <!-- Perhaps the best metric for determining system load - but only available on Java 1.6 or later -->
151
+ <bean name="AverageSystemLoadMetric" class="org.jboss.modcluster.load.metric.impl.AverageSystemLoadMetric" mode="On Demand">
152
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=AverageSystemLoad",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
153
+ <constructor>
154
+ <parameter><inject bean="OperatingSystemLoadMetricSource"/></parameter>
155
+ </constructor>
156
+ </bean>
157
+ <!-- The system memory usage as ratio of used memory to total memory size -->
158
+ <!-- Requires com.sun.management.OperatingSystemMXBean, i.e. Sun or OpenJDK JVM -->
159
+ <bean name="SystemMemoryUsageLoadMetric" class="org.jboss.modcluster.load.metric.impl.SystemMemoryUsageLoadMetric" mode="On Demand">
160
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=SystemMemoryUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
161
+ <constructor>
162
+ <parameter><inject bean="OperatingSystemLoadMetricSource"/></parameter>
163
+ </constructor>
164
+ </bean>
165
+ <!-- Uses the platform's OperatingSystemMXBean -->
166
+ <bean name="OperatingSystemLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.OperatingSystemLoadMetricSource" mode="On Demand">
167
+ </bean>
168
+
169
+
170
+ <!-- The number of requests/sec processed by the JBossWeb connectors, with respect to the defined capacity -->
171
+ <!-- Analogous to method=R in mod_jk -->
172
+ <bean name="RequestCountLoadMetric" class="org.jboss.modcluster.load.metric.impl.RequestCountLoadMetric" mode="On Demand">
173
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=RequestCount",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
174
+ <constructor>
175
+ <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource"><inject bean="RequestProcessorLoadMetricSource"/></parameter>
176
+ <!--parameter>requestCount</parameter-->
177
+ </constructor>
178
+ <!-- This metric requires an explicit capacity, e.g. maximum capacity of 1000 requests/sec -->
179
+ <property name="capacity">1000</property>
180
+ </bean>
181
+ <!-- The incoming traffic received by JBossWeb connectors in KB/sec, with respect to the defined capacity -->
182
+ <!-- Analogous to method=T in mod_jk -->
183
+ <bean name="ReceiveTrafficLoadMetric" class="org.jboss.modcluster.load.metric.impl.ReceiveTrafficLoadMetric" mode="On Demand">
184
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ReceiveTraffic",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
185
+ <constructor>
186
+ <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource"><inject bean="RequestProcessorLoadMetricSource"/></parameter>
187
+ <!--parameter>bytesReceived</parameter-->
188
+ </constructor>
189
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 1024 KB/s -->
190
+ <property name="capacity">1024</property>
191
+ </bean>
192
+ <!-- The outgoing traffic sent by JBossWeb connectors in KB/sec, with respect to the defined capacity -->
193
+ <bean name="SendTrafficLoadMetric" class="org.jboss.modcluster.load.metric.impl.SendTrafficLoadMetric" mode="On Demand">
194
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=SendTraffic",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
195
+ <constructor>
196
+ <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource"><inject bean="RequestProcessorLoadMetricSource"/></parameter>
197
+ <!--parameter>bytesSent</parameter-->
198
+ </constructor>
199
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 512 KB/s -->
200
+ <property name="capacity">512</property>
201
+ </bean>
202
+ <!-- Queries all JBossWeb GlobalRequestProcessor mbeans -->
203
+ <bean name="RequestProcessorLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource" mode="On Demand">
204
+ <constructor>
205
+ <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
206
+ <!-- Object name pattern for request processors -->
207
+ <!--parameter>jboss.web:type=GlobalRequestProcessor,*</parameter-->
208
+ </constructor>
209
+ </bean>
210
+
211
+
212
+ <!-- The number of active sessions, with respect to the defined capacity -->
213
+ <!-- Analogous to method=S in mod_jk -->
214
+ <bean name="ActiveSessionsLoadMetric" class="org.jboss.modcluster.load.metric.impl.ActiveSessionsLoadMetric" mode="On Demand">
215
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ActiveSessions",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
216
+ <constructor>
217
+ <parameter><inject bean="SessionLoadMetricSource"/></parameter>
218
+ <!--parameter>activeSessions</parameter-->
219
+ </constructor>
220
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 1000 active sessions -->
221
+ <property name="capacity">1000</property>
222
+ </bean>
223
+ <!-- Queries all JBossWeb session manager mbeans -->
224
+ <bean name="SessionLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.SessionLoadMetricSource" mode="On Demand">
225
+ <constructor>
226
+ <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
227
+ <!-- Object name pattern for session managers -->
228
+ <!--parameter>jboss.web:type=Manager,*</parameter-->
229
+ </constructor>
230
+ </bean>
231
+
232
+
233
+ <!-- Returns the connection pool usage as a ratio of used to max pool size -->
234
+ <bean name="ConnectionPoolUsageMetric" class="org.jboss.modcluster.load.metric.impl.ConnectionPoolUsageLoadMetric" mode="On Demand">
235
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ConnectionPoolUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
236
+ <constructor>
237
+ <parameter><inject bean="ConnectionPoolLoadMetricSource"/></parameter>
238
+ <!--parameter>InUseConnectionCount</parameter-->
239
+ <!--parameter>MaxSize</parameter-->
240
+ </constructor>
241
+ </bean>
242
+ <!-- Queries all JCA connection pools -->
243
+ <bean name="ConnectionPoolLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.ConnectionPoolLoadMetricSource" mode="On Demand">
244
+ <constructor>
245
+ <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
246
+ <!-- Object name pattern for connector thread pools -->
247
+ <!--parameter>jboss.jca:service=ManagedConnectionPool,*</parameter-->
248
+ </constructor>
249
+ </bean>
250
+
251
+ <!-- Generic load metrics/sources -->
252
+
253
+ <!-- Uses the sum of the values of the specified attribute for each
254
+ mbean matching the query, with respect to a defined capacity. -->
255
+ <bean name="MBeanAttributeLoadMetric" class="org.jboss.modcluster.load.metric.impl.MBeanAttributeLoadMetric" mode="On Demand">
256
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=MBeanAttribute",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
257
+ <constructor>
258
+ <parameter><inject bean="MBeanQueryLoadMetricSource"/></parameter>
259
+ <parameter><!-- mbean attribute --></parameter>
260
+ </constructor>
261
+ <property name="capacity">1</property>
262
+ </bean>
263
+ <!-- Uses the ratio of the sum of the values of the specified dividend attribute,
264
+ to the sum of the values of the specified divisor attribute for each mbean
265
+ matching the query. -->
266
+ <bean name="MBeanAttributeRatioLoadMetric" class="org.jboss.modcluster.load.metric.impl.MBeanAttributeRatioLoadMetric" mode="On Demand">
267
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=MBeanAttributeRatio",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
268
+ <constructor>
269
+ <parameter><inject bean="MBeanQueryLoadMetricSource"/></parameter>
270
+ <parameter><!-- dividend attribute --></parameter>
271
+ <parameter><!-- divisor attribute --></parameter>
272
+ </constructor>
273
+ </bean>
274
+ <!-- Queries for mbeans matching the specified pattern -->
275
+ <bean name="MBeanQueryLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.MBeanQueryLoadMetricSource" mode="On Demand">
276
+ <constructor>
277
+ <parameter><!-- ObjectName pattern --></parameter>
278
+ <parameter><inject bean="JMXKernel" property="mbeanServer"/></parameter>
279
+ </constructor>
280
+ </bean>
281
+
282
+ </deployment>
@@ -0,0 +1,62 @@
1
+ ## -*- shell-script -*- ######################################################
2
+ ## ##
3
+ ## JBoss Bootstrap Script Configuration ##
4
+ ## ##
5
+ ##############################################################################
6
+
7
+ ### $Id: run.conf 91533 2009-07-22 01:20:05Z gbadner $
8
+
9
+ #
10
+ # This shell script is sourced by run.sh to initialize the environment
11
+ # variables that run.sh uses. It is recommended to use this file to
12
+ # configure these variables, rather than modifying run.sh itself.
13
+ #
14
+
15
+ #
16
+ # Specify the maximum file descriptor limit, use "max" or "maximum" to use
17
+ # the default, as queried by the system.
18
+ #
19
+ # Defaults to "maximum"
20
+ #
21
+ #MAX_FD="maximum"
22
+
23
+ #
24
+ # Specify the JBoss Profiler configuration file to load.
25
+ #
26
+ # Default is to not load a JBoss Profiler configuration file.
27
+ #
28
+ #PROFILER=""
29
+
30
+ #
31
+ # Specify the location of the Java home directory. If set then $JAVA will
32
+ # be defined to $JAVA_HOME/bin/java, else $JAVA will be "java".
33
+ #
34
+ #JAVA_HOME="/usr/java/jdk1.6.0"
35
+
36
+ #
37
+ # Specify the exact Java VM executable to use.
38
+ #
39
+ #JAVA=""
40
+
41
+ #
42
+ # Specify options to pass to the Java VM.
43
+ #
44
+ if [ "x$JAVA_OPTS" = "x" ]; then
45
+ JAVA_OPTS="-Xms<%= @config[:heap_size] %> -Xmx<%= @config[:heap_size] %>"
46
+ JAVA_OPTS="$JAVA_OPTS -XX:PermSize=<%= @config[:perm_size] %> -XX:MaxPermSize=<%= @config[:perm_size] %>"
47
+ JAVA_OPTS="$JAVA_OPTS -Xss<%= @config[:stack_size] %>"
48
+ JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true"
49
+ fi
50
+
51
+ ## Specify the Security Manager options
52
+ #JAVA_OPTS="$JAVA_OPTS -Djava.security.manager -Djava.security.policy=$POLICY"
53
+
54
+ # Sample JPDA settings for remote socket debugging
55
+ <%= "#" unless @config[:debug] == :socket %>JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
56
+
57
+ # Sample JPDA settings for shared memory debugging
58
+ <%= "#" unless @config[:debug] == :shared_memory %>JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_shmem,address=jboss,server=y,suspend=n"
59
+
60
+ <% unless @jvm_args.empty? %>
61
+ JAVA_OPTS="$JAVA_OPTS <%= @jvm_args.join ' ' %>"
62
+ <% end %>