49
|
1 use strict;
|
|
2 package Deployment::Batch::CustomAction;
|
165
|
3 use parent qw(Deployment::Batch::Generic);
|
49
|
4 use Common;
|
|
5
|
|
6 BEGIN {
|
|
7 DeclareProperty handlerRun => ACCESS_READ;
|
|
8 DeclareProperty handlerRollback => ACCESS_READ;
|
|
9 DeclareProperty Name => ACCESS_READ;
|
|
10 }
|
|
11
|
|
12 sub CTOR {
|
|
13 my ($this,%args) = @_;
|
|
14
|
|
15 $this->{$handlerRun} = $args{Run} || sub {};
|
|
16 $this->{$handlerRollback} = $args{Rollback} || sub {};
|
|
17 $this->{$Name} = $args{Name} || $this->SUPER::Name();
|
|
18 }
|
|
19
|
|
20 sub Run {
|
|
21 my ($this) = @_;
|
|
22
|
|
23 $this->{$handlerRun}->($this);
|
|
24 }
|
|
25
|
|
26 sub Rollback {
|
|
27 my ($this) = @_;
|
|
28
|
|
29 $this->{$handlerRollback}->($this);
|
|
30 }
|
|
31
|
|
32 1;
|