Mercurial > pub > Impl
diff 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 |
line wrap: on
line diff
--- a/lib/IMPL/Config/ActivationContext.pm Fri Oct 02 06:56:24 2015 +0300 +++ b/lib/IMPL/Config/ActivationContext.pm Tue Oct 20 07:32:55 2015 +0300 @@ -10,40 +10,49 @@ 'IMPL::Object' => '@_' }, props => { + container => PROP_RW, _services => PROP_RW, - _cache => PROP_RW, - _stack => PROP_RW + _cache => PROP_RW, + _stack => PROP_RW } }; -sub GetService { - my ($this,$serviceId) = @_; - - $this->_services-> +sub CTOR { + my ( $this, $container ) = @_; + + $this->container($container) + or die IMPL::InvalidArgumentException('container'); } sub EnterScope { - my ($this, $name, $localize) = @_; - + my ( $this, $name, $services ) = @_; + my $info = { name => $name }; - - if ($localize) { + + if ($services) { $info->{services} = $this->_services; - - $this->_services(PropertyBag->new($this->_services)); + + $this->_services( $services ); } - + $this->_stack->Push($info); } sub LeaveScope { my ($this) = @_; - + my $info = $this->_stack->Pop() - or die IMPL::InvalidOperationException(); - - if ($info->{services}) - $this->_services($info->{services}); + or die IMPL::InvalidOperationException(); + + if ( $info->{services} ) $this->_services( $info->{services} ); +} + +sub Resolve { + my ($this, $role, %opts) = @_; +} + +sub Clone { + my ($this) = @_; } 1; @@ -65,4 +74,4 @@ =head3 GetService($serviceId) -=cut \ No newline at end of file +=cut