newInstance(Class klass, String type = "")
Purpose
Create a new artifact instanceExamples
class SampleController {
def action = { evt = null ->
def myService = newInstance(MyServiceClass, 'service')
}
}
Description
This method creates a new instance of a particular class and type. It is a convenience method that fires an event after the instance has been created, the application will not perform additional management for an instance created in this way.Fired Events:
NewInstance
- after the instance has been created