Class: Backstage::Pool

Inherits:
Object show all
Includes:
HasMBean, Resource, TorqueBoxManaged
Defined in:
lib/pools/models/pool.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Resource

#association_chain, #available_actions, included, #resource, #to_hash

Methods included from TorqueBoxManaged

#app, #app_name, #name, #status

Methods included from HasMBean

#<=>, #full_name, included, #initialize, #mbean_info, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Backstage::HasMBean

Class Method Details

.filterObject



23
24
25
# File 'lib/pools/models/pool.rb', line 23

def self.filter
  "torquebox.pools:*"
end

.to_hash_attributesObject



27
28
29
# File 'lib/pools/models/pool.rb', line 27

def self.to_hash_attributes
  super + [:name, :app, :app_name, :pool_type, :size, :available, :borrowed, :minimum_instances, :maximum_instances]
end

Instance Method Details

#pool_typeObject



41
42
43
# File 'lib/pools/models/pool.rb', line 41

def pool_type
  mbean_info.getClassName =~ /Shared/ ? 'shared' : 'default'
end

#shared?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/pools/models/pool.rb', line 45

def shared?
  pool_type == 'shared'
end

#sizeObject



31
32
33
# File 'lib/pools/models/pool.rb', line 31

def size
  shared? ? 1 : mbean.size
end