diff --git a/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableCacheServerConfigurer.java b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableCacheServerConfigurer.java new file mode 100644 index 00000000..ea48db5d --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableCacheServerConfigurer.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 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.springframework.data.gemfire.config.annotation; + +import org.springframework.beans.factory.BeanFactory; +import org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer; +import org.springframework.data.gemfire.server.CacheServerFactoryBean; +import org.springframework.lang.Nullable; + +/** + * Composition for {@link CacheServerConfigurer}. + * + * @author John Blum + * @see org.springframework.data.gemfire.config.annotation.CacheServerConfigurer + * @see org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer + * @see org.springframework.data.gemfire.server.CacheServerFactoryBean + * @since 2.2.0 + */ +public class LazyResolvingComposableCacheServerConfigurer + extends AbstractLazyResolvingComposableConfigurer + implements CacheServerConfigurer { + + public static LazyResolvingComposableCacheServerConfigurer create() { + return create(null); + } + + public static LazyResolvingComposableCacheServerConfigurer create(@Nullable BeanFactory beanFactory) { + return new LazyResolvingComposableCacheServerConfigurer().with(beanFactory); + } + + @Override + protected Class getConfigurerType() { + return CacheServerConfigurer.class; + } +} diff --git a/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableClientCacheConfigurer.java b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableClientCacheConfigurer.java new file mode 100644 index 00000000..52bffc19 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableClientCacheConfigurer.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 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.springframework.data.gemfire.config.annotation; + +import org.springframework.beans.factory.BeanFactory; +import org.springframework.data.gemfire.client.ClientCacheFactoryBean; +import org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer; +import org.springframework.lang.Nullable; + +/** + * Composition for {@link ClientCacheConfigurer}. + * + * @author John Blum + * @see org.springframework.data.gemfire.client.ClientCacheFactoryBean + * @see org.springframework.data.gemfire.config.annotation.ClientCacheConfigurer + * @see org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer + * @since 2.2.0 + */ +public class LazyResolvingComposableClientCacheConfigurer + extends AbstractLazyResolvingComposableConfigurer + implements ClientCacheConfigurer { + + public static LazyResolvingComposableClientCacheConfigurer create() { + return create(null); + } + + public static LazyResolvingComposableClientCacheConfigurer create(@Nullable BeanFactory beanFactory) { + return new LazyResolvingComposableClientCacheConfigurer().with(beanFactory); + } + + @Override + protected Class getConfigurerType() { + return ClientCacheConfigurer.class; + } +} diff --git a/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableDiskStoreConfigurer.java b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableDiskStoreConfigurer.java new file mode 100644 index 00000000..2167791a --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableDiskStoreConfigurer.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 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.springframework.data.gemfire.config.annotation; + +import org.springframework.beans.factory.BeanFactory; +import org.springframework.data.gemfire.DiskStoreFactoryBean; +import org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer; +import org.springframework.lang.Nullable; + +/** + * Composition of {@link DiskStoreConfigurer}. + * + * @author John Blum + * @see org.springframework.data.gemfire.DiskStoreFactoryBean + * @see org.springframework.data.gemfire.config.annotation.DiskStoreConfigurer + * @see org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer + * @since 2.2.0 + */ +public class LazyResolvingComposableDiskStoreConfigurer + extends AbstractLazyResolvingComposableConfigurer + implements DiskStoreConfigurer { + + public static LazyResolvingComposableDiskStoreConfigurer create() { + return create(null); + } + + public static LazyResolvingComposableDiskStoreConfigurer create(@Nullable BeanFactory beanFactory) { + return new LazyResolvingComposableDiskStoreConfigurer().with(beanFactory); + } + + @Override + protected Class getConfigurerType() { + return DiskStoreConfigurer.class; + } +} diff --git a/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableIndexConfigurer.java b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableIndexConfigurer.java new file mode 100644 index 00000000..0ae1d54b --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableIndexConfigurer.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 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.springframework.data.gemfire.config.annotation; + +import org.springframework.beans.factory.BeanFactory; +import org.springframework.data.gemfire.IndexFactoryBean; +import org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer; +import org.springframework.data.gemfire.search.lucene.LuceneIndexFactoryBean; +import org.springframework.lang.Nullable; + +/** + * Composition for {@link IndexConfigurer}. + * + * @author John Blum + * @see org.springframework.data.gemfire.IndexFactoryBean + * @see org.springframework.data.gemfire.config.annotation.IndexConfigurer + * @see org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer + * @see org.springframework.data.gemfire.search.lucene.LuceneIndexFactoryBean + * @since 2.2.0 + */ +public class LazyResolvingComposableIndexConfigurer + extends AbstractLazyResolvingComposableConfigurer + implements IndexConfigurer { + + public static LazyResolvingComposableIndexConfigurer create() { + return create(null); + } + + public static LazyResolvingComposableIndexConfigurer create(@Nullable BeanFactory beanFactory) { + return new LazyResolvingComposableIndexConfigurer().with(beanFactory); + } + + @Override + protected Class getConfigurerType() { + return IndexConfigurer.class; + } + + @Override + public void configure(String beanName, LuceneIndexFactoryBean luceneIndexFactoryBean) { + + resolveConfigurers().forEach(configurer -> + configurer.configure(beanName, luceneIndexFactoryBean)); + } +} diff --git a/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposablePeerCacheConfigurer.java b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposablePeerCacheConfigurer.java new file mode 100644 index 00000000..4a8bc428 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposablePeerCacheConfigurer.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 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.springframework.data.gemfire.config.annotation; + +import org.springframework.beans.factory.BeanFactory; +import org.springframework.data.gemfire.CacheFactoryBean; +import org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer; +import org.springframework.lang.Nullable; + +/** + * Composition of {@link PeerCacheConfigurer}. + * + * @author John Blum + * @see org.springframework.data.gemfire.CacheFactoryBean + * @see org.springframework.data.gemfire.config.annotation.PeerCacheConfigurer + * @see org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer + * @since 2.2.0 + */ +public class LazyResolvingComposablePeerCacheConfigurer + extends AbstractLazyResolvingComposableConfigurer + implements PeerCacheConfigurer { + + public static LazyResolvingComposablePeerCacheConfigurer create() { + return create(null); + } + + public static LazyResolvingComposablePeerCacheConfigurer create(@Nullable BeanFactory beanFactory) { + return new LazyResolvingComposablePeerCacheConfigurer().with(beanFactory); + } + + @Override + protected Class getConfigurerType() { + return PeerCacheConfigurer.class; + } +} diff --git a/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposablePoolConfigurer.java b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposablePoolConfigurer.java new file mode 100644 index 00000000..d82bfa58 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposablePoolConfigurer.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 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.springframework.data.gemfire.config.annotation; + +import org.springframework.beans.factory.BeanFactory; +import org.springframework.data.gemfire.client.PoolFactoryBean; +import org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer; +import org.springframework.lang.Nullable; + +/** + * Composition of {@link PoolConfigurer}. + * + * @author John Blum + * @see org.springframework.data.gemfire.client.PoolFactoryBean + * @see org.springframework.data.gemfire.config.annotation.PoolConfigurer + * @see org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer + * @since 2.2.0 + */ +public class LazyResolvingComposablePoolConfigurer + extends AbstractLazyResolvingComposableConfigurer + implements PoolConfigurer { + + public static LazyResolvingComposablePoolConfigurer create() { + return create(null); + } + + public static LazyResolvingComposablePoolConfigurer create(@Nullable BeanFactory beanFactory) { + return new LazyResolvingComposablePoolConfigurer().with(beanFactory); + } + + @Override + protected Class getConfigurerType() { + return PoolConfigurer.class; + } +} diff --git a/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableRegionConfigurer.java b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableRegionConfigurer.java new file mode 100644 index 00000000..c55532b8 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/annotation/LazyResolvingComposableRegionConfigurer.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 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.springframework.data.gemfire.config.annotation; + +import org.springframework.beans.factory.BeanFactory; +import org.springframework.data.gemfire.PeerRegionFactoryBean; +import org.springframework.data.gemfire.client.ClientRegionFactoryBean; +import org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer; +import org.springframework.lang.Nullable; + +/** + * Composition for {@link RegionConfigurer}. + * + * @author John Blum + * @see org.springframework.data.gemfire.PeerRegionFactoryBean + * @see org.springframework.data.gemfire.client.ClientRegionFactoryBean + * @see org.springframework.data.gemfire.config.annotation.RegionConfigurer + * @see org.springframework.data.gemfire.config.annotation.support.AbstractLazyResolvingComposableConfigurer + * @since 2.2.0 + */ +public class LazyResolvingComposableRegionConfigurer + extends AbstractLazyResolvingComposableConfigurer, RegionConfigurer> + implements RegionConfigurer { + + public static LazyResolvingComposableRegionConfigurer create() { + return create(null); + } + + public static LazyResolvingComposableRegionConfigurer create(@Nullable BeanFactory beanFactory) { + return new LazyResolvingComposableRegionConfigurer().with(beanFactory); + } + + @Override + protected Class getConfigurerType() { + return RegionConfigurer.class; + } + + @Override + public void configure(String beanName, PeerRegionFactoryBean peerRegionFactoryBean) { + + resolveConfigurers().forEach(configurer -> + configurer.configure(beanName, peerRegionFactoryBean)); + } +}