X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=system%2Fspring%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsystem%2Fspring%2FSpringComponent.java;h=36b50e78f38db31b22993386daf00e9024a91f81;hb=4845c677310814de4c98e22aad483e49b9dfc594;hp=f7177759aeabe7865ed1f14f72c10d488efd277f;hpb=98856488516fbc8ba95bf0fd2fb739575da9ac5a;p=utils diff --git a/system/spring/src/main/java/org/wamblee/system/spring/SpringComponent.java b/system/spring/src/main/java/org/wamblee/system/spring/SpringComponent.java index f7177759..36b50e78 100644 --- a/system/spring/src/main/java/org/wamblee/system/spring/SpringComponent.java +++ b/system/spring/src/main/java/org/wamblee/system/spring/SpringComponent.java @@ -1,3 +1,18 @@ +/* + * 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; @@ -10,10 +25,10 @@ import org.springframework.beans.factory.support.RootBeanDefinition; 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 @@ -85,7 +100,7 @@ public class SpringComponent extends AbstractComponent { } @Override - protected void doStart(String aContext) { + protected void doStart() { SpringComponent old = THIS.get(); THIS.set(this); @@ -102,7 +117,7 @@ public class SpringComponent extends AbstractComponent { .addBeanFactoryPostProcessor(new PropertySetter(_properties)); _context.refresh(); - exposeProvidedServices(aContext); + exposeProvidedServices(); } catch (Exception e) { throw new SystemAssemblyException( "Failed to assemble spring system", e); @@ -111,16 +126,16 @@ public class SpringComponent extends AbstractComponent { } } - 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); } }