407
|
1 package IMPL::Config::ActivationContext;
|
|
2
|
|
3 use IMPL::Const qw(:prop);
|
|
4 use IMPL::Exception();
|
|
5 use IMPL::declare {
|
|
6 require => {
|
|
7 PropertyBag => 'IMPL::Config::ServicesBag'
|
|
8 },
|
|
9 base => {
|
|
10 'IMPL::Object' => '@_'
|
|
11 },
|
|
12 props => {
|
415
|
13 container => PROP_RW,
|
407
|
14 _services => PROP_RW,
|
415
|
15 _cache => PROP_RW,
|
|
16 _stack => PROP_RW
|
407
|
17 }
|
|
18 };
|
|
19
|
415
|
20 sub CTOR {
|
|
21 my ( $this, $container ) = @_;
|
|
22
|
|
23 $this->container($container)
|
|
24 or die IMPL::InvalidArgumentException('container');
|
407
|
25 }
|
|
26
|
|
27 sub EnterScope {
|
415
|
28 my ( $this, $name, $services ) = @_;
|
|
29
|
407
|
30 my $info = { name => $name };
|
415
|
31
|
|
32 if ($services) {
|
407
|
33 $info->{services} = $this->_services;
|
415
|
34
|
|
35 $this->_services( $services );
|
407
|
36 }
|
415
|
37
|
407
|
38 $this->_stack->Push($info);
|
|
39 }
|
|
40
|
|
41 sub LeaveScope {
|
|
42 my ($this) = @_;
|
415
|
43
|
407
|
44 my $info = $this->_stack->Pop()
|
415
|
45 or die IMPL::InvalidOperationException();
|
|
46
|
|
47 if ( $info->{services} ) $this->_services( $info->{services} );
|
|
48 }
|
|
49
|
|
50 sub Resolve {
|
|
51 my ($this, $role, %opts) = @_;
|
|
52 }
|
|
53
|
|
54 sub Clone {
|
|
55 my ($this) = @_;
|
407
|
56 }
|
|
57
|
|
58 1;
|
|
59 __END__
|
|
60
|
|
61 =pod
|
|
62
|
|
63 =head1 NAME
|
|
64
|
|
65 C<IMPL::Config::ActivationContext> - an activation context for the service
|
|
66
|
|
67 =head1 SYNOPSIS
|
|
68
|
|
69 For the internal use only
|
|
70
|
|
71 =head1 MEMBERS
|
|
72
|
|
73 =head2 METHODS
|
|
74
|
|
75 =head3 GetService($serviceId)
|
|
76
|
415
|
77 =cut
|