/** * Enters a new state, pusubhing an object onto the stack. If the object implements * {@link org.apache.hivemind.LocationHolder} then its location property is set to the * current location. * * @param elementName * the element whose start tag was just parsed * @param object * the object created to represent the new object * @param state * the new state for the parse * @param ignoreCharacterData * if true, then any character data (typically whitespace) directly enclosed by the * element is ignored */ protected void push(String elementName, Object object, int state, boolean ignoreCharacterData) { HiveMind.setLocation(object, getLocation()); Item item = new Item(elementName, object, _state, ignoreCharacterData); _stack.add(item); _top = item; _state = state; }
HiveMind.setLocation(result, location);
/** * Constructs the core service implementation (by invoking the * {@link ServiceImplementationConstructor}), and checks that the result is non-null and * assignable to the service interface. */ protected Object constructCoreServiceImplementation() { if (_log.isDebugEnabled()) _log.debug("Constructing core service implementation for service " + _servicePoint.getExtensionPointId()); Class serviceInterface = _servicePoint.getServiceInterface(); Class declaredInterface = _servicePoint.getDeclaredInterface(); ServiceImplementationConstructor constructor = _servicePoint.getServiceConstructor(); Object result = constructor.constructCoreServiceImplementation(); if (result == null) throw new ApplicationRuntimeException(ServiceModelMessages .factoryReturnedNull(_servicePoint), constructor.getLocation(), null); // The factory should provice something that either implements the service interface // or the declared interface. Again, they are normally the same, but with services // defined in terms of a class (not an interface), the service interface is // synthetic, and the declared interface is the actual class. if (!(serviceInterface.isInstance(result) || declaredInterface.isInstance(result))) throw new ApplicationRuntimeException(ServiceModelMessages.factoryWrongInterface( _servicePoint, result, serviceInterface), constructor.getLocation(), null); HiveMind.setLocation(result, constructor.getLocation()); return result; }