http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/ZestNamespaceHandler.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/ZestNamespaceHandler.java b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/ZestNamespaceHandler.java new file mode 100644 index 0000000..e1a975d --- /dev/null +++ b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/ZestNamespaceHandler.java @@ -0,0 +1,31 @@ +/* Copyright 2008 Edward Yakop. +* +* 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.apache.zest.library.spring.bootstrap.internal; + +import org.apache.zest.library.spring.bootstrap.internal.application.ZestBootstrapBeanDefinitionParser; +import org.apache.zest.library.spring.bootstrap.internal.service.ZestServiceBeanDefinitionParser; +import org.springframework.beans.factory.xml.NamespaceHandlerSupport; + +public final class ZestNamespaceHandler extends NamespaceHandlerSupport +{ + @Override + public final void init() + { + registerBeanDefinitionParser( "bootstrap", new ZestBootstrapBeanDefinitionParser() ); + registerBeanDefinitionParser( "service", new ZestServiceBeanDefinitionParser() ); + } +}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/Qi4jApplicationFactoryBean.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/Qi4jApplicationFactoryBean.java b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/Qi4jApplicationFactoryBean.java deleted file mode 100644 index 9739219..0000000 --- a/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/Qi4jApplicationFactoryBean.java +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright 2008 Edward Yakop. - * - * 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.apache.zest.library.spring.bootstrap.internal.application; - -import org.apache.zest.api.structure.Application; -import org.apache.zest.bootstrap.*; -import org.apache.zest.library.spring.bootstrap.Qi4jApplicationBootstrap; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.BeanInitializationException; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.FactoryBean; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.util.Assert; - -/** - * This class responsible to handle the lifecycle of qi4j application. - */ -public final class Qi4jApplicationFactoryBean - implements FactoryBean, DisposableBean, InitializingBean, ApplicationContextAware -{ - - private final Qi4jApplicationBootstrap applicationBootstrap; - - private Application application; - - public Qi4jApplicationFactoryBean( final Qi4jApplicationBootstrap applicationBootstrap ) - { - Assert.notNull( applicationBootstrap, "'applicationBootstrap' must not be null" ); - this.applicationBootstrap = applicationBootstrap; - } - - @Override - public final Application getObject() throws Exception - { - if ( this.application == null ) - { - this.application = this.createApplication(); - } - return this.application; - } - - @Override - public final Class<Application> getObjectType() - { - return Application.class; - } - - @Override - public final boolean isSingleton() - { - return true; - } - - @Override - public final void destroy() throws Exception - { - this.getObject().passivate(); - } - - @Override - public final void afterPropertiesSet() throws Exception - { - this.getObject().activate(); - } - - private Application createApplication() - { - Energy4Java energy4Java = new Energy4Java(); - try - { - return energy4Java.newApplication( new ApplicationAssembler() - { - - @Override - public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory ) - throws AssemblyException - { - final ApplicationAssembly applicationAssembly = applicationFactory.newApplicationAssembly(); - Qi4jApplicationFactoryBean.this.applicationBootstrap.assemble( applicationAssembly ); - return applicationAssembly; - } - } ); - } catch ( AssemblyException e ) - { - throw new BeanInitializationException( "Fail to bootstrap qi4j application.", e ); - } - - } - - @Override - public void setApplicationContext( final ApplicationContext applicationContext ) throws BeansException - { - if ( this.applicationBootstrap instanceof ApplicationContextAware ) - { - // propagate application context to the application bootstrap - ApplicationContextAware aware = (ApplicationContextAware) this.applicationBootstrap; - aware.setApplicationContext( applicationContext ); - } - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/Qi4jBootstrapBeanDefinitionParser.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/Qi4jBootstrapBeanDefinitionParser.java b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/Qi4jBootstrapBeanDefinitionParser.java deleted file mode 100644 index fdf218b..0000000 --- a/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/Qi4jBootstrapBeanDefinitionParser.java +++ /dev/null @@ -1,99 +0,0 @@ -/* Copyright 2008 Edward Yakop. - * - * 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.apache.zest.library.spring.bootstrap.internal.application; - -import org.apache.zest.library.spring.bootstrap.Qi4jApplicationBootstrap; -import org.springframework.beans.BeanInstantiationException; -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.support.AbstractBeanDefinition; -import org.springframework.beans.factory.support.BeanDefinitionBuilder; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.xml.BeanDefinitionParser; -import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.beans.factory.xml.XmlReaderContext; -import org.w3c.dom.Element; - -import static org.apache.zest.library.spring.bootstrap.Constants.BEAN_ID_QI4J_APPLICATION; -import static org.springframework.beans.BeanUtils.instantiateClass; -import static org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition; -import static org.springframework.util.Assert.hasText; -import static org.springframework.util.ClassUtils.forName; - -public final class Qi4jBootstrapBeanDefinitionParser - implements BeanDefinitionParser -{ - - private static final String CLASS = "class"; - - @Override - public final BeanDefinition parse( Element anElement, ParserContext aParserContext ) - { - Qi4jApplicationBootstrap bootstrap = createQi4jApplicationBootstrap( anElement, aParserContext ); - AbstractBeanDefinition factoryBeanDefinition = createQi4jApplicationFactoryBeanDefinition( bootstrap ); - registerBean( aParserContext, factoryBeanDefinition ); - return factoryBeanDefinition; - } - - private Qi4jApplicationBootstrap createQi4jApplicationBootstrap( Element anElement, ParserContext aParserContext ) - { - String bootstrapClassString = anElement.getAttribute( CLASS ); - hasText( bootstrapClassString ); - XmlReaderContext readerContext = aParserContext.getReaderContext(); - - Class<?> bootstrapClass; - try - { - bootstrapClass = forName( bootstrapClassString, getClass().getClassLoader() ); - } catch ( ClassNotFoundException e ) - { - readerContext.error( "Zest bootstrap class [" + bootstrapClassString + "] is not found.", anElement ); - return null; - } - - if ( !Qi4jApplicationBootstrap.class.isAssignableFrom( bootstrapClass ) ) - { - readerContext.error( CLASS + "attribute is not an instance of [" + Qi4jApplicationBootstrap.class.getName() - + "] class", anElement ); - return null; - } - - Qi4jApplicationBootstrap bootstrap = null; - try - { - bootstrap = (Qi4jApplicationBootstrap) instantiateClass( bootstrapClass ); - } catch ( BeanInstantiationException e ) - { - readerContext.error( "Fail to instantiate qi4j bootstrap class [" + bootstrapClassString + "]", anElement, - e ); - } - return bootstrap; - } - - private AbstractBeanDefinition createQi4jApplicationFactoryBeanDefinition( - final Qi4jApplicationBootstrap applicationBootstrap ) - { - BeanDefinitionBuilder builder = rootBeanDefinition( Qi4jApplicationFactoryBean.class ); - builder.addConstructorArgValue( applicationBootstrap ); - return builder.getBeanDefinition(); - } - - private void registerBean( ParserContext aParserContext, BeanDefinition aBeanDefinition ) - { - BeanDefinitionRegistry registry = aParserContext.getRegistry(); - registry.registerBeanDefinition( BEAN_ID_QI4J_APPLICATION, aBeanDefinition ); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/ZestApplicationFactoryBean.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/ZestApplicationFactoryBean.java b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/ZestApplicationFactoryBean.java new file mode 100644 index 0000000..6d98d36 --- /dev/null +++ b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/ZestApplicationFactoryBean.java @@ -0,0 +1,116 @@ +/* Copyright 2008 Edward Yakop. + * + * 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.apache.zest.library.spring.bootstrap.internal.application; + +import org.apache.zest.api.structure.Application; +import org.apache.zest.bootstrap.*; +import org.apache.zest.library.spring.bootstrap.ZestApplicationBootstrap; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.BeanInitializationException; +import org.springframework.beans.factory.DisposableBean; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.util.Assert; + +/** + * This class responsible to handle the lifecycle of Zest application. + */ +public final class ZestApplicationFactoryBean + implements FactoryBean, DisposableBean, InitializingBean, ApplicationContextAware +{ + + private final ZestApplicationBootstrap applicationBootstrap; + + private Application application; + + public ZestApplicationFactoryBean( final ZestApplicationBootstrap applicationBootstrap ) + { + Assert.notNull( applicationBootstrap, "'applicationBootstrap' must not be null" ); + this.applicationBootstrap = applicationBootstrap; + } + + @Override + public final Application getObject() throws Exception + { + if ( this.application == null ) + { + this.application = this.createApplication(); + } + return this.application; + } + + @Override + public final Class<Application> getObjectType() + { + return Application.class; + } + + @Override + public final boolean isSingleton() + { + return true; + } + + @Override + public final void destroy() throws Exception + { + this.getObject().passivate(); + } + + @Override + public final void afterPropertiesSet() throws Exception + { + this.getObject().activate(); + } + + private Application createApplication() + { + Energy4Java energy4Java = new Energy4Java(); + try + { + return energy4Java.newApplication( new ApplicationAssembler() + { + + @Override + public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory ) + throws AssemblyException + { + final ApplicationAssembly applicationAssembly = applicationFactory.newApplicationAssembly(); + ZestApplicationFactoryBean.this.applicationBootstrap.assemble( applicationAssembly ); + return applicationAssembly; + } + } ); + } catch ( AssemblyException e ) + { + throw new BeanInitializationException( "Fail to bootstrap Zest application.", e ); + } + + } + + @Override + public void setApplicationContext( final ApplicationContext applicationContext ) throws BeansException + { + if ( this.applicationBootstrap instanceof ApplicationContextAware ) + { + // propagate application context to the application bootstrap + ApplicationContextAware aware = (ApplicationContextAware) this.applicationBootstrap; + aware.setApplicationContext( applicationContext ); + } + } +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/ZestBootstrapBeanDefinitionParser.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/ZestBootstrapBeanDefinitionParser.java b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/ZestBootstrapBeanDefinitionParser.java new file mode 100644 index 0000000..0596f61 --- /dev/null +++ b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/application/ZestBootstrapBeanDefinitionParser.java @@ -0,0 +1,100 @@ +/* Copyright 2008 Edward Yakop. + * + * 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.apache.zest.library.spring.bootstrap.internal.application; + +import org.apache.zest.library.spring.bootstrap.ZestApplicationBootstrap; +import org.springframework.beans.BeanInstantiationException; +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.support.AbstractBeanDefinition; +import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.beans.factory.xml.BeanDefinitionParser; +import org.springframework.beans.factory.xml.ParserContext; +import org.springframework.beans.factory.xml.XmlReaderContext; +import org.w3c.dom.Element; + +import static org.apache.zest.library.spring.bootstrap.Constants.BEAN_ID_ZEST_APPLICATION; +import static org.springframework.beans.BeanUtils.instantiateClass; +import static org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition; +import static org.springframework.util.Assert.hasText; +import static org.springframework.util.ClassUtils.forName; + +public final class ZestBootstrapBeanDefinitionParser + implements BeanDefinitionParser +{ + + private static final String CLASS = "class"; + + @Override + public final BeanDefinition parse( Element anElement, ParserContext aParserContext ) + { + ZestApplicationBootstrap bootstrap = createZestApplicationBootstrap( anElement, aParserContext ); + AbstractBeanDefinition factoryBeanDefinition = createZestApplicationFactoryBeanDefinition( bootstrap ); + registerBean( aParserContext, factoryBeanDefinition ); + return factoryBeanDefinition; + } + + private ZestApplicationBootstrap createZestApplicationBootstrap( Element anElement, ParserContext aParserContext ) + { + String bootstrapClassString = anElement.getAttribute( CLASS ); + hasText( bootstrapClassString ); + XmlReaderContext readerContext = aParserContext.getReaderContext(); + + Class<?> bootstrapClass; + try + { + bootstrapClass = forName( bootstrapClassString, getClass().getClassLoader() ); + } catch ( ClassNotFoundException e ) + { + readerContext.error( "Zest bootstrap class [" + bootstrapClassString + "] is not found.", anElement ); + return null; + } + + if ( !ZestApplicationBootstrap.class.isAssignableFrom( bootstrapClass ) ) + { + readerContext.error( CLASS + "attribute is not an instance of [" + ZestApplicationBootstrap.class.getName() + + "] class", anElement ); + return null; + } + + ZestApplicationBootstrap bootstrap = null; + try + { + bootstrap = (ZestApplicationBootstrap) instantiateClass( bootstrapClass ); + } catch ( BeanInstantiationException e ) + { + readerContext.error( "Fail to instantiate Zest bootstrap class [" + bootstrapClassString + "]", anElement, + e ); + } + return bootstrap; + } + + private AbstractBeanDefinition createZestApplicationFactoryBeanDefinition( + final ZestApplicationBootstrap applicationBootstrap + ) + { + BeanDefinitionBuilder builder = rootBeanDefinition( ZestApplicationFactoryBean.class ); + builder.addConstructorArgValue( applicationBootstrap ); + return builder.getBeanDefinition(); + } + + private void registerBean( ParserContext aParserContext, BeanDefinition aBeanDefinition ) + { + BeanDefinitionRegistry registry = aParserContext.getRegistry(); + registry.registerBeanDefinition( BEAN_ID_ZEST_APPLICATION, aBeanDefinition ); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/service/Qi4jServiceBeanDefinitionParser.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/service/Qi4jServiceBeanDefinitionParser.java b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/service/Qi4jServiceBeanDefinitionParser.java deleted file mode 100644 index 1196bbd..0000000 --- a/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/service/Qi4jServiceBeanDefinitionParser.java +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 2008 Edward Yakop. -* -* 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.apache.zest.library.spring.bootstrap.internal.service; - -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.support.AbstractBeanDefinition; -import org.springframework.beans.factory.support.BeanDefinitionBuilder; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.xml.BeanDefinitionParser; -import org.springframework.beans.factory.xml.ParserContext; -import org.w3c.dom.Element; - -import static org.apache.zest.library.spring.bootstrap.Constants.BEAN_ID_QI4J_APPLICATION; -import static org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition; - -public final class Qi4jServiceBeanDefinitionParser - implements BeanDefinitionParser -{ - private static final String SERVICE_ID = "id"; - - @Override - public final BeanDefinition parse( Element anElement, ParserContext aParserContext ) - { - String serviceId = anElement.getAttribute( SERVICE_ID ); - - // Service factory bean - BeanDefinitionBuilder builder = rootBeanDefinition( ServiceFactoryBean.class ); - builder.addConstructorArgReference( BEAN_ID_QI4J_APPLICATION ); - builder.addConstructorArgValue( serviceId ); - AbstractBeanDefinition definition = builder.getBeanDefinition(); - - // Register service factory bean - BeanDefinitionRegistry definitionRegistry = aParserContext.getRegistry(); - definitionRegistry.registerBeanDefinition( serviceId, definition ); - - return definition; - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/service/ZestServiceBeanDefinitionParser.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/service/ZestServiceBeanDefinitionParser.java b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/service/ZestServiceBeanDefinitionParser.java new file mode 100644 index 0000000..0b7a0bd --- /dev/null +++ b/libraries/spring/src/main/java/org/apache/zest/library/spring/bootstrap/internal/service/ZestServiceBeanDefinitionParser.java @@ -0,0 +1,52 @@ +/* Copyright 2008 Edward Yakop. +* +* 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.apache.zest.library.spring.bootstrap.internal.service; + +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.support.AbstractBeanDefinition; +import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.beans.factory.xml.BeanDefinitionParser; +import org.springframework.beans.factory.xml.ParserContext; +import org.w3c.dom.Element; + +import static org.apache.zest.library.spring.bootstrap.Constants.BEAN_ID_ZEST_APPLICATION; +import static org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition; + +public final class ZestServiceBeanDefinitionParser + implements BeanDefinitionParser +{ + private static final String SERVICE_ID = "id"; + + @Override + public final BeanDefinition parse( Element anElement, ParserContext aParserContext ) + { + String serviceId = anElement.getAttribute( SERVICE_ID ); + + // Service factory bean + BeanDefinitionBuilder builder = rootBeanDefinition( ServiceFactoryBean.class ); + builder.addConstructorArgReference( BEAN_ID_ZEST_APPLICATION ); + builder.addConstructorArgValue( serviceId ); + AbstractBeanDefinition definition = builder.getBeanDefinition(); + + // Register service factory bean + BeanDefinitionRegistry definitionRegistry = aParserContext.getRegistry(); + definitionRegistry.registerBeanDefinition( serviceId, definition ); + + return definition; + } +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/main/resources/META-INF/spring.handlers ---------------------------------------------------------------------- diff --git a/libraries/spring/src/main/resources/META-INF/spring.handlers b/libraries/spring/src/main/resources/META-INF/spring.handlers index e23fa69..c90a359 100644 --- a/libraries/spring/src/main/resources/META-INF/spring.handlers +++ b/libraries/spring/src/main/resources/META-INF/spring.handlers @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -http\://www.qi4j.org/schema/qi4j/spring=org.apache.zest.library.spring.bootstrap.internal.Qi4jNamespaceHandler \ No newline at end of file +http\://zest.apache.org/schema/zest/spring=org.apache.zest.library.spring.bootstrap.internal.ZestNamespaceHandler \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/main/resources/META-INF/spring.schemas ---------------------------------------------------------------------- diff --git a/libraries/spring/src/main/resources/META-INF/spring.schemas b/libraries/spring/src/main/resources/META-INF/spring.schemas index 6695877..192ce71 100644 --- a/libraries/spring/src/main/resources/META-INF/spring.schemas +++ b/libraries/spring/src/main/resources/META-INF/spring.schemas @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -http\://www.qi4j.org/schema/qi4j/spring/spring-0.5.xsd=org/qi4j/library/spring/spring-0.5.xsd \ No newline at end of file +http\://zest.apache.org/schema/zest/spring/spring-0.5.xsd=org/apache/zest/library/spring/spring-0.5.xsd \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/main/resources/org/apache/zest/library/spring/spring-0.5.xsd ---------------------------------------------------------------------- diff --git a/libraries/spring/src/main/resources/org/apache/zest/library/spring/spring-0.5.xsd b/libraries/spring/src/main/resources/org/apache/zest/library/spring/spring-0.5.xsd index af62ecc..db3b486 100644 --- a/libraries/spring/src/main/resources/org/apache/zest/library/spring/spring-0.5.xsd +++ b/libraries/spring/src/main/resources/org/apache/zest/library/spring/spring-0.5.xsd @@ -15,10 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. --> -<xsd:schema xmlns="http://www.qi4j.org/schema/qi4j/spring" +<xsd:schema xmlns="http://zest.apache.org/schema/zest/spring" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:beans="http://www.springframework.org/schema/beans" - targetNamespace="http://www.qi4j.org/schema/qi4j/spring" + targetNamespace="http://zest.apache.org/schema/zest/spring" elementFormDefault="qualified" attributeFormDefault="unqualified"> @@ -27,7 +27,7 @@ <xsd:element name="bootstrap"> <xsd:annotation> <xsd:documentation><![CDATA[ -Defines qi4j application bootstrap. +Defines Apache Zest application bootstrap. ]]></xsd:documentation> </xsd:annotation> <xsd:complexType> @@ -35,7 +35,7 @@ Defines qi4j application bootstrap. </xsd:complexType> </xsd:element> - <!-- Qi4j application attributes --> + <!-- Zest application attributes --> <xsd:attributeGroup name="bootstrapAttributes"> <xsd:attribute name="class" type="xsd:string" use="required"> <xsd:annotation> @@ -49,7 +49,7 @@ Full class name of bootstrap class. <xsd:element name="service"> <xsd:annotation> <xsd:documentation><![CDATA[ -Defines qi4j service to be exposed as spring bean. +Defines Apache Zest service to be exposed as spring bean. ]]></xsd:documentation> </xsd:annotation> <xsd:complexType> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/test/java/org/apache/zest/library/spring/MyZestBootstrapper.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/test/java/org/apache/zest/library/spring/MyZestBootstrapper.java b/libraries/spring/src/test/java/org/apache/zest/library/spring/MyZestBootstrapper.java index 7b983ff..5df283e 100644 --- a/libraries/spring/src/test/java/org/apache/zest/library/spring/MyZestBootstrapper.java +++ b/libraries/spring/src/test/java/org/apache/zest/library/spring/MyZestBootstrapper.java @@ -20,13 +20,13 @@ package org.apache.zest.library.spring; import org.apache.zest.bootstrap.ApplicationAssembly; import org.apache.zest.bootstrap.AssemblyException; -import org.apache.zest.library.spring.bootstrap.Qi4jApplicationBootstrap; +import org.apache.zest.library.spring.bootstrap.ZestApplicationBootstrap; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; // START SNIPPET: code -public class MyZestBootstrapper extends Qi4jApplicationBootstrap +public class MyZestBootstrapper extends ZestApplicationBootstrap implements ApplicationContextAware { private ApplicationContext applicationContext; http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/Qi4jExportServiceTest.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/Qi4jExportServiceTest.java b/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/Qi4jExportServiceTest.java deleted file mode 100644 index 3f2ee45..0000000 --- a/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/Qi4jExportServiceTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright 2008 Edward Yakop. - * - * 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.apache.zest.library.spring.bootstrap; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import static org.junit.Assert.*; -import static org.apache.zest.library.spring.bootstrap.Qi4jTestBootstrap.COMMENT_SERVICE_ID; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration -public final class Qi4jExportServiceTest -{ - @Autowired - private ApplicationContext appContext; - - @Test - public final void testCommentService() - { - assertTrue( appContext.containsBean( COMMENT_SERVICE_ID ) ); - - CommentService commentService = (CommentService) appContext.getBean( COMMENT_SERVICE_ID ); - assertNotNull( commentService ); - - String beerComment = commentService.comment( "beer" ); - assertEquals( "BEER IS GOOD.", beerComment ); - - String colaComment = commentService.comment( "cola" ); - assertEquals( "COLA IS GOOD.", colaComment ); - - String colaBeerComment = commentService.comment( "cola+beer" ); - assertEquals( "COLA+BEER IS BAAAD.", colaBeerComment ); - - CommentServiceHolder holder = (CommentServiceHolder) appContext.getBean( "commentServiceHolder" ); - assertTrue( commentService == holder.service() ); - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/Qi4jTestBootstrap.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/Qi4jTestBootstrap.java b/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/Qi4jTestBootstrap.java deleted file mode 100644 index ae7de6d..0000000 --- a/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/Qi4jTestBootstrap.java +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright 2008 Edward Yakop. - * - * 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.apache.zest.library.spring.bootstrap; - -import org.apache.zest.bootstrap.ApplicationAssembly; -import org.apache.zest.bootstrap.AssemblyException; -import org.apache.zest.bootstrap.LayerAssembly; -import org.apache.zest.bootstrap.ModuleAssembly; -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; - -public final class Qi4jTestBootstrap - extends Qi4jApplicationBootstrap - implements ApplicationContextAware -{ - private static final String LAYER = "layer"; - - private static final String MODULE = "module"; - - static final String COMMENT_SERVICE_ID = "commentService"; - - private static final String TO_UPPERCASE_SERVICE_ID = "toUppercaseService"; - - private ApplicationContext applicationContext; - - public final void assemble( ApplicationAssembly applicationAssembly ) throws AssemblyException - { - LayerAssembly layerAssembly = applicationAssembly.layer( LAYER ); - ModuleAssembly moduleAssembly = layerAssembly.module( MODULE ); - moduleAssembly.services( CommentServiceComposite.class ).identifiedBy( COMMENT_SERVICE_ID ); - // inject Spring bean as a service - moduleAssembly.importedServices( TextProcessingService.class ).setMetaInfo( - this.applicationContext.getBean( TO_UPPERCASE_SERVICE_ID ) ); - } - - public void setApplicationContext( ApplicationContext applicationContext ) throws BeansException - { - this.applicationContext = applicationContext; - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/ZestExportServiceTest.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/ZestExportServiceTest.java b/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/ZestExportServiceTest.java new file mode 100644 index 0000000..25230d7 --- /dev/null +++ b/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/ZestExportServiceTest.java @@ -0,0 +1,56 @@ +/* Copyright 2008 Edward Yakop. + * + * 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.apache.zest.library.spring.bootstrap; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import static org.junit.Assert.*; +import static org.apache.zest.library.spring.bootstrap.ZestTestBootstrap.COMMENT_SERVICE_ID; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration +public final class ZestExportServiceTest +{ + @Autowired + private ApplicationContext appContext; + + @Test + public final void testCommentService() + { + assertTrue( appContext.containsBean( COMMENT_SERVICE_ID ) ); + + CommentService commentService = (CommentService) appContext.getBean( COMMENT_SERVICE_ID ); + assertNotNull( commentService ); + + String beerComment = commentService.comment( "beer" ); + assertEquals( "BEER IS GOOD.", beerComment ); + + String colaComment = commentService.comment( "cola" ); + assertEquals( "COLA IS GOOD.", colaComment ); + + String colaBeerComment = commentService.comment( "cola+beer" ); + assertEquals( "COLA+BEER IS BAAAD.", colaBeerComment ); + + CommentServiceHolder holder = (CommentServiceHolder) appContext.getBean( "commentServiceHolder" ); + assertTrue( commentService == holder.service() ); + } +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/ZestTestBootstrap.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/ZestTestBootstrap.java b/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/ZestTestBootstrap.java new file mode 100644 index 0000000..ed3f15d --- /dev/null +++ b/libraries/spring/src/test/java/org/apache/zest/library/spring/bootstrap/ZestTestBootstrap.java @@ -0,0 +1,55 @@ +/* Copyright 2008 Edward Yakop. + * + * 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.apache.zest.library.spring.bootstrap; + +import org.apache.zest.bootstrap.ApplicationAssembly; +import org.apache.zest.bootstrap.AssemblyException; +import org.apache.zest.bootstrap.LayerAssembly; +import org.apache.zest.bootstrap.ModuleAssembly; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; + +public final class ZestTestBootstrap + extends ZestApplicationBootstrap + implements ApplicationContextAware +{ + private static final String LAYER = "layer"; + + private static final String MODULE = "module"; + + static final String COMMENT_SERVICE_ID = "commentService"; + + private static final String TO_UPPERCASE_SERVICE_ID = "toUppercaseService"; + + private ApplicationContext applicationContext; + + public final void assemble( ApplicationAssembly applicationAssembly ) throws AssemblyException + { + LayerAssembly layerAssembly = applicationAssembly.layer( LAYER ); + ModuleAssembly moduleAssembly = layerAssembly.module( MODULE ); + moduleAssembly.services( CommentServiceComposite.class ).identifiedBy( COMMENT_SERVICE_ID ); + // inject Spring bean as a service + moduleAssembly.importedServices( TextProcessingService.class ).setMetaInfo( + this.applicationContext.getBean( TO_UPPERCASE_SERVICE_ID ) ); + } + + public void setApplicationContext( ApplicationContext applicationContext ) throws BeansException + { + this.applicationContext = applicationContext; + } +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/test/java/org/apache/zest/library/spring/importer/Qi4jImportServiceTest.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/test/java/org/apache/zest/library/spring/importer/Qi4jImportServiceTest.java b/libraries/spring/src/test/java/org/apache/zest/library/spring/importer/Qi4jImportServiceTest.java deleted file mode 100644 index eee6f30..0000000 --- a/libraries/spring/src/test/java/org/apache/zest/library/spring/importer/Qi4jImportServiceTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright 2008 Rickard Ãberg. -* -* 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.apache.zest.library.spring.importer; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.apache.zest.api.activation.ActivationException; -import org.apache.zest.api.injection.scope.Service; -import org.apache.zest.api.injection.scope.Structure; -import org.apache.zest.api.service.ServiceFinder; -import org.apache.zest.api.service.ServiceReference; -import org.apache.zest.api.service.qualifier.ServiceQualifier; -import org.apache.zest.bootstrap.AssemblyException; -import org.apache.zest.bootstrap.ModuleAssembly; -import org.apache.zest.bootstrap.SingletonAssembler; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; -import static org.apache.zest.api.service.qualifier.ServiceQualifier.firstService; -import static org.apache.zest.api.service.qualifier.ServiceQualifier.withId; - -@RunWith( SpringJUnit4ClassRunner.class ) -@ContextConfiguration -public final class Qi4jImportServiceTest -{ - @Autowired ApplicationContext appContext; - - @Service CommentService service; - - @Test - public final void givenImportedSpringServicesWhenServiceIsInjectedThenUseSpringService() - throws ActivationException, AssemblyException - { - SingletonAssembler assembler = new SingletonAssembler() - { - public void assemble( ModuleAssembly module ) throws AssemblyException - { - module.objects( Qi4jImportServiceTest.class ); - // START SNIPPET: import - new SpringImporterAssembler( appContext ).assemble( module ); - // END SNIPPET: import - } - }; - - assembler.module().injectTo( this ); - - assertThat( "service can be called", service.comment( "beer" ), equalTo( "beer is good." ) ); - } - - @Service Iterable<ServiceReference<CommentService>> services; - - @Test - public final void givenImportedSpringServicesWhenServicesAreInjectedThenCanIdentifyByName() - throws ActivationException, AssemblyException - { - SingletonAssembler assembler = new SingletonAssembler() - { - public void assemble( ModuleAssembly module ) throws AssemblyException - { - module.objects( Qi4jImportServiceTest.class ); - - new SpringImporterAssembler( appContext ).assemble( module ); - } - }; - - assembler.module().injectTo(this); - - CommentService service = firstService( withId( "commentService2" ), services ); - assertThat( "service with correct id has been selected", service.comment( "pizza" ), equalTo( "pizza is good." ) ); - } - - @Structure ServiceFinder finder; - - @Test - public final void givenImportedSpringServicesWhenServicesAreFoundThenCanIdentifyByName() - throws ActivationException, AssemblyException - { - SingletonAssembler assembler = new SingletonAssembler() - { - public void assemble( ModuleAssembly module ) throws AssemblyException - { - module.objects( Qi4jImportServiceTest.class ); - - new SpringImporterAssembler( appContext ).assemble( module ); - } - }; - - assembler.module().injectTo( this ); - - CommentService foundService = ServiceQualifier.firstService( withId( "commentService2" ), finder.<CommentService>findServices( CommentService.class )); - assertThat( "service with correct id has been selected", foundService.comment( "pizza" ), equalTo( "pizza is good." ) ); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/test/java/org/apache/zest/library/spring/importer/ZestImportServiceTest.java ---------------------------------------------------------------------- diff --git a/libraries/spring/src/test/java/org/apache/zest/library/spring/importer/ZestImportServiceTest.java b/libraries/spring/src/test/java/org/apache/zest/library/spring/importer/ZestImportServiceTest.java new file mode 100644 index 0000000..27a475d --- /dev/null +++ b/libraries/spring/src/test/java/org/apache/zest/library/spring/importer/ZestImportServiceTest.java @@ -0,0 +1,111 @@ +/* Copyright 2008 Rickard Ãberg. +* +* 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.apache.zest.library.spring.importer; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.apache.zest.api.activation.ActivationException; +import org.apache.zest.api.injection.scope.Service; +import org.apache.zest.api.injection.scope.Structure; +import org.apache.zest.api.service.ServiceFinder; +import org.apache.zest.api.service.ServiceReference; +import org.apache.zest.api.service.qualifier.ServiceQualifier; +import org.apache.zest.bootstrap.AssemblyException; +import org.apache.zest.bootstrap.ModuleAssembly; +import org.apache.zest.bootstrap.SingletonAssembler; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.junit.Assert.assertThat; +import static org.apache.zest.api.service.qualifier.ServiceQualifier.firstService; +import static org.apache.zest.api.service.qualifier.ServiceQualifier.withId; + +@RunWith( SpringJUnit4ClassRunner.class ) +@ContextConfiguration +public final class ZestImportServiceTest +{ + @Autowired ApplicationContext appContext; + + @Service CommentService service; + + @Test + public final void givenImportedSpringServicesWhenServiceIsInjectedThenUseSpringService() + throws ActivationException, AssemblyException + { + SingletonAssembler assembler = new SingletonAssembler() + { + public void assemble( ModuleAssembly module ) throws AssemblyException + { + module.objects( ZestImportServiceTest.class ); + // START SNIPPET: import + new SpringImporterAssembler( appContext ).assemble( module ); + // END SNIPPET: import + } + }; + + assembler.module().injectTo( this ); + + assertThat( "service can be called", service.comment( "beer" ), equalTo( "beer is good." ) ); + } + + @Service Iterable<ServiceReference<CommentService>> services; + + @Test + public final void givenImportedSpringServicesWhenServicesAreInjectedThenCanIdentifyByName() + throws ActivationException, AssemblyException + { + SingletonAssembler assembler = new SingletonAssembler() + { + public void assemble( ModuleAssembly module ) throws AssemblyException + { + module.objects( ZestImportServiceTest.class ); + + new SpringImporterAssembler( appContext ).assemble( module ); + } + }; + + assembler.module().injectTo(this); + + CommentService service = firstService( withId( "commentService2" ), services ); + assertThat( "service with correct id has been selected", service.comment( "pizza" ), equalTo( "pizza is good." ) ); + } + + @Structure ServiceFinder finder; + + @Test + public final void givenImportedSpringServicesWhenServicesAreFoundThenCanIdentifyByName() + throws ActivationException, AssemblyException + { + SingletonAssembler assembler = new SingletonAssembler() + { + public void assemble( ModuleAssembly module ) throws AssemblyException + { + module.objects( ZestImportServiceTest.class ); + + new SpringImporterAssembler( appContext ).assemble( module ); + } + }; + + assembler.module().injectTo( this ); + + CommentService foundService = ServiceQualifier.firstService( withId( "commentService2" ), finder.<CommentService>findServices( CommentService.class )); + assertThat( "service with correct id has been selected", foundService.comment( "pizza" ), equalTo( "pizza is good." ) ); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/test/resources/org/apache/zest/library/spring/bootstrap/Qi4jExportServiceTest-context.xml ---------------------------------------------------------------------- diff --git a/libraries/spring/src/test/resources/org/apache/zest/library/spring/bootstrap/Qi4jExportServiceTest-context.xml b/libraries/spring/src/test/resources/org/apache/zest/library/spring/bootstrap/Qi4jExportServiceTest-context.xml deleted file mode 100644 index e1d9ca5..0000000 --- a/libraries/spring/src/test/resources/org/apache/zest/library/spring/bootstrap/Qi4jExportServiceTest-context.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You 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. ---> -<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:qi4j="http://www.qi4j.org/schema/qi4j/spring" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://www.qi4j.org/schema/qi4j/spring http://www.qi4j.org/schema/qi4j/spring/spring-0.5.xsd"> - - <qi4j:bootstrap class="org.apache.zest.library.spring.bootstrap.Qi4jTestBootstrap" /> - <qi4j:service id="commentService" /> - - <bean id="commentServiceHolder" class="org.apache.zest.library.spring.bootstrap.CommentServiceHolder"> - <constructor-arg ref="commentService" /> - </bean> - - <!-- This Spring bean is injected as a service to the qi4j application --> - <bean id="toUppercaseService" class="org.apache.zest.library.spring.bootstrap.ToUppercaseService" /> - -</beans> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/test/resources/org/apache/zest/library/spring/bootstrap/ZestExportServiceTest-context.xml ---------------------------------------------------------------------- diff --git a/libraries/spring/src/test/resources/org/apache/zest/library/spring/bootstrap/ZestExportServiceTest-context.xml b/libraries/spring/src/test/resources/org/apache/zest/library/spring/bootstrap/ZestExportServiceTest-context.xml new file mode 100644 index 0000000..892b8fe --- /dev/null +++ b/libraries/spring/src/test/resources/org/apache/zest/library/spring/bootstrap/ZestExportServiceTest-context.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. +--> +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:zest="http://zest.apache.org/schema/zest/spring" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd + http://zest.apache.org/schema/zest/spring http://zest.apache.org/schema/zest/spring/spring-0.5.xsd"> + + <zest:bootstrap class="org.apache.zest.library.spring.bootstrap.ZestTestBootstrap" /> + <zest:service id="commentService" /> + + <bean id="commentServiceHolder" class="org.apache.zest.library.spring.bootstrap.CommentServiceHolder"> + <constructor-arg ref="commentService" /> + </bean> + + <!-- This Spring bean is injected as a service to the Apache Zest application --> + <bean id="toUppercaseService" class="org.apache.zest.library.spring.bootstrap.ToUppercaseService" /> + +</beans> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/test/resources/org/apache/zest/library/spring/importer/Qi4jImportServiceTest-context.xml ---------------------------------------------------------------------- diff --git a/libraries/spring/src/test/resources/org/apache/zest/library/spring/importer/Qi4jImportServiceTest-context.xml b/libraries/spring/src/test/resources/org/apache/zest/library/spring/importer/Qi4jImportServiceTest-context.xml deleted file mode 100644 index 1782415..0000000 --- a/libraries/spring/src/test/resources/org/apache/zest/library/spring/importer/Qi4jImportServiceTest-context.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You 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. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> - - <bean id="commentService" class="org.apache.zest.library.spring.importer.CommentServiceBean"/> - <bean id="commentService2" class="org.apache.zest.library.spring.importer.CommentServiceBean2"/> -</beans> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/spring/src/test/resources/org/apache/zest/library/spring/importer/ZestImportServiceTest-context.xml ---------------------------------------------------------------------- diff --git a/libraries/spring/src/test/resources/org/apache/zest/library/spring/importer/ZestImportServiceTest-context.xml b/libraries/spring/src/test/resources/org/apache/zest/library/spring/importer/ZestImportServiceTest-context.xml new file mode 100644 index 0000000..1782415 --- /dev/null +++ b/libraries/spring/src/test/resources/org/apache/zest/library/spring/importer/ZestImportServiceTest-context.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. +--> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> + + <bean id="commentService" class="org.apache.zest.library.spring.importer.CommentServiceBean"/> + <bean id="commentService2" class="org.apache.zest.library.spring.importer.CommentServiceBean2"/> +</beans> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/sql-bonecp/build.gradle ---------------------------------------------------------------------- diff --git a/libraries/sql-bonecp/build.gradle b/libraries/sql-bonecp/build.gradle index a503338..144169d 100644 --- a/libraries/sql-bonecp/build.gradle +++ b/libraries/sql-bonecp/build.gradle @@ -22,7 +22,7 @@ description = "Apache Zest⢠SQL BoneCP Library provides BoneCP support." jar { manifest { name = "Apache Zest⢠Library - SQL BoneCP" }} dependencies { - compile(project(":org.qi4j.libraries:org.qi4j.library.sql")) + compile(project(":org.apache.zest.libraries:org.apache.zest.library.sql")) compile(libraries.bonecp) } http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/sql-bonecp/dev-status.xml ---------------------------------------------------------------------- diff --git a/libraries/sql-bonecp/dev-status.xml b/libraries/sql-bonecp/dev-status.xml index bdf00e7..b316462 100644 --- a/libraries/sql-bonecp/dev-status.xml +++ b/libraries/sql-bonecp/dev-status.xml @@ -15,10 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. --> -<module xmlns="http://www.qi4j.org/schemas/2008/dev-status/1" +<module xmlns="http://zest.apache.org/schemas/2008/dev-status/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.qi4j.org/schemas/2008/dev-status/1 - http://www.qi4j.org/schemas/2008/dev-status/1/dev-status.xsd"> + xsi:schemaLocation="http://zest.apache.org/schemas/2008/dev-status/1 + http://zest.apache.org/schemas/2008/dev-status/1/dev-status.xsd"> <status> <!--none,early,beta,stable,mature--> <codebase>stable</codebase> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/sql-dbcp/build.gradle ---------------------------------------------------------------------- diff --git a/libraries/sql-dbcp/build.gradle b/libraries/sql-dbcp/build.gradle index 51abe7c..55ee283 100644 --- a/libraries/sql-dbcp/build.gradle +++ b/libraries/sql-dbcp/build.gradle @@ -22,7 +22,7 @@ description = "Apache Zest⢠SQL DBCP Library provides DBCP support." jar { manifest { name = "Apache Zest⢠Library - SQL DBCP" }} dependencies { - compile(project(":org.qi4j.libraries:org.qi4j.library.sql")) + compile(project(":org.apache.zest.libraries:org.apache.zest.library.sql")) compile(libraries.commons_dbcp) } http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/sql-dbcp/dev-status.xml ---------------------------------------------------------------------- diff --git a/libraries/sql-dbcp/dev-status.xml b/libraries/sql-dbcp/dev-status.xml index bdf00e7..b316462 100644 --- a/libraries/sql-dbcp/dev-status.xml +++ b/libraries/sql-dbcp/dev-status.xml @@ -15,10 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. --> -<module xmlns="http://www.qi4j.org/schemas/2008/dev-status/1" +<module xmlns="http://zest.apache.org/schemas/2008/dev-status/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.qi4j.org/schemas/2008/dev-status/1 - http://www.qi4j.org/schemas/2008/dev-status/1/dev-status.xsd"> + xsi:schemaLocation="http://zest.apache.org/schemas/2008/dev-status/1 + http://zest.apache.org/schemas/2008/dev-status/1/dev-status.xsd"> <status> <!--none,early,beta,stable,mature--> <codebase>stable</codebase> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/sql-liquibase/build.gradle ---------------------------------------------------------------------- diff --git a/libraries/sql-liquibase/build.gradle b/libraries/sql-liquibase/build.gradle index 910552e..b50e148 100644 --- a/libraries/sql-liquibase/build.gradle +++ b/libraries/sql-liquibase/build.gradle @@ -22,14 +22,14 @@ description = "Apache Zest⢠SQL Liquibase Library provides Liquibase support." jar { manifest { name = "Apache Zest⢠Library - SQL Liquibase" }} dependencies { - compile(project(":org.qi4j.libraries:org.qi4j.library.sql")) + compile(project(":org.apache.zest.libraries:org.apache.zest.library.sql")) compile(libraries.liquibase) compile libraries.slf4j_api - testCompile(project(":org.qi4j.core:org.qi4j.core.testsupport")) - testCompile(project(":org.qi4j.libraries:org.qi4j.library.sql-dbcp")) + testCompile(project(":org.apache.zest.core:org.apache.zest.core.testsupport")) + testCompile(project(":org.apache.zest.libraries:org.apache.zest.library.sql-dbcp")) - testRuntime(project(":org.qi4j.core:org.qi4j.core.runtime")) + testRuntime(project(":org.apache.zest.core:org.apache.zest.core.runtime")) testRuntime(libraries.derby) testRuntime(libraries.logback) } http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/sql-liquibase/dev-status.xml ---------------------------------------------------------------------- diff --git a/libraries/sql-liquibase/dev-status.xml b/libraries/sql-liquibase/dev-status.xml index bdf00e7..b316462 100644 --- a/libraries/sql-liquibase/dev-status.xml +++ b/libraries/sql-liquibase/dev-status.xml @@ -15,10 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. --> -<module xmlns="http://www.qi4j.org/schemas/2008/dev-status/1" +<module xmlns="http://zest.apache.org/schemas/2008/dev-status/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.qi4j.org/schemas/2008/dev-status/1 - http://www.qi4j.org/schemas/2008/dev-status/1/dev-status.xsd"> + xsi:schemaLocation="http://zest.apache.org/schemas/2008/dev-status/1 + http://zest.apache.org/schemas/2008/dev-status/1/dev-status.xsd"> <status> <!--none,early,beta,stable,mature--> <codebase>stable</codebase> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/sql-liquibase/src/main/java/org/apache/zest/library/sql/liquibase/LiquibaseService.java ---------------------------------------------------------------------- diff --git a/libraries/sql-liquibase/src/main/java/org/apache/zest/library/sql/liquibase/LiquibaseService.java b/libraries/sql-liquibase/src/main/java/org/apache/zest/library/sql/liquibase/LiquibaseService.java index 66ba937..807478c 100644 --- a/libraries/sql-liquibase/src/main/java/org/apache/zest/library/sql/liquibase/LiquibaseService.java +++ b/libraries/sql-liquibase/src/main/java/org/apache/zest/library/sql/liquibase/LiquibaseService.java @@ -64,7 +64,7 @@ public interface LiquibaseService implements LiquibaseService { - private static final Logger LOGGER = LoggerFactory.getLogger( "org.qi4j.library.sql" ); + private static final Logger LOGGER = LoggerFactory.getLogger( "org.apache.zest.library.sql" ); @This Configuration<LiquibaseConfiguration> config; http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/sql/build.gradle ---------------------------------------------------------------------- diff --git a/libraries/sql/build.gradle b/libraries/sql/build.gradle index d4789c3..40d6d9f 100644 --- a/libraries/sql/build.gradle +++ b/libraries/sql/build.gradle @@ -22,18 +22,18 @@ description = "Apache Zest⢠SQL Library provides SQL support." jar { manifest { name = "Apache Zest⢠Library - SQL" }} dependencies { - compile(project(":org.qi4j.core:org.qi4j.core.bootstrap")) - compile(project(":org.qi4j.libraries:org.qi4j.library.circuitbreaker")) - compile(project(":org.qi4j.libraries:org.qi4j.library.conversion")) - compile(project(":org.qi4j.libraries:org.qi4j.library.jmx")) + compile(project(":org.apache.zest.core:org.apache.zest.core.bootstrap")) + compile(project(":org.apache.zest.libraries:org.apache.zest.library.circuitbreaker")) + compile(project(":org.apache.zest.libraries:org.apache.zest.library.conversion")) + compile(project(":org.apache.zest.libraries:org.apache.zest.library.jmx")) compile libraries.slf4j_api - testCompile(project(":org.qi4j.core:org.qi4j.core.testsupport")) - testCompile(project(":org.qi4j.core:org.qi4j.core.runtime")) - testCompile(project(":org.qi4j.libraries:org.qi4j.library.sql-bonecp")) - testCompile(project(":org.qi4j.libraries:org.qi4j.library.sql-dbcp")) - testCompile(project(":org.qi4j.libraries:org.qi4j.library.sql-liquibase")) - testCompile(project(":org.qi4j.extensions:org.qi4j.extension.entitystore-preferences")) + testCompile(project(":org.apache.zest.core:org.apache.zest.core.testsupport")) + testCompile(project(":org.apache.zest.core:org.apache.zest.core.runtime")) + testCompile(project(":org.apache.zest.libraries:org.apache.zest.library.sql-bonecp")) + testCompile(project(":org.apache.zest.libraries:org.apache.zest.library.sql-dbcp")) + testCompile(project(":org.apache.zest.libraries:org.apache.zest.library.sql-liquibase")) + testCompile(project(":org.apache.zest.extensions:org.apache.zest.extension.entitystore-preferences")) testRuntime(libraries.derby) testRuntime(libraries.mysql_connector) http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/sql/dev-status.xml ---------------------------------------------------------------------- diff --git a/libraries/sql/dev-status.xml b/libraries/sql/dev-status.xml index bdf00e7..b316462 100644 --- a/libraries/sql/dev-status.xml +++ b/libraries/sql/dev-status.xml @@ -15,10 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. --> -<module xmlns="http://www.qi4j.org/schemas/2008/dev-status/1" +<module xmlns="http://zest.apache.org/schemas/2008/dev-status/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.qi4j.org/schemas/2008/dev-status/1 - http://www.qi4j.org/schemas/2008/dev-status/1/dev-status.xsd"> + xsi:schemaLocation="http://zest.apache.org/schemas/2008/dev-status/1 + http://zest.apache.org/schemas/2008/dev-status/1/dev-status.xsd"> <status> <!--none,early,beta,stable,mature--> <codebase>stable</codebase> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/sql/src/main/java/org/apache/zest/library/sql/jmx/DataSourceConfigurationManagerService.java ---------------------------------------------------------------------- diff --git a/libraries/sql/src/main/java/org/apache/zest/library/sql/jmx/DataSourceConfigurationManagerService.java b/libraries/sql/src/main/java/org/apache/zest/library/sql/jmx/DataSourceConfigurationManagerService.java index bba72b8..1a4e812 100644 --- a/libraries/sql/src/main/java/org/apache/zest/library/sql/jmx/DataSourceConfigurationManagerService.java +++ b/libraries/sql/src/main/java/org/apache/zest/library/sql/jmx/DataSourceConfigurationManagerService.java @@ -56,7 +56,7 @@ import org.apache.zest.api.structure.Module; import org.apache.zest.api.unitofwork.UnitOfWork; import org.apache.zest.api.unitofwork.UnitOfWorkCompletionException; import org.apache.zest.library.sql.datasource.DataSourceConfiguration; -import org.apache.zest.spi.Qi4jSPI; +import org.apache.zest.spi.ZestSPI; /** * Expose DataSourceConfiguration through JMX. @@ -105,7 +105,7 @@ public interface DataSourceConfigurationManagerService MBeanServer server; @Structure - Qi4jSPI spi; + ZestSPI spi; @Structure Application application; http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/sql/src/test/java/org/apache/zest/library/sql/datasource/ExternalDataSourceTest.java ---------------------------------------------------------------------- diff --git a/libraries/sql/src/test/java/org/apache/zest/library/sql/datasource/ExternalDataSourceTest.java b/libraries/sql/src/test/java/org/apache/zest/library/sql/datasource/ExternalDataSourceTest.java index 29f6774..74eb368 100644 --- a/libraries/sql/src/test/java/org/apache/zest/library/sql/datasource/ExternalDataSourceTest.java +++ b/libraries/sql/src/test/java/org/apache/zest/library/sql/datasource/ExternalDataSourceTest.java @@ -23,10 +23,10 @@ import org.apache.zest.bootstrap.AssemblyException; import org.apache.zest.bootstrap.ModuleAssembly; import org.apache.zest.library.sql.assembly.ExternalDataSourceAssembler; import org.apache.zest.library.sql.common.SQLUtil; -import org.apache.zest.test.AbstractQi4jTest; +import org.apache.zest.test.AbstractZestTest; public class ExternalDataSourceTest - extends AbstractQi4jTest + extends AbstractZestTest { @Override http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/uid/build.gradle ---------------------------------------------------------------------- diff --git a/libraries/uid/build.gradle b/libraries/uid/build.gradle index eb6dcfd..871e6d8 100644 --- a/libraries/uid/build.gradle +++ b/libraries/uid/build.gradle @@ -22,10 +22,10 @@ description = "Apache Zest⢠UID Library contains various Identity generation s jar { manifest { name = "Apache Zest⢠Library - UID" }} dependencies { - compile(project(":org.qi4j.core:org.qi4j.core.bootstrap")) + compile(project(":org.apache.zest.core:org.apache.zest.core.bootstrap")) - testCompile(project(":org.qi4j.core:org.qi4j.core.testsupport")) + testCompile(project(":org.apache.zest.core:org.apache.zest.core.testsupport")) - testRuntime(project(":org.qi4j.core:org.qi4j.core.runtime")) + testRuntime(project(":org.apache.zest.core:org.apache.zest.core.runtime")) testRuntime(libraries.logback) } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/uid/dev-status.xml ---------------------------------------------------------------------- diff --git a/libraries/uid/dev-status.xml b/libraries/uid/dev-status.xml index bdf00e7..b316462 100644 --- a/libraries/uid/dev-status.xml +++ b/libraries/uid/dev-status.xml @@ -15,10 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. --> -<module xmlns="http://www.qi4j.org/schemas/2008/dev-status/1" +<module xmlns="http://zest.apache.org/schemas/2008/dev-status/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.qi4j.org/schemas/2008/dev-status/1 - http://www.qi4j.org/schemas/2008/dev-status/1/dev-status.xsd"> + xsi:schemaLocation="http://zest.apache.org/schemas/2008/dev-status/1 + http://zest.apache.org/schemas/2008/dev-status/1/dev-status.xsd"> <status> <!--none,early,beta,stable,mature--> <codebase>stable</codebase> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/uid/src/test/java/org/apache/zest/library/uid/sequence/PersistingSequencingTest.java ---------------------------------------------------------------------- diff --git a/libraries/uid/src/test/java/org/apache/zest/library/uid/sequence/PersistingSequencingTest.java b/libraries/uid/src/test/java/org/apache/zest/library/uid/sequence/PersistingSequencingTest.java index cfa7d01..7cc48b4 100644 --- a/libraries/uid/src/test/java/org/apache/zest/library/uid/sequence/PersistingSequencingTest.java +++ b/libraries/uid/src/test/java/org/apache/zest/library/uid/sequence/PersistingSequencingTest.java @@ -24,12 +24,12 @@ import org.apache.zest.api.mixin.Mixins; import org.apache.zest.bootstrap.AssemblyException; import org.apache.zest.bootstrap.ModuleAssembly; import org.apache.zest.library.uid.sequence.assembly.PersistingSequencingAssembler; -import org.apache.zest.test.AbstractQi4jTest; +import org.apache.zest.test.AbstractZestTest; import org.apache.zest.test.EntityTestAssembler; import static org.junit.Assert.*; -public class PersistingSequencingTest extends AbstractQi4jTest +public class PersistingSequencingTest extends AbstractZestTest { @Override public void assemble( ModuleAssembly module ) throws AssemblyException http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/uid/src/test/java/org/apache/zest/library/uid/sequence/TransientSequencingTest.java ---------------------------------------------------------------------- diff --git a/libraries/uid/src/test/java/org/apache/zest/library/uid/sequence/TransientSequencingTest.java b/libraries/uid/src/test/java/org/apache/zest/library/uid/sequence/TransientSequencingTest.java index 2f63bda..fe47e0c 100644 --- a/libraries/uid/src/test/java/org/apache/zest/library/uid/sequence/TransientSequencingTest.java +++ b/libraries/uid/src/test/java/org/apache/zest/library/uid/sequence/TransientSequencingTest.java @@ -24,11 +24,11 @@ import org.apache.zest.api.mixin.Mixins; import org.apache.zest.bootstrap.AssemblyException; import org.apache.zest.bootstrap.ModuleAssembly; import org.apache.zest.library.uid.sequence.assembly.TransientSequencingAssembler; -import org.apache.zest.test.AbstractQi4jTest; +import org.apache.zest.test.AbstractZestTest; import static org.junit.Assert.assertEquals; -public class TransientSequencingTest extends AbstractQi4jTest +public class TransientSequencingTest extends AbstractZestTest { @Override public void assemble( ModuleAssembly module ) throws AssemblyException http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/uid/src/test/java/org/apache/zest/library/uid/uuid/UuidServiceTest.java ---------------------------------------------------------------------- diff --git a/libraries/uid/src/test/java/org/apache/zest/library/uid/uuid/UuidServiceTest.java b/libraries/uid/src/test/java/org/apache/zest/library/uid/uuid/UuidServiceTest.java index 9095dc9..b4389fe 100644 --- a/libraries/uid/src/test/java/org/apache/zest/library/uid/uuid/UuidServiceTest.java +++ b/libraries/uid/src/test/java/org/apache/zest/library/uid/uuid/UuidServiceTest.java @@ -24,12 +24,12 @@ import org.apache.zest.api.mixin.Mixins; import org.apache.zest.bootstrap.AssemblyException; import org.apache.zest.bootstrap.ModuleAssembly; import org.apache.zest.library.uid.uuid.assembly.UuidServiceAssembler; -import org.apache.zest.test.AbstractQi4jTest; +import org.apache.zest.test.AbstractZestTest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -public class UuidServiceTest extends AbstractQi4jTest +public class UuidServiceTest extends AbstractZestTest { public void assemble( ModuleAssembly module ) throws AssemblyException { http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/uowfile/build.gradle ---------------------------------------------------------------------- diff --git a/libraries/uowfile/build.gradle b/libraries/uowfile/build.gradle index e0f3116..16e3afc 100644 --- a/libraries/uowfile/build.gradle +++ b/libraries/uowfile/build.gradle @@ -22,11 +22,11 @@ description = "Apache Zest⢠UoWFile Library provides file operations binding t jar { manifest { name = "Apache Zest⢠Library - UoWFile" }} dependencies { - compile(project(":org.qi4j.core:org.qi4j.core.bootstrap")) - compile(project(":org.qi4j.libraries:org.qi4j.library.fileconfig")) + compile(project(":org.apache.zest.core:org.apache.zest.core.bootstrap")) + compile(project(":org.apache.zest.libraries:org.apache.zest.library.fileconfig")) - testCompile(project(":org.qi4j.core:org.qi4j.core.testsupport")) + testCompile(project(":org.apache.zest.core:org.apache.zest.core.testsupport")) - testRuntime(project(":org.qi4j.core:org.qi4j.core.runtime")) + testRuntime(project(":org.apache.zest.core:org.apache.zest.core.runtime")) testRuntime(libraries.logback) } http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/uowfile/dev-status.xml ---------------------------------------------------------------------- diff --git a/libraries/uowfile/dev-status.xml b/libraries/uowfile/dev-status.xml index 43df615..23e86f5 100644 --- a/libraries/uowfile/dev-status.xml +++ b/libraries/uowfile/dev-status.xml @@ -15,10 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. --> -<module xmlns="http://www.qi4j.org/schemas/2008/dev-status/1" +<module xmlns="http://zest.apache.org/schemas/2008/dev-status/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.qi4j.org/schemas/2008/dev-status/1 - http://www.qi4j.org/schemas/2008/dev-status/1/dev-status.xsd"> + xsi:schemaLocation="http://zest.apache.org/schemas/2008/dev-status/1 + http://zest.apache.org/schemas/2008/dev-status/1/dev-status.xsd"> <status> <!--none,early,beta,stable,mature--> <codebase>stable</codebase> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/internal/UoWFile.java ---------------------------------------------------------------------- diff --git a/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/internal/UoWFile.java b/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/internal/UoWFile.java index 7f31003..28a46a9 100644 --- a/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/internal/UoWFile.java +++ b/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/internal/UoWFile.java @@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory; public class UoWFile { - /* package */ static final Logger LOGGER = LoggerFactory.getLogger( "org.qi4j.library.uowfile" ); + /* package */ static final Logger LOGGER = LoggerFactory.getLogger( "org.apache.zest.library.uowfile" ); private static final int FILE_BUFFER_SIZE = 4096; private static final AtomicLong COUNT = new AtomicLong( 0L ); private final long originalIdentity; http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/internal/UoWFileFactory.java ---------------------------------------------------------------------- diff --git a/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/internal/UoWFileFactory.java b/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/internal/UoWFileFactory.java index 3726c9b..f17e83a 100644 --- a/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/internal/UoWFileFactory.java +++ b/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/internal/UoWFileFactory.java @@ -54,7 +54,7 @@ public interface UoWFileFactory { } - private static final Logger LOGGER = LoggerFactory.getLogger( "org.qi4j.library.uowfile" ); + private static final Logger LOGGER = LoggerFactory.getLogger( "org.apache.zest.library.uowfile" ); @Structure private Application app; @@ -78,7 +78,7 @@ public interface UoWFileFactory File tmp; if( fileConfig == null ) { - tmp = new File( "qi4j", app.name() + "-" + app.version() ); + tmp = new File( "zest", app.name() + "-" + app.version() ); } else { http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/libraries/uowfile/src/test/java/org/apache/zest/library/uowfile/AbstractUoWFileTest.java ---------------------------------------------------------------------- diff --git a/libraries/uowfile/src/test/java/org/apache/zest/library/uowfile/AbstractUoWFileTest.java b/libraries/uowfile/src/test/java/org/apache/zest/library/uowfile/AbstractUoWFileTest.java index cf23f41..42e676e 100644 --- a/libraries/uowfile/src/test/java/org/apache/zest/library/uowfile/AbstractUoWFileTest.java +++ b/libraries/uowfile/src/test/java/org/apache/zest/library/uowfile/AbstractUoWFileTest.java @@ -26,10 +26,10 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.apache.zest.io.Inputs; import org.apache.zest.io.Outputs; -import org.apache.zest.test.AbstractQi4jTest; +import org.apache.zest.test.AbstractZestTest; public abstract class AbstractUoWFileTest - extends AbstractQi4jTest + extends AbstractZestTest { protected static File baseTestDir; http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/manual/build.gradle ---------------------------------------------------------------------- diff --git a/manual/build.gradle b/manual/build.gradle index c754880..e4b9a2e 100644 --- a/manual/build.gradle +++ b/manual/build.gradle @@ -20,31 +20,31 @@ description = "Apache Zest⢠Manuals and Website." dependencies { - compile( project( ":org.qi4j.core:org.qi4j.core.bootstrap" ) ) - compile( project( ":org.qi4j.libraries:org.qi4j.library.constraints" ) ) - compile( project( ":org.qi4j.libraries:org.qi4j.library.logging" ) ) - runtime( project( ":org.qi4j.core:org.qi4j.core.runtime" ) ) + compile( project( ":org.apache.zest.core:org.apache.zest.core.bootstrap" ) ) + compile( project( ":org.apache.zest.libraries:org.apache.zest.library.constraints" ) ) + compile( project( ":org.apache.zest.libraries:org.apache.zest.library.logging" ) ) + runtime( project( ":org.apache.zest.core:org.apache.zest.core.runtime" ) ) runtime( libraries.slf4j_simple ) } -//task userguide( type: org.qi4j.gradle.plugin.documentation.Documentation ) { +//task userguide( type: org.apache.zest.gradle.plugin.documentation.Documentation ) { // docName = 'userguide' // docType = 'book' //} // -//task recipes( type: org.qi4j.gradle.plugin.documentation.Documentation ) { +//task recipes( type: org.apache.zest.gradle.plugin.documentation.Documentation ) { // docName = 'recipes' // docType = 'article' //} // -//task referenceManual( type: org.qi4j.gradle.plugin.documentation.Documentation ) { +//task referenceManual( type: org.apache.zest.gradle.plugin.documentation.Documentation ) { // docName = 'reference' // docType = 'book' //} -task website( type: org.qi4j.gradle.plugin.Documentation, +task website( type: org.apache.zest.gradle.plugin.Documentation, dependsOn: rootProject.allprojects.tasks.flatten().findAll { it.name == AsciidocBuildInfo.TASK_NAME } ) { docName 'website' docType 'article' http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/manual/src/docs/reference/index.txt ---------------------------------------------------------------------- diff --git a/manual/src/docs/reference/index.txt b/manual/src/docs/reference/index.txt index 0b2d397..a24938e 100644 --- a/manual/src/docs/reference/index.txt +++ b/manual/src/docs/reference/index.txt @@ -20,9 +20,9 @@ [[reference-documentation,Reference Manual]] = Apache Zest⢠v{revnumber} Reference Manual = -:qi4j-version: {revnumber} -:qi4j-buildnumber: {revnumber} -:qi4j-git-tag: {gitversion} +:zest-version: {revnumber} +:zest-buildnumber: {revnumber} +:zest-git-tag: {gitversion} :leveloffset: 2
