pione 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.s3cfg +42 -0
- data/.travis.yml +18 -4
- data/.yardopts +1 -0
- data/Gemfile +3 -0
- data/History.txt +14 -0
- data/Procfile +7 -0
- data/Rakefile +25 -0
- data/bin/pione-interactive +6 -0
- data/bin/{pione-compiler → pione-notification-listener} +1 -1
- data/bin/{pione-broker → pione-task-worker-broker} +1 -1
- data/doc/man/pione-list-param.md +36 -0
- data/example/ActionError/ActionError.pione +9 -0
- data/example/ActionError/pione-package.json +15 -0
- data/example/CountChar/CountChar.pione +1 -1
- data/example/ScoreAggregation/ScoreAggregation.pione +1 -1
- data/example/Touch/pione-package.json +15 -0
- data/lib/pione.rb +12 -0
- data/lib/pione/agent.rb +3 -3
- data/lib/pione/agent/basic-agent.rb +10 -4
- data/lib/pione/agent/input-generator.rb +3 -3
- data/lib/pione/agent/{process-manager.rb → job-manager.rb} +10 -7
- data/lib/pione/agent/job-terminator.rb +2 -2
- data/lib/pione/agent/logger.rb +3 -3
- data/lib/pione/agent/messenger.rb +20 -9
- data/lib/pione/agent/notification-listener.rb +88 -0
- data/lib/pione/agent/task-worker-broker.rb +84 -0
- data/lib/pione/agent/task-worker.rb +3 -2
- data/lib/pione/agent/tuple-space-client.rb +1 -0
- data/lib/pione/agent/tuple-space-provider.rb +17 -35
- data/lib/pione/command.rb +33 -15
- data/lib/pione/command/action.rb +105 -0
- data/lib/pione/command/basic-command.rb +34 -376
- data/lib/pione/command/command-exception.rb +12 -11
- data/lib/pione/command/common.rb +198 -0
- data/lib/pione/command/option.rb +159 -204
- data/lib/pione/command/pione-action-exec.rb +85 -0
- data/lib/pione/command/pione-action-list.rb +43 -19
- data/lib/pione/command/pione-action-print.rb +79 -0
- data/lib/pione/command/pione-action.rb +8 -67
- data/lib/pione/command/pione-clean.rb +88 -68
- data/lib/pione/command/pione-client.rb +475 -332
- data/lib/pione/command/pione-command.rb +14 -31
- data/lib/pione/command/pione-compile.rb +90 -0
- data/lib/pione/command/pione-config-get.rb +53 -0
- data/lib/pione/command/pione-config-list.rb +64 -0
- data/lib/pione/command/pione-config-set.rb +59 -0
- data/lib/pione/command/pione-config-unset.rb +50 -0
- data/lib/pione/command/pione-config.rb +61 -0
- data/lib/pione/command/pione-diagnosis-notification.rb +235 -0
- data/lib/pione/command/pione-diagnosis.rb +21 -0
- data/lib/pione/command/pione-interactive.rb +188 -0
- data/lib/pione/command/pione-lang-check-syntax.rb +163 -0
- data/lib/pione/command/pione-lang-interactive.rb +146 -0
- data/lib/pione/command/pione-lang.rb +22 -0
- data/lib/pione/command/pione-log-format.rb +163 -0
- data/lib/pione/command/pione-log-list-id.rb +48 -0
- data/lib/pione/command/pione-log.rb +19 -101
- data/lib/pione/command/pione-notification-listener.rb +95 -0
- data/lib/pione/command/pione-package-add.rb +137 -0
- data/lib/pione/command/pione-package-build.rb +122 -0
- data/lib/pione/command/pione-package-show.rb +96 -0
- data/lib/pione/command/pione-package-update.rb +59 -0
- data/lib/pione/command/pione-package.rb +11 -139
- data/lib/pione/command/pione-task-worker-broker.rb +88 -0
- data/lib/pione/command/pione-task-worker.rb +148 -98
- data/lib/pione/command/pione-tuple-space-provider.rb +62 -54
- data/lib/pione/command/pione-tuple-space-viewer.rb +105 -83
- data/lib/pione/command/pione-val.rb +39 -39
- data/lib/pione/command/spawner.rb +34 -27
- data/lib/pione/front.rb +4 -2
- data/lib/pione/front/basic-front.rb +86 -23
- data/lib/pione/front/client-front.rb +2 -2
- data/lib/pione/front/diagnosis-notification-front.rb +40 -0
- data/lib/pione/front/front-exception.rb +7 -1
- data/lib/pione/front/notification-listener-front.rb +36 -0
- data/lib/pione/front/notification-recipient-interface.rb +19 -0
- data/lib/pione/front/relay-front.rb +4 -4
- data/lib/pione/front/task-worker-broker-front.rb +19 -0
- data/lib/pione/front/task-worker-front.rb +2 -2
- data/lib/pione/front/tuple-space-provider-front.rb +3 -2
- data/lib/pione/global.rb +3 -1
- data/lib/pione/global/client-variable.rb +1 -1
- data/lib/pione/global/config.rb +63 -7
- data/lib/pione/global/diagnosis-variable.rb +26 -0
- data/lib/pione/global/item.rb +28 -5
- data/lib/pione/global/log-variable.rb +6 -5
- data/lib/pione/global/network-variable.rb +75 -4
- data/lib/pione/global/path-variable.rb +1 -1
- data/lib/pione/global/system-variable.rb +12 -12
- data/lib/pione/global/task-worker-broker-variable.rb +43 -0
- data/lib/pione/global/tuple-space-notifier-variable.rb +3 -55
- data/lib/pione/lang/boolean.rb +4 -0
- data/lib/pione/lang/data-expr.rb +1 -1
- data/lib/pione/lang/integer.rb +1 -1
- data/lib/pione/lang/string.rb +4 -0
- data/lib/pione/lang/type.rb +1 -1
- data/lib/pione/location.rb +1 -0
- data/lib/pione/location/data-location.rb +41 -13
- data/lib/pione/location/dropbox-location.rb +175 -56
- data/lib/pione/location/ftp-location.rb +4 -1
- data/lib/pione/location/http-location.rb +5 -3
- data/lib/pione/location/https-location.rb +4 -2
- data/lib/pione/location/local-location.rb +6 -3
- data/lib/pione/location/location-exception.rb +12 -0
- data/lib/pione/location/notification-scheme.rb +46 -0
- data/lib/pione/log.rb +8 -7
- data/lib/pione/log/debug.rb +9 -9
- data/lib/pione/log/domain-log.rb +6 -1
- data/lib/pione/log/message-log-receiver.rb +32 -0
- data/lib/pione/log/system-log.rb +62 -141
- data/lib/pione/model.rb +7 -0
- data/lib/pione/model/notification-listener-model.rb +29 -0
- data/lib/pione/model/task-worker-broker-model.rb +129 -0
- data/lib/pione/notification.rb +13 -0
- data/lib/pione/notification/address.rb +104 -0
- data/lib/pione/notification/exception.rb +10 -0
- data/lib/pione/notification/message.rb +109 -0
- data/lib/pione/notification/receiver.rb +90 -0
- data/lib/pione/notification/recipient.rb +68 -0
- data/lib/pione/notification/task-worker-broker-recipient.rb +85 -0
- data/lib/pione/notification/transmitter.rb +84 -0
- data/lib/pione/pnml.rb +35 -0
- data/lib/pione/pnml/annotation-extractor.rb +47 -0
- data/lib/pione/pnml/compiler.rb +176 -0
- data/lib/pione/pnml/input-merge-complement.rb +78 -0
- data/lib/pione/pnml/input-parallelization-complement.rb +75 -0
- data/lib/pione/pnml/input-reduction.rb +80 -0
- data/lib/pione/pnml/invalid-arc-elimination.rb +41 -0
- data/lib/pione/pnml/io-expansion.rb +88 -0
- data/lib/pione/pnml/isolated-element-elimination.rb +32 -0
- data/lib/pione/pnml/net-rewriter.rb +44 -0
- data/lib/pione/pnml/output-decomposition-complement.rb +77 -0
- data/lib/pione/pnml/output-reduction.rb +86 -0
- data/lib/pione/pnml/output-synchronization-complement.rb +77 -0
- data/lib/pione/pnml/pione-model.rb +417 -0
- data/lib/pione/pnml/pnml-exception.rb +23 -0
- data/lib/pione/pnml/pnml-model.rb +368 -0
- data/lib/pione/pnml/reader.rb +51 -0
- data/lib/pione/rule-engine/action-handler.rb +8 -6
- data/lib/pione/rule-engine/basic-handler.rb +5 -5
- data/lib/pione/rule-engine/engine-exception.rb +7 -6
- data/lib/pione/rule-engine/flow-handler.rb +27 -18
- data/lib/pione/system.rb +3 -1
- data/lib/pione/system/domain-dump.rb +34 -0
- data/lib/pione/system/file-cache.rb +92 -13
- data/lib/pione/system/init.rb +3 -0
- data/lib/pione/system/normalizer.rb +40 -0
- data/lib/pione/system/status.rb +5 -5
- data/lib/pione/system/system-exception.rb +14 -1
- data/lib/pione/task-worker-broker.rb +7 -0
- data/lib/pione/task-worker-broker/basic-provider.rb +20 -0
- data/lib/pione/task-worker-broker/easy-provider.rb +65 -0
- data/lib/pione/test-helper.rb +27 -0
- data/lib/pione/test-helper/command-helper.rb +9 -101
- data/lib/pione/tuple-space/basic-tuple.rb +1 -1
- data/lib/pione/tuple-space/tuple-definition.yml +4 -6
- data/lib/pione/tuple-space/tuple-space-interface.rb +3 -45
- data/lib/pione/tuple-space/tuple-space-server.rb +45 -0
- data/lib/pione/util.rb +1 -2
- data/lib/pione/util/boolean-value.rb +62 -0
- data/lib/pione/util/completion.rb +111 -0
- data/lib/pione/util/evaluatable.rb +13 -27
- data/lib/pione/util/package-parameters-list.rb +15 -27
- data/lib/pione/util/zip.rb +8 -3
- data/lib/pione/version.rb +1 -1
- data/lib/rootage.rb +20 -0
- data/lib/rootage/action.rb +114 -0
- data/lib/rootage/argument.rb +46 -0
- data/lib/rootage/command.rb +218 -0
- data/lib/rootage/core.rb +532 -0
- data/lib/rootage/exception.rb +107 -0
- data/lib/rootage/help.rb +148 -0
- data/lib/rootage/help.txt.erb +31 -0
- data/lib/rootage/log.rb +226 -0
- data/lib/rootage/normalizer.rb +184 -0
- data/lib/rootage/option.rb +152 -0
- data/lib/rootage/scenario-test-result.erb +39 -0
- data/lib/rootage/scenario.rb +362 -0
- data/lib/rootage/test-helper.rb +115 -0
- data/man/pione-list-param.1 +44 -0
- data/misc/clock.rb +9 -0
- data/misc/machine-info.sh +21 -0
- data/misc/pione-completion.bash +238 -0
- data/misc/pione-completion.erb +53 -0
- data/misc/pione-completion.zsh +238 -0
- data/misc/pione.god +22 -0
- data/misc/ui.xml +23 -0
- data/pione.gemspec +3 -1
- data/test/agent/spec_basic-agent.rb +1 -1
- data/test/agent/spec_input-generator.rb +2 -2
- data/test/agent/spec_messenger.rb +6 -9
- data/test/agent/spec_notification-listener.rb +80 -0
- data/test/agent/{spec_broker.rb → spec_task-worker-broker.rb} +13 -10
- data/test/agent/spec_tuple-space-provider.rb +10 -6
- data/test/command/command-behavior.rb +3 -11
- data/test/command/data/pione-list-param/AdvancedParameters.pione +12 -0
- data/test/command/data/pione-list-param/BasicParameters.pione +12 -0
- data/test/command/spec_pione-action-exec.rb +16 -0
- data/test/command/spec_pione-action-list.rb +15 -10
- data/test/command/spec_pione-action-print.rb +14 -0
- data/test/command/spec_pione-action.rb +6 -19
- data/test/command/spec_pione-clean.rb +29 -46
- data/test/command/spec_pione-client.rb +29 -36
- data/test/command/spec_pione-command.rb +6 -6
- data/test/command/{spec_pione-compiler.rb → spec_pione-compile.rb} +11 -13
- data/test/command/spec_pione-config-get.rb +47 -0
- data/test/command/spec_pione-config-list.rb +42 -0
- data/test/command/spec_pione-config-set.rb +38 -0
- data/test/command/spec_pione-config-unset.rb +44 -0
- data/test/command/spec_pione-config.rb +11 -0
- data/test/command/spec_pione-diagnosis-notification.rb +23 -0
- data/test/command/spec_pione-diagnosis.rb +11 -0
- data/test/command/spec_pione-lang-check-syntax.rb +12 -0
- data/test/command/spec_pione-lang.rb +11 -0
- data/test/command/spec_pione-log-format.rb +29 -0
- data/test/command/spec_pione-log-list-id.rb +17 -0
- data/test/command/spec_pione-log.rb +6 -20
- data/test/command/spec_pione-package-add.rb +55 -0
- data/test/command/spec_pione-package-build.rb +57 -0
- data/test/command/spec_pione-package-show.rb +72 -0
- data/test/command/{spec_pione-update-package-info.rb → spec_pione-package-update.rb} +12 -13
- data/test/command/spec_pione-package.rb +4 -104
- data/test/command/spec_pione-val.rb +10 -7
- data/test/global/spec_config.rb +50 -0
- data/test/global/spec_item.rb +1 -1
- data/test/literate-action/data/HelloWorld.md +1 -1
- data/test/location/location-behavior.rb +1 -1
- data/test/location/spec_dropbox-location.rb +39 -0
- data/test/location/spec_notification-scheme.rb +37 -0
- data/test/log/spec_debug.rb +5 -4
- data/test/log/spec_message-log-receiver.rb +13 -0
- data/test/log/spec_message-log.rb +6 -9
- data/test/log/spec_system-log.rb +5 -3
- data/test/notification/spec_address.rb +229 -0
- data/test/notification/spec_message.rb +30 -0
- data/test/notification/spec_receiver.rb +36 -0
- data/test/notification/spec_transmitter.rb +37 -0
- data/test/pnml/data/ConditionalBranchIf.pnml +270 -0
- data/test/pnml/data/ConditionalBranchIfElse.pnml +309 -0
- data/test/pnml/data/IOExpansionComplex.pnml +363 -0
- data/test/pnml/data/IOExpansionSimple.pnml +140 -0
- data/test/pnml/data/InputMergeComplementComplex.pnml +381 -0
- data/test/pnml/data/InputMergeComplementSimple.pnml +248 -0
- data/test/pnml/data/InputParallelizationComplementComplex.pnml +433 -0
- data/test/pnml/data/InputParallelizationComplementSimple.pnml +288 -0
- data/test/pnml/data/InputReductionComplex.pnml +192 -0
- data/test/pnml/data/InputReductionLong.pnml +344 -0
- data/test/pnml/data/InputReductionSimple.pnml +140 -0
- data/test/pnml/data/IsolatedElementElimination.pnml +171 -0
- data/test/pnml/data/OutputDecompositionComplementComplex.pnml +381 -0
- data/test/pnml/data/OutputDecompositionComplementSimple.pnml +242 -0
- data/test/pnml/data/OutputReductionComplex.pnml +186 -0
- data/test/pnml/data/OutputReductionLong.pnml +344 -0
- data/test/pnml/data/OutputReductionSimple.pnml +140 -0
- data/test/pnml/data/OutputSynchronizationComplementComplex.pnml +498 -0
- data/test/pnml/data/OutputSynchronizationComplementSimple.pnml +347 -0
- data/test/pnml/data/SampleNet.pnml +238 -0
- data/test/pnml/spec_input-merge-complement.rb +40 -0
- data/test/pnml/spec_input-parallelization-complement.rb +50 -0
- data/test/pnml/spec_input-reduction.rb +113 -0
- data/test/pnml/spec_invalid-arc-elimination.rb +33 -0
- data/test/pnml/spec_io-expansion.rb +126 -0
- data/test/pnml/spec_isolated-element-elimination.rb +25 -0
- data/test/pnml/spec_output-decomposition-complement.rb +40 -0
- data/test/pnml/spec_output-reduction.rb +114 -0
- data/test/pnml/spec_output-synchronization-complement.rb +62 -0
- data/test/pnml/spec_pione-element.rb +144 -0
- data/test/pnml/spec_pnml-element.rb +373 -0
- data/test/pnml/spec_reader.rb +16 -0
- data/test/rootage/spec_argument.rb +18 -0
- data/test/rootage/spec_command.rb +239 -0
- data/test/rootage/spec_core.rb +198 -0
- data/test/rootage/spec_scenario.rb +149 -0
- data/test/system/{spec_domain-info.rb → spec_domain-dump.rb} +6 -6
- data/test/system/spec_file-cache.rb +6 -9
- data/test/tuple-space/spec_finished-tuple.rb +1 -1
- data/test/util/{spec_package-parameters-list_1.pione → data/package-parameters-list/Param1.pione} +0 -0
- data/test/util/{spec_package-parameters-list_2.pione → data/package-parameters-list/Param2.pione} +0 -0
- data/test/util/{spec_package-parameters-list_3.pione → data/package-parameters-list/Param3.pione} +0 -0
- data/test/util/{spec_package-parameters-list_4.pione → data/package-parameters-list/Param4.pione} +0 -0
- data/test/util/spec_boolean-value.rb +32 -0
- data/test/util/spec_completion.rb +22 -0
- data/test/util/spec_package-parameters-list.rb +39 -52
- data/test/util/spec_zip.rb +28 -1
- metadata +288 -47
- data/bin/pione-tuple-space-receiver +0 -5
- data/lib/pione/agent/broker.rb +0 -304
- data/lib/pione/agent/tuple-space-receiver.rb +0 -137
- data/lib/pione/command/pione-broker.rb +0 -104
- data/lib/pione/command/pione-compiler.rb +0 -57
- data/lib/pione/command/pione-relay-account-db.rb +0 -141
- data/lib/pione/command/pione-relay-client-db.rb +0 -118
- data/lib/pione/command/pione-relay.rb +0 -59
- data/lib/pione/command/pione-syntax-checker.rb +0 -214
- data/lib/pione/command/pione-tuple-space-receiver.rb +0 -111
- data/lib/pione/command/pione-update-package-info.rb +0 -53
- data/lib/pione/front/broker-front.rb +0 -22
- data/lib/pione/front/tuple-space-receiver-front.rb +0 -11
- data/lib/pione/global/broker-variable.rb +0 -33
- data/lib/pione/system/domain-info.rb +0 -25
- data/lib/pione/util/pnml-compiler.rb +0 -168
- data/test/agent/spec_tuple-space-receiver.rb +0 -47
- data/test/util/spec_pnml-compiler.rb +0 -32
@@ -0,0 +1,26 @@
|
|
1
|
+
module Pione
|
2
|
+
module Global
|
3
|
+
define_internal_item(:diagnosis_notification_front_start_port) do |item|
|
4
|
+
item.desc = "start port number for front server of `pione diagnosis notification`"
|
5
|
+
item.init = 1024
|
6
|
+
end
|
7
|
+
|
8
|
+
define_internal_item(:diagnosis_notification_front_end_port) do |item|
|
9
|
+
item.desc = "end port number for front server of `pione diagnosis notification`"
|
10
|
+
item.init = 9999
|
11
|
+
end
|
12
|
+
|
13
|
+
define_computed_item(
|
14
|
+
:diagnosis_notification_front_port_range,
|
15
|
+
[:diagnosis_notification_front_start_port, :diagnosis_notification_front_end_port]
|
16
|
+
) do |item|
|
17
|
+
item.desc = "port number for front server of `pione diagnosis notification`"
|
18
|
+
item.define_updater do
|
19
|
+
start_port = Global.diagnosis_notification_front_start_port
|
20
|
+
end_port = Global.diagnosis_notification_front_end_port
|
21
|
+
|
22
|
+
Range.new(start_port, end_port)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/pione/global/item.rb
CHANGED
@@ -15,7 +15,7 @@ module Pione
|
|
15
15
|
# Define an internal item. The item cannot be configured by user.
|
16
16
|
def define_internal_item(name, initial_value=nil, &definition)
|
17
17
|
Item.new(name, false).tap do |item|
|
18
|
-
definition.call(item)
|
18
|
+
definition.call(item) if block_given?
|
19
19
|
item.register
|
20
20
|
end
|
21
21
|
end
|
@@ -23,7 +23,7 @@ module Pione
|
|
23
23
|
# Define an external item. The item can be configured by user.
|
24
24
|
def define_external_item(name, initial_value=nil, &definition)
|
25
25
|
Item.new(name, true).tap do |item|
|
26
|
-
definition.call(item)
|
26
|
+
definition.call(item) if block_given?
|
27
27
|
item.register
|
28
28
|
end
|
29
29
|
end
|
@@ -31,7 +31,7 @@ module Pione
|
|
31
31
|
# Define a computed item. The item cannote be configured by user.
|
32
32
|
def define_computed_item(name, dependencies, &definition)
|
33
33
|
Item.new(name, false, :dependencies => dependencies).tap do |item|
|
34
|
-
definition.call(item)
|
34
|
+
definition.call(item) if block_given?
|
35
35
|
item.register
|
36
36
|
end
|
37
37
|
end
|
@@ -101,8 +101,9 @@ module Pione
|
|
101
101
|
@dependencies = option[:dependencies] || []
|
102
102
|
@desc = nil
|
103
103
|
@init = nil
|
104
|
-
@type =
|
104
|
+
@type = nil
|
105
105
|
@updater = Proc.new {|val| val}
|
106
|
+
@post_action = nil
|
106
107
|
@orig = nil
|
107
108
|
@record = false
|
108
109
|
end
|
@@ -158,10 +159,32 @@ module Pione
|
|
158
159
|
@updater = b
|
159
160
|
end
|
160
161
|
|
162
|
+
def post(&b)
|
163
|
+
@post_action = b
|
164
|
+
end
|
165
|
+
|
161
166
|
# Update the item with the value.
|
162
167
|
def update(val)
|
163
168
|
@orig = val
|
164
|
-
@value = @updater.call(val)
|
169
|
+
@value = @updater.call(ValueConverter.convert(@type, val))
|
170
|
+
if @post_action
|
171
|
+
@post_action.call(@value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
module ValueConverter
|
177
|
+
def self.convert(type, val)
|
178
|
+
case type
|
179
|
+
when :string
|
180
|
+
val = val.to_s unless val.kind_of?(String)
|
181
|
+
when :integer
|
182
|
+
val = val.to_i unless val.kind_of?(Integer)
|
183
|
+
when :boolean
|
184
|
+
val = val == "true" ? true : false unless val == true or val == false
|
185
|
+
end
|
186
|
+
|
187
|
+
return val
|
165
188
|
end
|
166
189
|
end
|
167
190
|
end
|
@@ -15,10 +15,11 @@ module Pione
|
|
15
15
|
define_computed_item(:system_logger, [:system_logger_type]) do |item|
|
16
16
|
item.desc = "system logger object"
|
17
17
|
item.define_updater do |val|
|
18
|
-
|
18
|
+
case val
|
19
|
+
when Rootage::Logger
|
19
20
|
val
|
20
21
|
else
|
21
|
-
|
22
|
+
Rootage::Logger.of(Global.system_logger_type).new
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
@@ -87,9 +88,9 @@ module Pione
|
|
87
88
|
item.init = false
|
88
89
|
end
|
89
90
|
|
90
|
-
# This is debug flag that shows
|
91
|
-
define_internal_item(:
|
92
|
-
item.desc = "debug flag that shows
|
91
|
+
# This is debug flag that shows notifications.
|
92
|
+
define_internal_item(:debug_notification) do |item|
|
93
|
+
item.desc = "debug flag that shows notifications"
|
93
94
|
item.type = :boolean
|
94
95
|
item.init = false
|
95
96
|
end
|
@@ -1,9 +1,80 @@
|
|
1
1
|
module Pione
|
2
2
|
module Global
|
3
|
-
#
|
4
|
-
#
|
5
|
-
|
6
|
-
|
3
|
+
#
|
4
|
+
# notification
|
5
|
+
#
|
6
|
+
|
7
|
+
define_internal_item(:default_notification_target_host) do |item|
|
8
|
+
item.desc = "default notification target host"
|
9
|
+
item.init = "255.255.255.255"
|
10
|
+
end
|
11
|
+
|
12
|
+
define_internal_item(:default_notification_target_port) do |item|
|
13
|
+
item.desc = "default notification target port number"
|
14
|
+
item.init = 56000
|
15
|
+
end
|
16
|
+
|
17
|
+
define_external_item(:notification_targets) do |item|
|
18
|
+
item.desc = "notification target addresses"
|
19
|
+
item.init = [Notification::Address.default_target_address]
|
20
|
+
item.define_updater do |addresses|
|
21
|
+
if addresses.is_a?(String)
|
22
|
+
addresses.split(",").map do |address|
|
23
|
+
Notification::Address.target_address_to_uri(address)
|
24
|
+
end
|
25
|
+
else
|
26
|
+
addresses
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
define_internal_item(:default_notification_receiver_host) do |item|
|
32
|
+
item.type = :string
|
33
|
+
item.desc = "default notification receiver host"
|
34
|
+
item.init = "0.0.0.0"
|
35
|
+
end
|
36
|
+
|
37
|
+
define_internal_item(:default_notification_receiver_port) do |item|
|
38
|
+
item.desc = "default notification receiver port number"
|
39
|
+
item.init = 56000
|
40
|
+
end
|
41
|
+
|
42
|
+
define_external_item(:notification_receivers) do |item|
|
43
|
+
item.desc = "notification receiver addresses"
|
44
|
+
item.init = [Notification::Address.default_receiver_address]
|
45
|
+
item.define_updater do |addresses|
|
46
|
+
if addresses.is_a?(String)
|
47
|
+
addresses.split(",").map do |address|
|
48
|
+
Notification::Address.receiver_address_to_uri(address.strip)
|
49
|
+
end
|
50
|
+
else
|
51
|
+
addresses
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
define_external_item(:notification_listener_front_port) do |item|
|
57
|
+
item.type = :integer
|
58
|
+
item.desc = "front port number for notification listener"
|
59
|
+
item.init = 55500
|
60
|
+
end
|
61
|
+
|
62
|
+
define_computed_item(:notification_listener,
|
63
|
+
[:communication_address, :notification_listener_front_port]) do |item|
|
64
|
+
item.desc = "Address of notification listener"
|
65
|
+
item.define_updater do
|
66
|
+
"druby://%s:%s" % [Global.communication_address, Global.notification_listener_front_port]
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
#
|
71
|
+
# communication
|
72
|
+
#
|
73
|
+
|
74
|
+
# This is the IP address of this system. Note that you should select one IP
|
75
|
+
# address even if system has multiple addresses.
|
76
|
+
define_external_item(:communication_address) do |item|
|
77
|
+
item.desc = "IP address for interprocess communication"
|
7
78
|
item.init = Util::IPAddress.myself
|
8
79
|
end
|
9
80
|
end
|
@@ -12,7 +12,7 @@ module Pione
|
|
12
12
|
# This is a configuration file path.
|
13
13
|
define_computed_item(:config_path, [:dot_pione_dir]) do |item|
|
14
14
|
item.desc = "configuration file of PIONE"
|
15
|
-
item.define_updater {Global.dot_pione_dir + "config.
|
15
|
+
item.define_updater {Global.dot_pione_dir + "config.json"}
|
16
16
|
end
|
17
17
|
|
18
18
|
# This is a current working directory. The directory is defined by the
|
@@ -14,20 +14,12 @@ module Pione
|
|
14
14
|
# PIONE's process model
|
15
15
|
#
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
item.desc = "command object of this process"
|
17
|
+
define_internal_item(:parent) do |item|
|
18
|
+
item.desc = "front of parent process"
|
20
19
|
end
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
item.desc = "front object of this process"
|
25
|
-
end
|
26
|
-
|
27
|
-
# This process exits with this status.
|
28
|
-
define_internal_item(:exit_status) do |item|
|
29
|
-
item.desc = "exit status of this process"
|
30
|
-
item.init = true
|
21
|
+
define_internal_item(:notification_recipient) do |item|
|
22
|
+
item.desc = "notification recipient of this process"
|
31
23
|
end
|
32
24
|
|
33
25
|
#
|
@@ -37,6 +29,9 @@ module Pione
|
|
37
29
|
define_external_item(:color_enabled) do |item|
|
38
30
|
item.desc = "availability of color mode"
|
39
31
|
item.init = true
|
32
|
+
item.post do |val|
|
33
|
+
Sickill::Rainbow.enabled = val
|
34
|
+
end
|
40
35
|
end
|
41
36
|
|
42
37
|
#
|
@@ -52,5 +47,10 @@ module Pione
|
|
52
47
|
item.desc = "expression of features for this system"
|
53
48
|
item.define_updater {Util.parse_features(Global.features)}
|
54
49
|
end
|
50
|
+
|
51
|
+
define_external_item(:file_sliding) do |item|
|
52
|
+
item.desc = "enable/disable to slide files in file server"
|
53
|
+
item.init = true
|
54
|
+
end
|
55
55
|
end
|
56
56
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Pione
|
2
|
+
module Global
|
3
|
+
define_external_item(:task_worker_broker_front_start_port) do |item|
|
4
|
+
item.desc = "start port number for front server of `task-worker-broker`"
|
5
|
+
item.init = 41000
|
6
|
+
item.type = :integer
|
7
|
+
end
|
8
|
+
|
9
|
+
define_external_item(:task_worker_broker_front_end_port) do |item|
|
10
|
+
item.desc = "end port number for front server of `task-worker-broker`"
|
11
|
+
item.init = 41099
|
12
|
+
item.type = :integer
|
13
|
+
end
|
14
|
+
|
15
|
+
define_computed_item(:task_worker_broker_front_port_range, [:broker_front_port_range_begin, :broker_front_port_range_end]) do |item|
|
16
|
+
item.desc = "port range for front server of `task-worker-broker`"
|
17
|
+
item.define_updater do
|
18
|
+
start_port = Global.task_worker_broker_front_start_port
|
19
|
+
end_port = Global.task_worker_broker_front_end_port
|
20
|
+
|
21
|
+
Range.new(start_port, end_port)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
define_external_item(:task_worker_provider) do |item|
|
26
|
+
item.desc = "provider method of `task-worker-broker`"
|
27
|
+
item.init = "Pione::TaskWorkerBroker::EasyProvider"
|
28
|
+
item.define_updater {|val| eval(val)}
|
29
|
+
end
|
30
|
+
|
31
|
+
define_external_item(:task_worker_broker_short_sleep_time) do |item|
|
32
|
+
item.desc = "short sleep time for task worker broker"
|
33
|
+
item.init = 1
|
34
|
+
item.type = :positive_integer
|
35
|
+
end
|
36
|
+
|
37
|
+
define_external_item(:task_worker_broker_long_sleep_time) do |item|
|
38
|
+
item.desc = "long sleep time for task worker broker"
|
39
|
+
item.init = 3
|
40
|
+
item.type = :positive_integer
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -4,13 +4,6 @@ module Pione
|
|
4
4
|
# provider & receiver
|
5
5
|
#
|
6
6
|
|
7
|
-
# presence port
|
8
|
-
define_external_item(:presence_port) do |item|
|
9
|
-
item.desc = "presence port number"
|
10
|
-
item.type = :integer
|
11
|
-
item.init = 56000
|
12
|
-
end
|
13
|
-
|
14
7
|
#
|
15
8
|
# pione-tuple-space-provider
|
16
9
|
#
|
@@ -46,55 +39,10 @@ module Pione
|
|
46
39
|
end
|
47
40
|
end
|
48
41
|
|
49
|
-
|
50
|
-
|
51
|
-
item.desc = "presence notification addresses"
|
52
|
-
item.init = ["255.255.255.255:56000"]
|
53
|
-
item.define_updater do |vals|
|
54
|
-
vals.map {|val| val.is_a?(String) ? URI.parse("broadcast://%s" % val) : val}
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
#
|
59
|
-
# pione-tuple-space-receiver
|
60
|
-
#
|
61
|
-
|
62
|
-
# tuple space receiver uri
|
63
|
-
define_internal_item(:tuple_space_receiver_uri) do |item|
|
64
|
-
item.desc = "URI of tuple space receiver"
|
65
|
-
end
|
66
|
-
|
67
|
-
# receiver-front port range begin
|
68
|
-
define_external_item(:tuple_space_receiver_front_port_range_begin) do |item|
|
69
|
-
item.desc = "start port number of tuple space receiver front"
|
70
|
-
item.type = :integer
|
71
|
-
item.init = 43000
|
72
|
-
end
|
73
|
-
|
74
|
-
# receiver-front port range end
|
75
|
-
define_external_item(:tuple_space_receiver_front_port_range_end) do |item|
|
76
|
-
item.desc = "end port number of tuple space receiver front"
|
77
|
-
item.type = :integer
|
78
|
-
item.init = 43999
|
79
|
-
end
|
80
|
-
|
81
|
-
# receiver-front port range
|
82
|
-
define_computed_item(:tuple_space_receiver_front_port_range,
|
83
|
-
[:tuple_space_receiver_front_port_range_begin, :tuple_space_receiver_front_port_range_end]) do |item|
|
84
|
-
item.desc = "port range of tuple space receiver front"
|
85
|
-
item.define_updater do
|
86
|
-
Range.new(
|
87
|
-
Global.tuple_space_receiver_front_port_range_begin,
|
88
|
-
Global.tuple_space_receiver_front_port_range_end
|
89
|
-
)
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
# disconnect time for tuple space receiver
|
94
|
-
define_internal_item(:tuple_space_receiver_disconnect_time) do |item|
|
95
|
-
item.desc = "tuple space receiver disconnect time"
|
42
|
+
define_internal_item(:tuple_space_disconnection_time) do |item|
|
43
|
+
item.desc = "tuple space disconnection time"
|
96
44
|
item.type = :integer
|
97
|
-
item.init =
|
45
|
+
item.init = 60
|
98
46
|
end
|
99
47
|
end
|
100
48
|
end
|
data/lib/pione/lang/boolean.rb
CHANGED
data/lib/pione/lang/data-expr.rb
CHANGED
data/lib/pione/lang/integer.rb
CHANGED
data/lib/pione/lang/string.rb
CHANGED
data/lib/pione/lang/type.rb
CHANGED
data/lib/pione/location.rb
CHANGED
@@ -11,6 +11,7 @@ require 'pione/location/local-scheme'
|
|
11
11
|
require 'pione/location/dropbox-scheme'
|
12
12
|
require 'pione/location/broadcast-scheme'
|
13
13
|
require 'pione/location/myftp-scheme'
|
14
|
+
require 'pione/location/notification-scheme'
|
14
15
|
|
15
16
|
# storage
|
16
17
|
require 'pione/location/basic-location'
|