Class: Seasar::Beans::BeanDescFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/seasar/beans/bean-desc-factory.rb

Overview

BeanDescを生成するファクトリクラスです。

Constant Summary collapse

@@spool =
{}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#@@spool private(@@spoolprivate) ⇒ Object

BeanDescを生成するファクトリクラスです。



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/seasar/beans/bean-desc-factory.rb', line 25

class BeanDescFactory

  @@spool = {}

  # シングルトンのBeanDescを返します。
  #
  # - args
  #   1. Object <em>component</em>
  # - return
  #   - Seasar::Beans::BeanDesc
  #
  def BeanDescFactory.get_bean_desc(component)
    if not @@spool.key?(component.class)
      @@spool[component.class] = BeanDesc.new(component)
    end
    return @@spool[component.class]
  end

  # シングルトンのBeanDescを削除します。Outer Injection時に使用されます。
  #
  # - args
  #   1. Object <em>component</em>
  # - return
  #   - none
  #
  def BeanDescFactory.remove_bean_desc(component)
    if @@spool.key?(component.class)
      @@spool.delete(component.class)
    end
  end

  #
  # - args
  #   - none
  # - return
  #   - none
  #
  def BeanDescFactory.init
    @@spool = {}
  end
end

Class Method Details

.get_bean_desc(component) ⇒ Object

シングルトンのBeanDescを返します。

  • args

    1. Object component

  • return

    • Seasar::Beans::BeanDesc



36
37
38
39
40
41
# File 'lib/seasar/beans/bean-desc-factory.rb', line 36

def BeanDescFactory.get_bean_desc(component)
  if not @@spool.key?(component.class)
    @@spool[component.class] = BeanDesc.new(component)
  end
  return @@spool[component.class]
end

.initObject

  • args

    • none

  • return

    • none



62
63
64
# File 'lib/seasar/beans/bean-desc-factory.rb', line 62

def BeanDescFactory.init
  @@spool = {}
end

.remove_bean_desc(component) ⇒ Object

シングルトンのBeanDescを削除します。Outer Injection時に使用されます。

  • args

    1. Object component

  • return

    • none



50
51
52
53
54
# File 'lib/seasar/beans/bean-desc-factory.rb', line 50

def BeanDescFactory.remove_bean_desc(component)
  if @@spool.key?(component.class)
    @@spool.delete(component.class)
  end
end