       @final.apply @, arguments
   constructor: ->
     #@setObjectState "initing"
+    defineProperty @, '_objectState_', null
     @changeObjectState OBJECT_STATES.initing
     @setMaxListeners(Infinity)
     if @initialize.apply(@, arguments) isnt true

module.exports = class AbstractObject
  inherits AbstractObject, EventEmitter
  OBJECT_STATES: OBJECT_STATES
  @::__defineGetter__ "Class", ->
    return @__proto__.constructor
  @.prototype.__defineGetter__ "objectState", ->
    vState = @_objectState_
    if not vState? then "destroyed" else OBJECT_STATES_STR[vState]
  for vStateName, vState of OBJECT_STATES
    s = 'is'+ vStateName[0].toUpperCase() + vStateName.slice(1)
    @::[s] = ((aState)-> 

inherits          = require("inherits-ex/lib/inherits")
createObject      = require("inherits-ex/lib/createObject")
createObjectWith  = require("inherits-ex/lib/createObjectWith")
isArray           = require("util-ex/lib/is/type/array")
isFunction        = require("util-ex/lib/is/type/function")
isUndefined       = require("util-ex/lib/is/type/undefined")
defineProperty    = require("util-ex/lib/defineProperty")

# AbstractObject with Object State Events Supports.
# class should overwrite the init, final methods.
