Egg::Model::Session::Manager::Base - Base class for session manager.


Egg-Plugin-SessionKit documentation  | view source Contained in the Egg-Plugin-SessionKit distribution.

Index


NAME

Top

Egg::Model::Session::Manager::Base - Base class for session manager.

SYNOPSIS

Top

  package MyApp::Model::Session::Manager;
  use strict;
  use warnings;
  use base qw/ Egg::Model::Session::Manager::Base /;

  __PACKAGE__->config(
    .........
    );

  __PACKAGE__->startup(
    .........
    );

DESCRIPTION

Top

Egg::Helper::Model::Sesson It is a base class for the Manager class of the component module that generates to use it.

METHODS

Top

This module has succeeded to Egg::Base.

startup ([LOAD_MODULES])

LOAD_MODULES is set up and @ISA of receipt TieHash class is set up.

  __PACKAGE__->startup qw/
    Base::FileCache
    ........
    /;

'Egg::Model::Session' part of the module name given to LOAD_MODULES is omitted and specified. To treat the module name by the full name, '+' is put on the head.

  __PACKAGE__->startup qw/
    +Egg::Plugin::SessionKit::Bind::URI
    ........
    /;

new

コンストラクタ。

'MyApp::Model::Session::TieHash' class is done in tie, and the object that does the HASH in the wrapping is returned.

  my $session= $e->model('session_name');

The content of the received object becomes session data. It can access the session by treating the value of the object of this HASH base.

  my $data= $session->{data_key};

  $session->{in_data}= 'hoge';

context

The object of the TieHash class is returned.

However, even if the method of the TieHash class is used with the object of this class, the same result is obtained because this class is relaying Egg::Model::Session::Manager::TieHash by AUTOLOAD.

  my $id= $session->context->session_id;

     or

  my $id= $session->session_id;

close_session

All opened sessions are shut.

In a word, if the two or more sessions have been opened at the same time when two or more component modules have been treated, the all are shut.

  $session->close_session;

  # The close method is used to shut individually.
  $session->close

However, because this method is executed with '_finish' hook, it is not necessary to usually consider it on the application side.

SEE ALSO

Top

Egg::Release, Egg::Model::Session, Egg::Model::Session::Manager::TieHash, Egg::Helper::Model::Session, Egg::Base, Class::C3,

AUTHOR

Top

Masatoshi Mizuno <lushe&64;cpan.org>

COPYRIGHT AND LICENSE

Top


Egg-Plugin-SessionKit documentation  | view source Contained in the Egg-Plugin-SessionKit distribution.