+/*
+ * Copyright 2007 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.wamblee.system.spring;
import java.util.Map;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
-import org.wamblee.system.AbstractComponent;
-import org.wamblee.system.ProvidedInterface;
-import org.wamblee.system.RequiredInterface;
-import org.wamblee.system.SystemAssemblyException;
+import org.wamblee.system.core.AbstractComponent;
+import org.wamblee.system.core.ProvidedInterface;
+import org.wamblee.system.core.RequiredInterface;
+import org.wamblee.system.core.SystemAssemblyException;
/**
* Represents a system configured based on spring. The spring config files that
}
@Override
- protected void doStart(String aContext) {
+ protected void doStart() {
SpringComponent old = THIS.get();
THIS.set(this);
.addBeanFactoryPostProcessor(new PropertySetter(_properties));
_context.refresh();
- exposeProvidedServices(aContext);
+ exposeProvidedServices();
} catch (Exception e) {
throw new SystemAssemblyException(
"Failed to assemble spring system", e);
}
}
- private void exposeProvidedServices(String aContext) {
+ private void exposeProvidedServices() {
// Call addService for each provided service.
for (String name : _provided.keySet()) {
Object svc = _context.getBean(name);
if (svc == null) {
- throw new IllegalArgumentException(aContext + ": service '"
+ throw new IllegalArgumentException(getQualifiedName() + ": service '"
+ name + "' is null");
}
- addService(aContext, _provided.get(name), svc);
+ addService(_provided.get(name), svc);
}
}