annotate Lib/IMPL/Web/Application.pm @ 54:f4e045e47770

commit
author wizard@linux-odin.local
date Tue, 02 Mar 2010 20:15:57 +0300
parents 15d720913562
children bf59ee1cd506
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
1 package IMPL::Web::Application;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
2 use strict;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
3 use warnings;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
4
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
5 use base qw(IMPL::Object IMPL::Object::Singleton);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
6 use IMPL::Class::Property;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
7
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
8 BEGIN {
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
9 public property handlerError => prop_all;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
10 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
11
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
12 # custom factory
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
13 sub new {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
14 my ($self,$file) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
15
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
16 return $self->LoadXMLFile($file);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
17 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
18
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
19 sub Run {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
20 my ($this) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
21
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
22 while (my $request = $this->fetch_request()) {
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
23 my $action = $this->prepare_action($request);
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
24 $action->invoke($request);
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
25 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
26 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
27
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
28 1;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
29
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
30 __END__
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
31
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
32 =pod
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
33
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
34 =head1 SYNOPSIS
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
35
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
36 require MyApp;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
37 MyApp->instance('app.config')->Run();
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
38
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
39 =head1 DESCRIPTION
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
40
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
41 Зкземпляр приложения содержит в себе глобальные настройки, реализует контроллер запросов,
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
42 в качестве источника запросов используется CGI или иной совместимый модуль.
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
43
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
44 Процесс обработки запроса состоит из следующих частей
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
45
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
46 1. Получение cgi запроса
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
47 2. Вызов модуля для инициализации объекта действия
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
48 3. Инициализация контекста выполнения
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
49 4. Выполнение запроса
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
50 5. Преобразование полученных данных в тело ответа
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
51
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
53
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
54
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
55 =cut