This instantiator is used to handle the ‘invoke-factory’ element in a configuration file. It performs complex initialization logic by delegating to the RuleEngine class.

Methods
Public Class methods
new( point, parms )

Create a new ComplexInstantiationFactory for the given service point, with the given parameters. The parameters must be a Hash, and must contain at least the ‘service-id’ key, which specifies the service-id of the factory that will be used to instantiate this service.

     # File lib/copland/service-point.rb, line 240
240:     def initialize( point, parms )
241:       @point = point
242:       @service_id = parms[ 'service-id' ] or
243:         raise CoplandParseError, "'service-id' is required for invoke-factory"
244:       ( @parms = parms.dup ).delete 'service-id'
245:     end
Public Instance methods
instantiate()

Instantiate the factory service, create a new rule engine, push an empty list onto the engine’s stack, and process the rules. The list is then popped off the stack and passed as the parameter list to the create_implementation method of the factory. The factory should then return the new service instance.

     # File lib/copland/service-point.rb, line 269
269:     def instantiate
270:       schema = get_factory_service_point.parameters_schema
271: 
272:       processor = RuleEngine.new( schema, @parms )
273:       processor.stack.push []
274:       processor.process
275:       result = processor.stack.pop
276: 
277:       get_factory_service.create_implementation( @point, result )
278:     end