rboss 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.idea/encodings.xml +5 -0
- data/.idea/misc.xml +5 -0
- data/.idea/modules.xml +9 -0
- data/.idea/rboss.iml +65 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/vcs.xml +7 -0
- data/Gemfile +2 -2
- data/README.md +34 -397
- data/bin/rboss-cli +77 -28
- data/lib/rboss.rb +10 -12
- data/lib/rboss/cli/invoker.rb +31 -18
- data/lib/rboss/cli/mappings.rb +11 -10
- data/lib/rboss/cli/mappings/resources/connector.yaml +2 -2
- data/lib/rboss/cli/mappings/resources/datasource.yaml +5 -5
- data/lib/rboss/cli/mappings/resources/deployment-scanner.yaml +3 -3
- data/lib/rboss/cli/mappings/resources/interface.yaml +2 -2
- data/lib/rboss/cli/mappings/resources/jdbc-driver.yaml +12 -0
- data/lib/rboss/cli/mappings/resources/jms-queue.yaml +44 -0
- data/lib/rboss/cli/mappings/resources/runtime.yaml +34 -0
- data/lib/rboss/cli/mappings/resources/server.yaml +8 -8
- data/lib/rboss/cli/resource.rb +60 -37
- data/lib/rboss/cli/result_parser.rb +29 -5
- data/lib/rboss/plaftorm.rb +2 -25
- data/lib/rboss/utils.rb +2 -8
- data/lib/rboss/version.rb +1 -1
- data/lib/rboss/view/colorizers.rb +4 -2
- data/lib/rboss/view/formatters.rb +37 -0
- data/lib/rboss/view/table_builder.rb +2 -2
- data/rboss-cli-bash-completion +82 -0
- data/rboss.gemspec +12 -12
- data/rboss.iml +6 -7
- data/rboss.ipr +2 -11
- metadata +23 -53
- data/bin/rboss-profile +0 -125
- data/bin/rboss-twiddle +0 -204
- data/lib/rboss/bin/command_actions.rb +0 -125
- data/lib/rboss/cli/mappings/resources/jdbc_driver.yaml +0 -12
- data/lib/rboss/component_processor.rb +0 -179
- data/lib/rboss/components/component.rb +0 -58
- data/lib/rboss/components/datasource.rb +0 -179
- data/lib/rboss/components/deploy_folder.rb +0 -104
- data/lib/rboss/components/hypersonic_replacer.rb +0 -58
- data/lib/rboss/components/jbossweb.rb +0 -119
- data/lib/rboss/components/jmx.rb +0 -88
- data/lib/rboss/components/mod_cluster.rb +0 -81
- data/lib/rboss/components/org/6.0/deploy_folder.rb +0 -33
- data/lib/rboss/components/org/jmx.rb +0 -59
- data/lib/rboss/components/profile_folder.rb +0 -44
- data/lib/rboss/components/resource.rb +0 -52
- data/lib/rboss/components/restore_slimming.rb +0 -46
- data/lib/rboss/components/run_conf.rb +0 -90
- data/lib/rboss/components/run_conf.yaml +0 -22
- data/lib/rboss/components/service_script.rb +0 -55
- data/lib/rboss/components/slimming.rb +0 -107
- data/lib/rboss/components/slimming.yaml +0 -110
- data/lib/rboss/components/soa-p/hypersonic_replacer.rb +0 -79
- data/lib/rboss/components/soa-p/jmx.rb +0 -47
- data/lib/rboss/components/xadatasource.rb +0 -67
- data/lib/rboss/file_processor.rb +0 -111
- data/lib/rboss/jboss_path.rb +0 -74
- data/lib/rboss/jboss_profile.rb +0 -350
- data/lib/rboss/resources/jboss_init_redhat.sh.erb +0 -140
- data/lib/rboss/resources/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml +0 -282
- data/lib/rboss/resources/mod_cluster.sar/mod_cluster-1.1.2.Final.jar +0 -0
- data/lib/rboss/resources/run.conf.bat.erb +0 -60
- data/lib/rboss/resources/run.conf.erb +0 -62
- data/lib/rboss/twiddle.rb +0 -25
- data/lib/rboss/twiddle/base_monitor.rb +0 -88
- data/lib/rboss/twiddle/mbean.rb +0 -148
- data/lib/rboss/twiddle/monitor.rb +0 -222
- data/lib/rboss/twiddle/twiddle.rb +0 -87
@@ -1,22 +0,0 @@
|
|
1
|
-
# These entries can be passed to RunConf component. They will be replaced by -D{value}
|
2
|
-
#general
|
3
|
-
log_dir : jboss.server.log.dir
|
4
|
-
# Cluster
|
5
|
-
partition_name : jboss.partition.name
|
6
|
-
multicast_ip : jboss.partition.udpGroup
|
7
|
-
# mod_cluster
|
8
|
-
advertise : jboss.mod_cluster.advertise
|
9
|
-
advertise_group_address : jboss.mod_cluster.advertise.address
|
10
|
-
advertise_port : jboss.mod_cluster.advertise.port
|
11
|
-
proxy_list : jboss.mod_cluster.proxyList
|
12
|
-
excluded_contexts : jboss.mod_cluster.excludedContexts
|
13
|
-
auto_enable_contexts : jboss.mod_cluster.autoEnableContexts
|
14
|
-
# Messaging
|
15
|
-
peer_id : jboss.messaging.ServerPeerID
|
16
|
-
# Service Binding
|
17
|
-
service_binding : jboss.service.binding.set
|
18
|
-
# jbossweb engine
|
19
|
-
jvm_route : jboss.jbossweb.jvmRoute
|
20
|
-
# JGroups
|
21
|
-
jgroups_stack : jboss.default.jgroups.stack
|
22
|
-
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# The MIT License
|
2
|
-
#
|
3
|
-
# Copyright (c) 2011-2012 Marcelo Guimarães <ataxexe@gmail.com>
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
22
|
-
|
23
|
-
require_relative "component"
|
24
|
-
|
25
|
-
module RBoss
|
26
|
-
|
27
|
-
class ServiceScript
|
28
|
-
include Component
|
29
|
-
|
30
|
-
def initialize jboss, logger, config
|
31
|
-
@logger = logger
|
32
|
-
@jboss = jboss
|
33
|
-
@template_path = config.delete :path
|
34
|
-
@config = config
|
35
|
-
@config[:profile] = @jboss.profile_name
|
36
|
-
@config[:jboss_home] = @jboss.home
|
37
|
-
@name = @config[:name]
|
38
|
-
@name ||= "jboss_init_#{@jboss.profile_name}.sh"
|
39
|
-
end
|
40
|
-
|
41
|
-
def process
|
42
|
-
@logger.info "Configuring service script..."
|
43
|
-
processor = new_file_processor
|
44
|
-
processor.with @template_path do |action|
|
45
|
-
action.to_process do |content|
|
46
|
-
erb = ERB::new(content, 0, "%<>")
|
47
|
-
erb.result binding
|
48
|
-
end
|
49
|
-
processor.copy_to "#{@jboss}/bin/#{@name}"
|
50
|
-
end
|
51
|
-
processor.process
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
55
|
-
end
|
@@ -1,107 +0,0 @@
|
|
1
|
-
# The MIT License
|
2
|
-
#
|
3
|
-
# Copyright (c) 2011-2012 Marcelo Guimarães <ataxexe@gmail.com>
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
22
|
-
|
23
|
-
require_relative 'component'
|
24
|
-
|
25
|
-
module RBoss
|
26
|
-
# A class for slimming a JBoss profile
|
27
|
-
#
|
28
|
-
# Configuration:
|
29
|
-
#
|
30
|
-
# Pass an array with the services to remove, the current supported are:
|
31
|
-
#
|
32
|
-
# Admin Console => :admin_console
|
33
|
-
# Web Console => :web_console
|
34
|
-
# Mail Service => :mail
|
35
|
-
# BeanShell => :bean_shell
|
36
|
-
# Hot Deploy => :hot_deploy
|
37
|
-
# UDDI => :uddi
|
38
|
-
# UUID Key Generator => :key_generator
|
39
|
-
# Scheduling => :scheduling
|
40
|
-
# JMX Console => :jmx_console
|
41
|
-
# JBoss WS => :jboss_ws
|
42
|
-
# JMX Remoting => :jmx_remoting
|
43
|
-
# ROOT Page => :root_page
|
44
|
-
# Management => :management
|
45
|
-
# IIOP => :iiop
|
46
|
-
# JBoss Web => :jboss_web
|
47
|
-
# SNMP => :snmp
|
48
|
-
# Profile Service => :profile
|
49
|
-
# EJB3 => :ejb3
|
50
|
-
# EJB2 => :ejb2
|
51
|
-
# JMX Invoker => :jmx_invoker
|
52
|
-
# HA HTTP Invoker => :ha_http_invoker
|
53
|
-
# Legacy Invoker => :legacy_invoker
|
54
|
-
# Transaction => :transaction
|
55
|
-
# Remoting => :remoting
|
56
|
-
# Properties Service => :properties
|
57
|
-
# Database/Datasource => :database
|
58
|
-
# JSR-88 => :jsr88
|
59
|
-
# XNIO => :xnio
|
60
|
-
#
|
61
|
-
# author: Marcelo Guimarães <ataxexe@gmail.com>
|
62
|
-
class Slimming
|
63
|
-
include Component, FileUtils
|
64
|
-
|
65
|
-
def configure services_to_remove
|
66
|
-
@services_to_remove = [*services_to_remove]
|
67
|
-
@mapping = {}
|
68
|
-
load_yaml('slimming').each do |key, values|
|
69
|
-
@mapping[key.to_sym] = values
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
def process
|
74
|
-
@services_to_remove.each do |service|
|
75
|
-
log service
|
76
|
-
slim service
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
def slim service
|
81
|
-
sym = service.to_s.gsub(/-/, '_').to_sym
|
82
|
-
entry = @mapping[sym]
|
83
|
-
method = "remove_#{service}".to_sym
|
84
|
-
if respond_to? method
|
85
|
-
self.send method
|
86
|
-
elsif entry
|
87
|
-
entry.each do |file|
|
88
|
-
handle file if file.is_a? String
|
89
|
-
slim file if file.is_a? Symbol
|
90
|
-
end
|
91
|
-
else
|
92
|
-
raise "Unrecognized service: #{service}"
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
def log service
|
97
|
-
@logger.info "Disabling #{service}"
|
98
|
-
end
|
99
|
-
|
100
|
-
def handle file
|
101
|
-
file = "#{@jboss.profile}/" + file unless file.start_with? '/'
|
102
|
-
mv(file, file + ".rej") if File.exist? file
|
103
|
-
end
|
104
|
-
|
105
|
-
end
|
106
|
-
|
107
|
-
end
|
@@ -1,110 +0,0 @@
|
|
1
|
-
hot_deploy:
|
2
|
-
- deploy/hdscanner-jboss-beans.xml
|
3
|
-
|
4
|
-
uddi:
|
5
|
-
- deploy/juddi-service.sar
|
6
|
-
|
7
|
-
key_generator:
|
8
|
-
- deploy/uuid-key-generator.sar
|
9
|
-
|
10
|
-
mail:
|
11
|
-
- deploy/mail-ra.rar
|
12
|
-
- deploy/mail-service.xml
|
13
|
-
|
14
|
-
scheduling:
|
15
|
-
- deploy/scheduler-manager-service.xml
|
16
|
-
- deploy/scheduler-service.xml
|
17
|
-
|
18
|
-
bean_shell:
|
19
|
-
- deployers/bsh.deployer
|
20
|
-
|
21
|
-
jboss_ws:
|
22
|
-
- conf/jax-ws-catalog.xml
|
23
|
-
- conf/props/jbossws-users.properties
|
24
|
-
- conf/props/jbossws-roles.properties
|
25
|
-
- deploy/jbossws.sar
|
26
|
-
- deployers/jbossws.deployer
|
27
|
-
|
28
|
-
jmx_console:
|
29
|
-
- deploy/jmx-console.war
|
30
|
-
|
31
|
-
admin_console:
|
32
|
-
- deploy/admin-console.war
|
33
|
-
|
34
|
-
web_console:
|
35
|
-
- deploy/management
|
36
|
-
|
37
|
-
jmx_remoting:
|
38
|
-
- deploy/jmx-remoting.sar
|
39
|
-
|
40
|
-
root_page:
|
41
|
-
- deploy/ROOT.war
|
42
|
-
|
43
|
-
management:
|
44
|
-
- :admin_console
|
45
|
-
- :web_console
|
46
|
-
- :root_page
|
47
|
-
- :jmx_console
|
48
|
-
- deploy/monitoring-service.xml
|
49
|
-
|
50
|
-
iiop:
|
51
|
-
- deploy/iiop-service.xml
|
52
|
-
|
53
|
-
jboss_web:
|
54
|
-
- deploy/jbossweb.sar
|
55
|
-
- deployers/jbossweb.deployer
|
56
|
-
|
57
|
-
snmp:
|
58
|
-
- deploy/snmp-adaptor.sar
|
59
|
-
|
60
|
-
profile:
|
61
|
-
- deploy/profileservice-jboss-beans.xml
|
62
|
-
|
63
|
-
ejb3:
|
64
|
-
|
65
|
-
- deploy/ejb3-connectors-jboss-beans.xml
|
66
|
-
- deploy/ejb3-container-jboss-beans.xml
|
67
|
-
- deploy/ejb3-interceptors-aop.xml
|
68
|
-
- deploy/ejb3-timerservice-jboss-beans.xml
|
69
|
-
- deploy/quartz-ra.rar
|
70
|
-
- deployers/ejb3.deployer
|
71
|
-
- deployers/ejb3-deployers-jboss-beans.xml
|
72
|
-
- deployers/jboss-ejb3-endpoint-deployer.jar
|
73
|
-
- deployers/jboss-ejb3-metrics-deployer.jar
|
74
|
-
|
75
|
-
ejb2:
|
76
|
-
- deploy/ejb2-container-jboss-beans.xml
|
77
|
-
- deploy/ejb2-timer-service.xml
|
78
|
-
- deployers/ejb-deployer-jboss-beans.xml
|
79
|
-
|
80
|
-
jmx_invoker:
|
81
|
-
- jmx-invoker-service.xml
|
82
|
-
|
83
|
-
ha_http_invoker:
|
84
|
-
- deploy/httpha-invoker.sar
|
85
|
-
|
86
|
-
legacy_invoker:
|
87
|
-
- deploy/legacy-invokers-service.xml
|
88
|
-
|
89
|
-
transaction:
|
90
|
-
- deploy/transaction-jboss-beans.xml
|
91
|
-
- deploy/transaction-service.xml
|
92
|
-
|
93
|
-
remoting:
|
94
|
-
- deploy/remoting-jboss-beans.xml
|
95
|
-
|
96
|
-
properties:
|
97
|
-
- deploy/properties-service.xml
|
98
|
-
|
99
|
-
database:
|
100
|
-
- deploy/hsqldb-ds.xml
|
101
|
-
- deploy/jboss-local-jdbc.rar
|
102
|
-
- deploy/jboss-xa-jdbc.jar
|
103
|
-
- deploy/sqlexception-service.xml
|
104
|
-
|
105
|
-
jsr88:
|
106
|
-
- deploy/jsr88-service.xml
|
107
|
-
|
108
|
-
xnio:
|
109
|
-
- deploy/xnio-provider.jar
|
110
|
-
- deployers/xnio.deployer
|
@@ -1,79 +0,0 @@
|
|
1
|
-
# The MIT License
|
2
|
-
#
|
3
|
-
# Copyright (c) 2011-2012 Marcelo Guimarães <ataxexe@gmail.com>
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
22
|
-
|
23
|
-
require 'fileutils'
|
24
|
-
|
25
|
-
module RBoss
|
26
|
-
|
27
|
-
# A class to replace Hypersonic in SOA-P. This class makes a build.properties file
|
28
|
-
# and calls the ant script present in $JBOSS_HOME/tools/schema/build.xml since this
|
29
|
-
# script does everything we need to replace Hypersonic.
|
30
|
-
#
|
31
|
-
# The configuration must be in a form key => value and the keys needs to be
|
32
|
-
# in the $JBOSS_HOME/tools/schema/build.properties file.
|
33
|
-
#
|
34
|
-
# The ant script minimal keys are:
|
35
|
-
# - db.name
|
36
|
-
# - db.hostname
|
37
|
-
# - db.port
|
38
|
-
# - db.username
|
39
|
-
# - db.password
|
40
|
-
# - source.dir (the directory in $JBOSS_HOME/tools/schema/ that matches the database type)
|
41
|
-
#
|
42
|
-
# author: Marcelo Guimarães <ataxexe@gmail.com>
|
43
|
-
class HypersonicReplacer
|
44
|
-
include FileUtils
|
45
|
-
|
46
|
-
def defaults
|
47
|
-
{
|
48
|
-
"org.jboss.esb.server.home" => File.expand_path(@jboss.home),
|
49
|
-
"org.jboss.esb.server.clustered" => "#{File.exists? "#{@jboss.profile}/farm"}",
|
50
|
-
"org.jboss.esb.server.config" => "#{@jboss.profile_name}",
|
51
|
-
|
52
|
-
"db.minpoolsize" => 15,
|
53
|
-
"db.maxpoolsize" => 50
|
54
|
-
}
|
55
|
-
end
|
56
|
-
|
57
|
-
def configure config
|
58
|
-
@config = config
|
59
|
-
end
|
60
|
-
|
61
|
-
def process
|
62
|
-
properties = @config.collect { |key, value| "#{key} = #{value}" }
|
63
|
-
|
64
|
-
# make a backup of build.properties
|
65
|
-
mv "#{@jboss.home}/tools/schema/build.properties", "#{@jboss.home}/tools/schema/build.properties~"
|
66
|
-
|
67
|
-
File.open("#{@jboss.home}/tools/schema/build.properties", 'w+') { |f| f.write properties.join("\n") }
|
68
|
-
|
69
|
-
cd "#{@jboss.home}/tools/schema" do
|
70
|
-
@logger.info "Executing ant..."
|
71
|
-
`ant`
|
72
|
-
end
|
73
|
-
|
74
|
-
mv "#{@jboss.home}/tools/schema/build.properties~", "#{@jboss.home}/tools/schema/build.properties"
|
75
|
-
end
|
76
|
-
|
77
|
-
end
|
78
|
-
|
79
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# The MIT License
|
2
|
-
#
|
3
|
-
# Copyright (c) 2011-2012 Marcelo Guimarães <ataxexe@gmail.com>
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
22
|
-
|
23
|
-
# A class that extends the default JMX component
|
24
|
-
# for compatibillity with JBoss SOA-P
|
25
|
-
#
|
26
|
-
# author: Marcelo Guimarães <ataxexe@gmail.com>
|
27
|
-
module RBoss
|
28
|
-
class JMX
|
29
|
-
|
30
|
-
def defaults
|
31
|
-
{
|
32
|
-
:user => "admin",
|
33
|
-
:password => "admin",
|
34
|
-
:roles => "JBossAdmin,HttpInvoker,admin,user"
|
35
|
-
}
|
36
|
-
end
|
37
|
-
|
38
|
-
def users_properties_file
|
39
|
-
"soa-users.properties"
|
40
|
-
end
|
41
|
-
|
42
|
-
def roles_properties_file
|
43
|
-
"soa-roles.properties"
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
47
|
-
end
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# The MIT License
|
2
|
-
#
|
3
|
-
# Copyright (c) 2011-2012 Marcelo Guimarães <ataxexe@gmail.com>
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
22
|
-
|
23
|
-
require_relative "datasource"
|
24
|
-
require_relative "component"
|
25
|
-
|
26
|
-
require "logger"
|
27
|
-
require "rexml/document"
|
28
|
-
|
29
|
-
include REXML
|
30
|
-
|
31
|
-
module RBoss
|
32
|
-
|
33
|
-
# A class to configure a JBoss XADatasource.
|
34
|
-
#
|
35
|
-
# The configuration will change a <xa-datasource-property> value.
|
36
|
-
#
|
37
|
-
# Configuration attributes are the same as for a RBoss::Datasource
|
38
|
-
#
|
39
|
-
# author: Marcelo Guimarães <ataxexe@gmail.com>
|
40
|
-
class XADatasource < Datasource
|
41
|
-
include Component
|
42
|
-
|
43
|
-
def configure config
|
44
|
-
super config
|
45
|
-
@type << "-xa"
|
46
|
-
end
|
47
|
-
|
48
|
-
def configure_datasource xml
|
49
|
-
if @encrypt
|
50
|
-
xml.delete_element "//xa-datasource-property[@name='User']"
|
51
|
-
xml.delete_element "//xa-datasource-property[@name='Password']"
|
52
|
-
@service = "XATxCM"
|
53
|
-
end
|
54
|
-
@attributes.each do |key, value|
|
55
|
-
element = find(xml, key) {|k| "//xa-datasource-property[@name='#{k}']"}
|
56
|
-
|
57
|
-
if element
|
58
|
-
element.text = value
|
59
|
-
else
|
60
|
-
insert_attribute xml, key, value
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|