Event event=new Event(this,newState, terminationRecord); subscribers.event(event);
Event event=new Event(this,newState, old, terminationRecord); if(subscribers!=null) { subscribers.event(event); } else { log.warn("this component is incomplete; we are probably running unit tests"); }
    public synchronized void enterStateNotifying(LifecycleStateEnum newState,                                                 String info) {        stateInfo = info;        if (!newState.equals(state)) {            state = newState;            QName propname = null;            switch (state) {                case instantiated:                    propname = Constants.PROPERTY_SYSTEM_CREATED_TIME;                    break;                case initialized:                    break;                case running:                    propname = Constants.PROPERTY_SYSTEM_STARTED_TIME;                    break;                case failed:                case terminated:                    propname = Constants.PROPERTY_SYSTEM_TERMINATED_TIME;                    break;            }            if (propname != null) {                addTimeProperty(propname,                        null);            }            if (log.isDebugEnabled()) {                log.debug("Changing state:" + toString());            }            //create a notification            Event event=new Event(this,newState, terminationRecord);            subscribers.event(event);        } else {            if(log.isDebugEnabled()) {                log.debug("reentrant state entry for "+toString());            }        }    }