| 1 | # -*- Mode: Perl; indent-tabs-mode: nil; -*- | ||
| 2 | |||
| 3 | package Wombat::Core::ApplicationFacade; | ||
| 4 | |||
| 5 | =pod | ||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Wombat::Core::ApplicationFacade - internal application facade | ||
| 10 | |||
| 11 | =head1 SYNOPSIS | ||
| 12 | |||
| 13 | =head1 DESCRIPTION | ||
| 14 | |||
| 15 | Facade class that wraps an internal Application object. All methods | ||
| 16 | are delegated to the wrapped application. The facade is presented to | ||
| 17 | servlet code so that the servlet code does not have access to internal | ||
| 18 | Application methods. | ||
| 19 | |||
| 20 | =cut | ||
| 21 | |||
| 22 | use base qw(Servlet::ServletContext); | ||
| 23 | use fields qw(application); | ||
| 24 | use strict; | ||
| 25 | use warnings; | ||
| 26 | |||
| 27 | =pod | ||
| 28 | |||
| 29 | =head1 CONSTRUCTOR | ||
| 30 | |||
| 31 | =over | ||
| 32 | |||
| 33 | =item new($application) | ||
| 34 | |||
| 35 | Construct and return a B<Wombat::Connector::ApplicationFacade> | ||
| 36 | instance. If subclasses override the constructor, they must be sure to | ||
| 37 | call | ||
| 38 | |||
| 39 | $self->SUPER::new($application); | ||
| 40 | |||
| 41 | B<Parameters:> | ||
| 42 | |||
| 43 | =over | ||
| 44 | |||
| 45 | =item $application | ||
| 46 | |||
| 47 | the B<Wombat::Core::Application> for which this object is the facade. | ||
| 48 | |||
| 49 | =back | ||
| 50 | |||
| 51 | =back | ||
| 52 | |||
| 53 | =cut | ||
| 54 | |||
| 55 | sub new { | ||
| 56 | my $self = shift; | ||
| 57 | my $application = shift; | ||
| 58 | |||
| 59 | $self = fields::new($self) unless ref $self; | ||
| 60 | |||
| 61 | $self->{application} = $application; | ||
| 62 | |||
| 63 | return $self; | ||
| 64 | } | ||
| 65 | |||
| 66 | sub getAttribute { | ||
| 67 | my $self = shift; | ||
| 68 | |||
| 69 | return $self->{application}->getAttribute(@_); | ||
| 70 | } | ||
| 71 | |||
| 72 | sub getAttributeNames { | ||
| 73 | my $self = shift; | ||
| 74 | |||
| 75 | return $self->{application}->getAttributeNames(@_); | ||
| 76 | } | ||
| 77 | |||
| 78 | sub removeAttribute { | ||
| 79 | my $self = shift; | ||
| 80 | |||
| 81 | return $self->{application}->removeAttribute(@_); | ||
| 82 | } | ||
| 83 | |||
| 84 | sub setAttribute { | ||
| 85 | my $self = shift; | ||
| 86 | |||
| 87 | return $self->{application}->setAttribute(@_); | ||
| 88 | } | ||
| 89 | |||
| 90 | sub getContext { | ||
| 91 | my $self = shift; | ||
| 92 | |||
| 93 | return $self->{application}->getContext(@_); | ||
| 94 | } | ||
| 95 | |||
| 96 | sub getInitParameter { | ||
| 97 | my $self = shift; | ||
| 98 | |||
| 99 | return $self->{application}->getInitParameter(@_); | ||
| 100 | } | ||
| 101 | |||
| 102 | sub getInitParameterNames { | ||
| 103 | my $self = shift; | ||
| 104 | |||
| 105 | return $self->{application}->getInitParameterNames(@_); | ||
| 106 | } | ||
| 107 | |||
| 108 | sub getMajorVersion { | ||
| 109 | my $self = shift; | ||
| 110 | |||
| 111 | return $self->{application}->getMajorVersion(@_); | ||
| 112 | } | ||
| 113 | |||
| 114 | sub getMinorVersion { | ||
| 115 | my $self = shift; | ||
| 116 | |||
| 117 | return $self->{application}->getMinorVersion(@_); | ||
| 118 | } | ||
| 119 | |||
| 120 | sub getMimeType { | ||
| 121 | my $self = shift; | ||
| 122 | |||
| 123 | return $self->{application}->getMimeType(@_); | ||
| 124 | } | ||
| 125 | |||
| 126 | sub getNamedDispatcher { | ||
| 127 | my $self = shift; | ||
| 128 | |||
| 129 | return $self->{application}->getNamedDispatcher(@_); | ||
| 130 | } | ||
| 131 | |||
| 132 | sub getRealPath { | ||
| 133 | my $self = shift; | ||
| 134 | |||
| 135 | return $self->{application}->getRealPath(@_); | ||
| 136 | } | ||
| 137 | |||
| 138 | sub getRequestDispatcher { | ||
| 139 | my $self = shift; | ||
| 140 | |||
| 141 | return $self->{application}->getRequestDispatcher(@_); | ||
| 142 | } | ||
| 143 | |||
| 144 | sub getResource { | ||
| 145 | my $self = shift; | ||
| 146 | |||
| 147 | return $self->{application}->getResource(@_); | ||
| 148 | } | ||
| 149 | |||
| 150 | sub getResourceAsStream { | ||
| 151 | my $self = shift; | ||
| 152 | |||
| 153 | return $self->{application}->getResourceAsStream(@_); | ||
| 154 | } | ||
| 155 | |||
| 156 | sub getResourcePaths { | ||
| 157 | my $self = shift; | ||
| 158 | |||
| 159 | return $self->{application}->getResourcePaths(@_); | ||
| 160 | } | ||
| 161 | |||
| 162 | sub getServerInfo { | ||
| 163 | my $self = shift; | ||
| 164 | |||
| 165 | return $self->{application}->getServerInfo(@_); | ||
| 166 | } | ||
| 167 | |||
| 168 | sub getServletContextName { | ||
| 169 | my $self = shift; | ||
| 170 | |||
| 171 | return $self->{application}->getServletContextName(@_); | ||
| 172 | } | ||
| 173 | |||
| 174 | sub log { | ||
| 175 | my $self = shift; | ||
| 176 | |||
| 177 | return $self->{application}->log(@_); | ||
| 178 | } | ||
| 179 | |||
| 180 | 1; | ||
| 181 | __END__ |