« Core/Handler/CommandHandler/RegisterForUpdateHandler.pm
↑ Summary
Core/Handler/HandlerDictionary.pm »
| 1 | package Javonet::Core::Handler::CommandHandler::ValueHandler; | ||
| 2 | use strict; | ||
| 3 | use warnings FATAL => 'all'; | ||
| 4 | use lib 'lib'; | ||
| 5 | use Moose; | ||
| 6 | use Nice::Try; | ||
| 7 | use aliased 'Javonet::Core::Exception::Exception' => 'Exception'; | ||
| 8 | extends 'Javonet::Core::Handler::CommandHandler::AbstractCommandHandler'; | ||
| 9 | |||
| 10 | sub new { | ||
| 11 | my $class = shift; | ||
| 12 | my $self = { | ||
| 13 | required_parameters_count => 1 | ||
| 14 | }; | ||
| 15 | return bless $self, $class; | ||
| 16 | } | ||
| 17 | |||
| 18 | sub process { | ||
| 19 | my ($self, $command) = @_; | ||
| 20 | try { | ||
| 21 | return $command->{payload}[0]; | ||
| 22 | } | ||
| 23 | catch ( $e ) { | ||
| 24 | return Exception->new($e); | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | no Moose; | ||
| 29 | 1; |