comparison lib/IMPL/Config/ActivationContext.pm @ 415:3d24b10dd0d5 ref20150831

working on IMPL::Config::Container
author cin
date Tue, 20 Oct 2015 07:32:55 +0300
parents c6e90e02dd17
children cc2cf8c0edc2
comparison
equal deleted inserted replaced
414:ec6f2d389d1e 415:3d24b10dd0d5
8 }, 8 },
9 base => { 9 base => {
10 'IMPL::Object' => '@_' 10 'IMPL::Object' => '@_'
11 }, 11 },
12 props => { 12 props => {
13 container => PROP_RW,
13 _services => PROP_RW, 14 _services => PROP_RW,
14 _cache => PROP_RW, 15 _cache => PROP_RW,
15 _stack => PROP_RW 16 _stack => PROP_RW
16 } 17 }
17 }; 18 };
18 19
19 sub GetService { 20 sub CTOR {
20 my ($this,$serviceId) = @_; 21 my ( $this, $container ) = @_;
21 22
22 $this->_services-> 23 $this->container($container)
24 or die IMPL::InvalidArgumentException('container');
23 } 25 }
24 26
25 sub EnterScope { 27 sub EnterScope {
26 my ($this, $name, $localize) = @_; 28 my ( $this, $name, $services ) = @_;
27 29
28 my $info = { name => $name }; 30 my $info = { name => $name };
29 31
30 if ($localize) { 32 if ($services) {
31 $info->{services} = $this->_services; 33 $info->{services} = $this->_services;
32 34
33 $this->_services(PropertyBag->new($this->_services)); 35 $this->_services( $services );
34 } 36 }
35 37
36 $this->_stack->Push($info); 38 $this->_stack->Push($info);
37 } 39 }
38 40
39 sub LeaveScope { 41 sub LeaveScope {
40 my ($this) = @_; 42 my ($this) = @_;
41 43
42 my $info = $this->_stack->Pop() 44 my $info = $this->_stack->Pop()
43 or die IMPL::InvalidOperationException(); 45 or die IMPL::InvalidOperationException();
44 46
45 if ($info->{services}) 47 if ( $info->{services} ) $this->_services( $info->{services} );
46 $this->_services($info->{services}); 48 }
49
50 sub Resolve {
51 my ($this, $role, %opts) = @_;
52 }
53
54 sub Clone {
55 my ($this) = @_;
47 } 56 }
48 57
49 1; 58 1;
50 __END__ 59 __END__
51 60