diff Lib/IMPL/Web/Application/Action.pm @ 339:97628101b765

refactoring: application now holds a security object factory rather than a security object
author cin
date Wed, 19 Jun 2013 03:25:44 +0400
parents b1e7b55b4a38
children c090d9102a38
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application/Action.pm	Sat Jun 15 02:32:11 2013 +0400
+++ b/Lib/IMPL/Web/Application/Action.pm	Wed Jun 19 03:25:44 2013 +0400
@@ -2,16 +2,20 @@
 use strict;
 
 use Carp qw(carp);
-
-use IMPL::Const qw(:prop);
-use IMPL::Web::CGIWrapper();
 use URI;
 use JSON;
 
+use IMPL::lang;
+use IMPL::Const qw(:prop);
+use IMPL::Web::CGIWrapper();
 use IMPL::declare {
+    require => {
+        Disposable => '-IMPL::Object::Disposable'
+    },
     base => [
         'IMPL::Object' => undef,
-        'IMPL::Object::Autofill' => '@_'
+        'IMPL::Object::Autofill' => '@_',
+        'IMPL::Object::Disposable' => undef
     ],
     props => [
         application => PROP_RW,
@@ -166,6 +170,14 @@
     }
 }
 
+sub Dispose {
+    my ($this) = @_;
+    
+    $_->Dispose() foreach grep is($_,Disposable), values %{$this->context}; 
+    
+    $this->next::method();
+}
+
 1;
 
 __END__