Class: Copland::ServiceModel::AbstractServiceModel
- Inherits:
-
Object
- Object
- Copland::ServiceModel::AbstractServiceModel
- Defined in:
- lib/copland/models/abstract.rb
Overview
This is the parent class of all service model implementations.
Direct Known Subclasses
PrototypeDeferredServiceModel, PrototypeServiceModel, SingletonServiceModel, ThreadedServiceModel
Instance Attribute Summary collapse
-
#service_point ⇒ Object
readonly
This is the service point that this model protects.
Class Method Summary collapse
-
.register_as(name) ⇒ Object
A convenience method for allowing subclasses to register themselves with the ClassFactory.
Instance Method Summary collapse
-
#initialize(service_point) ⇒ AbstractServiceModel
constructor
Create a new service model around the given service point.
-
#instance(&block) ⇒ Object
Raises a NotImplementedException.
Constructor Details
#initialize(service_point) ⇒ AbstractServiceModel
Create a new service model around the given service point.
55 56 57 |
# File 'lib/copland/models/abstract.rb', line 55 def initialize( service_point ) @service_point = service_point end |
Instance Attribute Details
#service_point ⇒ Object (readonly)
This is the service point that this model protects.
52 53 54 |
# File 'lib/copland/models/abstract.rb', line 52 def service_point @service_point end |
Class Method Details
.register_as(name) ⇒ Object
A convenience method for allowing subclasses to register themselves with the ClassFactory.
66 67 68 69 70 71 72 73 |
# File 'lib/copland/models/abstract.rb', line 66 def self.register_as( name ) class_eval <<-EOF def name #{name.inspect} end EOF Copland::ClassFactory.instance.register( POOL_NAME, name, self ) end |
Instance Method Details
#instance(&block) ⇒ Object
Raises a NotImplementedException. Subclasses must override this method.
60 61 62 |
# File 'lib/copland/models/abstract.rb', line 60 def instance( &block ) raise NotImplementedException end |