1 package TestAppCustomContainer::NoSugarContainer;
3 use namespace::autoclean;
6 extends 'Catalyst::IOC::Container';
11 $self->get_sub_container('model')->add_service(
12 Catalyst::IOC::ConstructorInjection->new(
13 name => 'SingletonLifeCycle',
14 lifecycle => 'Singleton',
15 class => 'TestAppCustomContainer::Model::SingletonLifeCycle',
16 catalyst_component_name => 'TestAppCustomContainer::Model::SingletonLifeCycle',
18 application_name => depends_on( '/application_name' ),
23 $self->get_sub_container('model')->add_service(
24 Catalyst::IOC::ConstructorInjection->new(
25 name => 'RequestLifeCycle',
26 lifecycle => '+Catalyst::IOC::LifeCycle::Request',
27 class => 'TestAppCustomContainer::Model::RequestLifeCycle',
28 catalyst_component_name => 'TestAppCustomContainer::Model::RequestLifeCycle',
30 application_name => depends_on( '/application_name' ),
35 # $self->get_sub_container('model')->add_service(
36 # Catalyst::IOC::ConstructorInjection->new(
37 # name => 'DependsOnDefaultSetup',
38 # class => 'TestAppCustomContainer::Model::DependsOnDefaultSetup',
39 # catalyst_component_name => 'TestAppCustomContainer::Model::DependsOnDefaultSetup',
41 # application_name => depends_on( '/application_name' ),
42 # # FIXME - this is what is blowing up everything:
43 # # DefaultSetup needs the context. It's not getting it here!
44 # foo => depends_on('/model/DefaultSetup'),
50 # $self->get_sub_container('model')->add_service(
51 # Catalyst::IOC::BlockInjection->new(
53 # lifecycle => 'Singleton',
55 # depends_on( '/component/model_Quux' ),
57 # block => sub { shift->param('model_Bar') },
61 # my $fnar_config = $self->resolve(service => 'config')->{'Model::Fnar'} || {};
62 # $self->get_sub_container('component')->add_service(
63 # Catalyst::IOC::ConstructorInjection->new(
64 # name => 'model_Fnar',
65 # lifecycle => 'Singleton',
66 # class => 'TestAppCustomContainer::External::Class',
68 # depends_on( '/application_name' ),
70 # config => $fnar_config,
73 # $self->get_sub_container('model')->add_service(
74 # Catalyst::IOC::BlockInjection->new(
75 # name => 'model_Fnar',
76 # lifecycle => 'Singleton',
78 # depends_on( '/config' ),
79 # depends_on( '/component/model_Fnar' ),
81 # block => sub { shift->param('model_Fnar') },
86 __PACKAGE__->meta->make_immutable;