line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XAS::Factory; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use Badger::Factory::Class |
6
|
1
|
|
|
|
|
19
|
debug => 0, |
7
|
|
|
|
|
|
|
version => $VERSION, |
8
|
|
|
|
|
|
|
item => 'module', |
9
|
|
|
|
|
|
|
path => 'XAS::Lib XAS::Lib::Modules', |
10
|
|
|
|
|
|
|
modules => { |
11
|
|
|
|
|
|
|
alert => 'XAS::Lib::Modules::Alerts', |
12
|
|
|
|
|
|
|
email => 'XAS::Lib::Modules::Email', |
13
|
|
|
|
|
|
|
environment => 'XAS::Lib::Modules::Environment', |
14
|
|
|
|
|
|
|
log => 'XAS::Lib::Log', |
15
|
|
|
|
|
|
|
logger => 'XAS::Lib::Log', |
16
|
|
|
|
|
|
|
lockmgr => 'XAS::Lib::Lockmgr', |
17
|
|
|
|
|
|
|
pidfile => 'XAS::Lib::Pidfile', |
18
|
|
|
|
|
|
|
spool => 'XAS::Lib::Modules::Spool', |
19
|
|
|
|
|
|
|
spooler => 'XAS::Lib::Modules::Spool', |
20
|
|
|
|
|
|
|
} |
21
|
1
|
|
|
1
|
|
411
|
; |
|
1
|
|
|
|
|
21800
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 NAME |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
XAS::Factory - A factory system for the XAS environment |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SYNOPSIS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
You can use this module in the following manner. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
use XAS::Factory; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my $env = XAS::Factory->module('environment'); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
... or ... |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $env = XAS:Factory->module('Environment'); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Either of the above statements will load the L<XAS::Lib::Modules::Environment|XAS::Lib::Modules::Environment> module. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 DESCRIPTION |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
This module is a factory system for the XAS environment. It will load and |
48
|
|
|
|
|
|
|
initialize modules on demand. The advantage is that you don't need to load |
49
|
|
|
|
|
|
|
all your modules at the beginning of your program. You also don't need to |
50
|
|
|
|
|
|
|
know where individual modules live. And this system can provide nice alias |
51
|
|
|
|
|
|
|
for long module names. This should lead to cleaner more readable programs. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 MODULES |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
The following modules have been defined. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=over 4 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item B<alert> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This will load L<XAS::Lib::Modules::Alerts|XAS::Lib::Modules::Alerts>. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item B<email> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This will load L<XAS::Lib::Modules::Email|XAS::Lib::Modules::Email>. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item B<environment> |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This will load L<XAS::Lib::Modules::Environment|XAS::Lib::Modules::Environment> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item B<log logger> |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This will load L<XAS::Lib::Log|XAS::Lib::Log> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item B<locking lockmgr> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This will load L<XAS::Lib::Lockmgr|XAS::Lib::Lockmgr>. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item B<pidfile> |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This will load L<XAS::Lib::Pidfile|XAS::Lib::Pidfile>. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item B<spool spooler> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This will load L<XAS::Lib::Modules::Spool|XAS::Lib::Modules::Spool>. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=back |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 METHODS |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head2 module |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
This method loads the named module and passes any parameters to that module. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 SEE ALSO |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=over 4 |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item L<XAS|XAS> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=back |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 AUTHOR |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Kevin L. Esteb, E<lt>kevin@kesteb.usE<gt> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Copyright (c) 2012-2015 Kevin L. Esteb |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
112
|
|
|
|
|
|
|
the terms of the Artistic License 2.0. For details, see the full text |
113
|
|
|
|
|
|
|
of the license at http://www.perlfoundation.org/artistic_license_2_0. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=cut |