cvsuser 02/02/01 12:34:43
Modified: P5EEx/Blue/P5EEx/Blue Context.pm
Log:
instantiates sessions properly now
Revision Changes Path
1.11 +75 -36 p5ee/P5EEx/Blue/P5EEx/Blue/Context.pm
Index: Context.pm
===================================================================
RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/Context.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -r1.10 -r1.11
--- Context.pm 30 Jan 2002 19:43:26 -0000 1.10
+++ Context.pm 1 Feb 2002 20:34:42 -0000 1.11
@@ -1,6 +1,6 @@
#############################################################################
-## $Id: Context.pm,v 1.10 2002/01/30 19:43:26 spadkins Exp $
+## $Id: Context.pm,v 1.11 2002/02/01 20:34:42 spadkins Exp $
#############################################################################
package P5EEx::Blue::Context;
@@ -203,15 +203,18 @@
$name = "default" if (!$name);
}
- my ($config_class);
+ my ($config_class, $session_class);
$config_class = $args->{configClass};
$config_class = $ENV{P5EE_CONFIG_CLASS} if (! $config_class);
$config_class = "P5EEx::Blue::Config::File" if (! $config_class);
- # TODO: $self->{Config}{$user}, $self->{Session}{$session_id}
+ $session_class = $args->{sessionClass};
+ $session_class = "P5EEx::Blue::Session::HTMLHidden" if (! $session_class);
+
$self->{config} = P5EEx::Blue::P5EE->new($config_class, "new", $args);
- $self->{session} = {}; # TODO: instantiate a real Session object
+ $self->{session} = P5EEx::Blue::P5EE->new($session_class, "new", $args);
+
$self->init($args);
$self->{args} = { %$args };
@@ -257,38 +260,6 @@
}
#############################################################################
-# dispatch_events()
-#############################################################################
-
-=head2 dispatch_events()
-
-The dispatch_events() method is called by the bootstrap environmental code
-in order to get the Context object rolling. It causes the program to block
-(wait on I/O), loop, or poll, in order to find events from the environment
-and dispatch them to the appropriate places within the P5EE framework.
-
-It is considered "protected" because no classes should be calling it.
-
- * Signature: $context->dispatch_events()
- * Param: void
- * Return: void
- * Throws: P5EEx::Blue::Exception
- * Since: 0.01
-
- Sample Usage:
-
- $context->dispatch_events();
-
-=cut
-
-sub dispatch_events {
- my ($self) = @_;
- P5EEx::Blue::Exception->throw (
- error => "dispatch_events(): unimplemented\n",
- );
-}
-
-#############################################################################
# PUBLIC METHODS
#############################################################################
@@ -918,6 +889,74 @@
my $d = Data::Dumper->new([ $self ], [ "context" ]);
$d->Indent(1);
return $d->Dump();
+}
+
+#############################################################################
+# PROTECTED METHODS
+#############################################################################
+
+=head1 Protected Methods
+
+These methods are considered protected because no class is ever supposed
+to call them. They may however be called by the context-specific drivers.
+
+=cut
+
+#############################################################################
+# dispatch_events()
+#############################################################################
+
+=head2 dispatch_events()
+
+The dispatch_events() method is called by the bootstrap environmental code
+in order to get the Context object rolling. It causes the program to block
+(wait on I/O), loop, or poll, in order to find events from the environment
+and dispatch them to the appropriate places within the P5EE framework.
+
+It is considered "protected" because no classes should be calling it.
+
+ * Signature: $context->dispatch_events()
+ * Param: void
+ * Return: void
+ * Throws: P5EEx::Blue::Exception
+ * Since: 0.01
+
+ Sample Usage:
+
+ $context->dispatch_events();
+
+=cut
+
+sub dispatch_events {
+ my ($self) = @_;
+ P5EEx::Blue::Exception->throw (
+ error => "dispatch_events(): unimplemented\n",
+ );
+}
+
+sub shutdown {
+ my $self = shift;
+# my ($config, $repdef, $repname, $instance);
+# my ($class, $method, $args, $argidx);
+#
+# Widget->dbgprint("Widget::Controller->shutdown()")
+# if ($Widget::DEBUG && Widget->dbg(ref($self),"shutdown"));
+#
+# $config = $self->{config};
+# if (defined $self->{repository} && ref($self->{repository}) eq "HASH") {
+# foreach $repname (keys %{$self->{repository}}) {
+# $instance = $self->{repository}{$repname};
+# $repdef = $config->{repository}{$repname};
+# $method = $repdef->{finishmethod};
+# $method = "disconnect" if (!defined $method);
+#
+# Widget->dbgprint("Widget::Controller->shutdown():
$instance->$method()")
+# if ($Widget::DEBUG && Widget->dbg(ref($self),"shutdown"));
+#
+# $instance->$method();
+# delete $self->{repository}{$repname};
+# }
+# }
}
1;