OpenFrame::WebApp::Segment::Session::Loader - abstract pipeline segment to load


OpenFrame-WebApp documentation  | view source Contained in the OpenFrame-WebApp distribution.

Index


NAME

Top

OpenFrame::WebApp::Segment::Session::Loader - abstract pipeline segment to load sessions

SYNOPSIS

Top

  # abstract class - cannot be used directly

  use Pipeline;
  use OpenFrame::WebApp;

  my $pipe = new Pipeline;

  my $sfactory = new OpenFrame::WebApp::Session::Factory()->type('mem_cache');
  $pipe->store->set( $sfactory );

  # abstract - must use a sub-class:
  my $sloader = new OpenFrame::WebApp::Segment::Session::CookieLoader;
  $pipe->add_segment( $sloader );

  ...

  $pipe->dispatch;

DESCRIPTION

Top

The OpenFrame::WebApp::Segment::Session::Loader class is an abstract session loading segment. It inherits its interface from Pipeline::Segment.

On dispatch() a session is fetched or created using the Pipeline's stored OpenFrame::WebApp::Session::Factory, and a new OpenFrame::WebApp::Segment::Session::Saver object is added to the cleanup pipeline so that any modifications to the session will be saved for the next request.

dispatch

dispatch this segment.

$session = $obj->get_session

looks for session id with find_session_id(), and creates/fetches the session using OpenFrame::WebApp::Session::Factory.

$seg = $obj->create_saver_segment( $session )

returns a new OpenFrame::WebApp::Segment::Session::Saver object for this $session.

$id = $obj->find_session_id

abstract method for finding the session id.

AUTHOR

Top

Steve Purkis <spurkis@epn.nu>

Based on OpenFrame::AppKit::Segment::SessionLoader, by James A. Duncan

COPYRIGHT

Top

SEE ALSO

Top

Pipeline::Segment, OpenFrame::WebApp::Session, OpenFrame::WebApp::Segment::Session::Saver, OpenFrame::WebApp::Segment::Session::CookieLoader


OpenFrame-WebApp documentation  | view source Contained in the OpenFrame-WebApp distribution.