Class: Seasar::Container::Deployer::PrototypeComponentDeployer

Inherits:
AbstractComponentDeployer show all
Defined in:
lib/seasar/container/deployer/prototype-component-deployer.rb

Overview

コンポーネントのインスタンス管理をPrototypeとするDeployerクラスです。

Instance Method Summary collapse

Methods inherited from AbstractComponentDeployer

#setup_assembler

Constructor Details

#initialize(component_def) ⇒ PrototypeComponentDeployer

PrototypeComponentDeployerを構築します。

  • args

    1. Seasar::Container::ComponentDef component_def



28
29
30
31
# File 'lib/seasar/container/deployer/prototype-component-deployer.rb', line 28

def initialize(component_def)
  super
  @instantiating = false
end

Instance Method Details

#deployObject

コンポーネントを構築します。

  • args

    • none

  • return

    • Object



38
39
40
41
42
43
44
45
46
47
# File 'lib/seasar/container/deployer/prototype-component-deployer.rb', line 38

def deploy
  if @instantiating
    raise Seasar::Container::Exception::CyclicReferenceRuntimeException(@component_def.component_class)
  end
  @instantiating = true
  component = @constructor_assembler.assemble
  @property_assembler.assemble(component)
  @instantiating = false
  return component
end