http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/sample-configuration/usersrepository.xml ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/sample-configuration/usersrepository.xml b/server/container/cassandra-guice/sample-configuration/usersrepository.xml deleted file mode 100644 index fc76107..0000000 --- a/server/container/cassandra-guice/sample-configuration/usersrepository.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0"?> -<!-- - 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. - --> - -<usersrepository name="LocalUsers" class="org.apache.james.user.jpa.JPAUsersRepository"> - <destination URL="file://users/"/> - <algorithm>MD5</algorithm> - <enableVirtualHosting>true</enableVirtualHosting> - <enableForwarding>true</enableForwarding> -</usersrepository> -
http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java b/server/container/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java deleted file mode 100644 index 45f054b..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ -package org.apache.james; - -import javax.annotation.PreDestroy; - -import org.apache.james.jmap.JMAPServer; -import org.apache.james.utils.ConfigurationsPerformer; -import org.apache.james.utils.ExtendedServerProbe; -import org.apache.james.utils.GuiceServerProbe; -import org.apache.onami.lifecycle.core.Stager; - -import com.google.inject.Guice; -import com.google.inject.Injector; -import com.google.inject.Key; -import com.google.inject.Module; -import com.google.inject.TypeLiteral; - -public class CassandraJamesServer { - - private final Module serverModule; - private Stager<PreDestroy> preDestroy; - private GuiceServerProbe serverProbe; - private int jmapPort; - - public CassandraJamesServer(Module serverModule) { - this.serverModule = serverModule; - } - - public void start() throws Exception { - Injector injector = Guice.createInjector(serverModule); - injector.getInstance(ConfigurationsPerformer.class).initModules(); - preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {})); - serverProbe = injector.getInstance(GuiceServerProbe.class); - jmapPort = injector.getInstance(JMAPServer.class).getPort(); - } - - public void stop() { - preDestroy.stage(); - } - - public ExtendedServerProbe serverProbe() { - return serverProbe; - } - - public int getJmapPort() { - return jmapPort; - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java b/server/container/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java deleted file mode 100644 index fb1b2e6..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ - -package org.apache.james; - -import org.apache.james.modules.CommonServicesModule; -import org.apache.james.modules.data.CassandraDomainListModule; -import org.apache.james.modules.data.CassandraRecipientRewriteTableModule; -import org.apache.james.modules.data.CassandraUsersRepositoryModule; -import org.apache.james.modules.mailbox.CassandraMailboxModule; -import org.apache.james.modules.mailbox.CassandraSessionModule; -import org.apache.james.modules.mailbox.ElasticSearchMailboxModule; -import org.apache.james.modules.protocols.IMAPServerModule; -import org.apache.james.modules.protocols.JMAPServerModule; -import org.apache.james.modules.protocols.LMTPServerModule; -import org.apache.james.modules.protocols.ManageSieveServerModule; -import org.apache.james.modules.protocols.POP3ServerModule; -import org.apache.james.modules.protocols.ProtocolHandlerModule; -import org.apache.james.modules.protocols.SMTPServerModule; -import org.apache.james.modules.server.ActiveMQQueueModule; -import org.apache.james.modules.server.CamelMailetContainerModule; -import org.apache.james.modules.server.ConfigurationProviderModule; -import org.apache.james.modules.server.DNSServiceModule; -import org.apache.james.modules.server.JMXServerModule; -import org.apache.james.modules.server.MailStoreRepositoryModule; -import org.apache.james.modules.server.QuotaModule; -import org.apache.james.modules.server.SieveModule; -import org.apache.onami.lifecycle.jsr250.PreDestroyModule; - -import com.google.inject.Module; -import com.google.inject.util.Modules; - -public class CassandraJamesServerMain { - - public static final Module defaultModule = Modules.combine( - new CommonServicesModule(), - new CassandraMailboxModule(), - new CassandraSessionModule(), - new ElasticSearchMailboxModule(), - new CassandraUsersRepositoryModule(), - new CassandraDomainListModule(), - new CassandraRecipientRewriteTableModule(), - new DNSServiceModule(), - new IMAPServerModule(), - new ProtocolHandlerModule(), - new POP3ServerModule(), - new SMTPServerModule(), - new LMTPServerModule(), - new ManageSieveServerModule(), - new ActiveMQQueueModule(), - new SieveModule(), - new MailStoreRepositoryModule(), - new CamelMailetContainerModule(), - new QuotaModule(), - new ConfigurationProviderModule(), - new JMAPServerModule(), - new PreDestroyModule()); - - public static void main(String[] args) throws Exception { - CassandraJamesServer server = new CassandraJamesServer(Modules.combine( - defaultModule, - new JMXServerModule())); - server.start(); - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/jmap/JMAPCommonModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/jmap/JMAPCommonModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/jmap/JMAPCommonModule.java deleted file mode 100644 index d2ad4b0..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/jmap/JMAPCommonModule.java +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ -package org.apache.james.jmap; - -import java.util.List; -import java.util.concurrent.TimeUnit; - -import org.apache.james.jmap.api.AccessTokenManager; -import org.apache.james.jmap.api.ContinuationTokenManager; -import org.apache.james.jmap.api.access.AccessTokenRepository; -import org.apache.james.jmap.crypto.AccessTokenManagerImpl; -import org.apache.james.jmap.crypto.JamesSignatureHandler; -import org.apache.james.jmap.crypto.SignatureHandler; -import org.apache.james.jmap.crypto.SignedContinuationTokenManager; -import org.apache.james.jmap.memory.access.MemoryAccessTokenRepository; -import org.apache.james.jmap.send.MailFactory; -import org.apache.james.jmap.send.MailSpool; -import org.apache.james.jmap.utils.DefaultZonedDateTimeProvider; -import org.apache.james.jmap.utils.ZonedDateTimeProvider; - -import com.google.common.collect.ImmutableList; -import com.google.inject.AbstractModule; -import com.google.inject.Provides; -import com.google.inject.Singleton; -import com.google.inject.name.Names; - -public class JMAPCommonModule extends AbstractModule { - - private static final long DEFAULT_TOKEN_EXPIRATION_IN_MS = TimeUnit.MILLISECONDS.convert(15, TimeUnit.MINUTES); - - @Override - protected void configure() { - bind(SignatureHandler.class).to(JamesSignatureHandler.class); - bind(ZonedDateTimeProvider.class).to(DefaultZonedDateTimeProvider.class); - bind(ContinuationTokenManager.class).to(SignedContinuationTokenManager.class); - - bindConstant().annotatedWith(Names.named(AccessTokenRepository.TOKEN_EXPIRATION_IN_MS)).to(DEFAULT_TOKEN_EXPIRATION_IN_MS); - bind(AccessTokenRepository.class).to(MemoryAccessTokenRepository.class); - bind(AccessTokenManager.class).to(AccessTokenManagerImpl.class); - - bind(MailSpool.class).in(Singleton.class); - bind(MailFactory.class).in(Singleton.class); - } - - @Provides - public List<AuthenticationStrategy> authStrategies( - AccessTokenAuthenticationStrategy accessTokenAuthenticationStrategy, - JWTAuthenticationStrategy jwtAuthenticationStrategy) { - - return ImmutableList.of( - jwtAuthenticationStrategy, - accessTokenAuthenticationStrategy); - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/jmap/JMAPModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/jmap/JMAPModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/jmap/JMAPModule.java deleted file mode 100644 index 4a61f45..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/jmap/JMAPModule.java +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ -package org.apache.james.jmap; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Optional; - -import org.apache.commons.configuration.ConfigurationException; -import org.apache.commons.configuration.HierarchicalConfiguration; -import org.apache.commons.configuration.PropertiesConfiguration; -import org.apache.commons.io.FileUtils; -import org.apache.james.filesystem.api.FileSystem; -import org.apache.james.jmap.methods.RequestHandler; -import org.apache.james.mailbox.MailboxManager; -import org.apache.james.utils.ConfigurationPerformer; -import org.apache.james.utils.ConfigurationProvider; - -import com.github.fge.lambdas.Throwing; -import com.google.common.base.Preconditions; -import com.google.inject.AbstractModule; -import com.google.inject.Inject; -import com.google.inject.Provides; -import com.google.inject.Singleton; -import com.google.inject.multibindings.Multibinder; - -public class JMAPModule extends AbstractModule { - private static final int DEFAULT_JMAP_PORT = 80; - - @Override - protected void configure() { - install(new JMAPCommonModule()); - install(new MethodsModule()); - bind(RequestHandler.class).in(Singleton.class); - Multibinder<ConfigurationPerformer> preconditions = Multibinder.newSetBinder(binder(), ConfigurationPerformer.class); - preconditions.addBinding().to(MailetConfigurationPrecondition.class); - preconditions.addBinding().to(MoveCapabilityPrecondition.class); - } - - @Provides - @Singleton - JMAPConfiguration provideConfiguration(FileSystem fileSystem) throws ConfigurationException, IOException{ - PropertiesConfiguration configuration = getConfiguration(fileSystem); - return JMAPConfiguration.builder() - .keystore(configuration.getString("tls.keystoreURL")) - .secret(configuration.getString("tls.secret")) - .jwtPublicKeyPem(loadPublicKey(fileSystem, Optional.ofNullable(configuration.getString("jwt.publickeypem.url")))) - .port(configuration.getInt("jmap.port", DEFAULT_JMAP_PORT)) - .build(); - } - - private PropertiesConfiguration getConfiguration(FileSystem fileSystem) throws FileNotFoundException, ConfigurationException { - return new PropertiesConfiguration(fileSystem.getFile(FileSystem.FILE_PROTOCOL_AND_CONF + "jmap.properties")); - } - - private Optional<String> loadPublicKey(FileSystem fileSystem, Optional<String> jwtPublickeyPemUrl) { - return jwtPublickeyPemUrl.map(Throwing.function(url -> FileUtils.readFileToString(fileSystem.getFile(url)))); - } - - @Singleton - public static class MailetConfigurationPrecondition implements ConfigurationPerformer { - - private final ConfigurationProvider configurationProvider; - - @Inject - public MailetConfigurationPrecondition(ConfigurationProvider configurationProvider) { - this.configurationProvider = configurationProvider; - } - - @Override - public void initModule() throws Exception { - Optional<HierarchicalConfiguration> removeMimeHeaderMailet = configurationProvider.getConfiguration("mailetcontainer") - .configurationAt("processors") - .configurationsAt("processor") - .stream() - .filter(processor -> processor.getString("[@state]").equals("transport")) - .flatMap(transport -> transport.configurationsAt("mailet").stream()) - .filter(mailet -> mailet.getString("[@class]").equals("RemoveMimeHeader")) - .filter(mailet -> mailet.getString("[@match]").equals("All")) - .filter(mailet -> mailet.getProperty("name").equals("bcc")) - .findAny(); - if (!removeMimeHeaderMailet.isPresent()) { - throw new ConfigurationException("Missing RemoveMimeHeader in mailets configuration (mailetcontainer -> processors -> transport). Should be configured to remove Bcc header"); - } - } - } - - @Singleton - public static class MoveCapabilityPrecondition implements ConfigurationPerformer { - - private final MailboxManager mailboxManager; - - @Inject - public MoveCapabilityPrecondition(MailboxManager mailboxManager) { - this.mailboxManager = mailboxManager; - } - - @Override - public void initModule() throws Exception { - Preconditions.checkArgument(mailboxManager.getSupportedCapabilities().contains(MailboxManager.Capabilities.Move), - "MOVE support in MailboxManager is required by JMAP Module"); - } - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/jmap/MethodsModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/jmap/MethodsModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/jmap/MethodsModule.java deleted file mode 100644 index b5d254a..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/jmap/MethodsModule.java +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ - -package org.apache.james.jmap; - -import org.apache.james.jmap.json.ObjectMapperFactory; -import org.apache.james.jmap.methods.GetMailboxesMethod; -import org.apache.james.jmap.methods.GetMessageListMethod; -import org.apache.james.jmap.methods.GetMessagesMethod; -import org.apache.james.jmap.methods.JmapRequestParser; -import org.apache.james.jmap.methods.JmapRequestParserImpl; -import org.apache.james.jmap.methods.JmapResponseWriter; -import org.apache.james.jmap.methods.JmapResponseWriterImpl; -import org.apache.james.jmap.methods.Method; -import org.apache.james.jmap.methods.SetMessagesCreationProcessor; -import org.apache.james.jmap.methods.SetMessagesDestructionProcessor; -import org.apache.james.jmap.methods.SetMessagesMethod; -import org.apache.james.jmap.methods.SetMessagesProcessor; -import org.apache.james.jmap.methods.SetMessagesUpdateProcessor; -import org.apache.james.mailbox.cassandra.CassandraId; - -import com.google.inject.AbstractModule; -import com.google.inject.Singleton; -import com.google.inject.TypeLiteral; -import com.google.inject.multibindings.Multibinder; -import com.google.inject.name.Names; - -public class MethodsModule extends AbstractModule { - - @Override - protected void configure() { - bind(JmapRequestParser.class).to(JmapRequestParserImpl.class).in(Singleton.class); - bind(JmapResponseWriter.class).to(JmapResponseWriterImpl.class).in(Singleton.class); - bind(ObjectMapperFactory.class).in(Singleton.class); - - bindConstant().annotatedWith(Names.named(GetMessageListMethod.MAXIMUM_LIMIT)).to(GetMessageListMethod.DEFAULT_MAXIMUM_LIMIT); - - Multibinder<Method> methods = Multibinder.newSetBinder(binder(), Method.class); - methods.addBinding().to(new TypeLiteral<GetMailboxesMethod<CassandraId>>(){}); - methods.addBinding().to(new TypeLiteral<GetMessageListMethod<CassandraId>>(){}); - methods.addBinding().to(new TypeLiteral<GetMessagesMethod<CassandraId>>(){}); - methods.addBinding().to(new TypeLiteral<SetMessagesMethod<CassandraId>>(){}); - - Multibinder<SetMessagesProcessor<CassandraId>> setMessagesProcessors = Multibinder.newSetBinder(binder(), new TypeLiteral<SetMessagesProcessor<CassandraId>>(){}); - setMessagesProcessors.addBinding().to(new TypeLiteral<SetMessagesUpdateProcessor<CassandraId>>(){}); - setMessagesProcessors.addBinding().to(new TypeLiteral<SetMessagesCreationProcessor<CassandraId>>(){}); - setMessagesProcessors.addBinding().to(new TypeLiteral<SetMessagesDestructionProcessor<CassandraId>>(){}); - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/CommonServicesModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/CommonServicesModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/CommonServicesModule.java deleted file mode 100644 index 3802c56..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/CommonServicesModule.java +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ - -package org.apache.james.modules; - -import java.util.Optional; - -import javax.inject.Named; -import javax.inject.Singleton; - -import org.apache.commons.cli.MissingArgumentException; -import org.apache.james.core.JamesServerResourceLoader; -import org.apache.james.core.filesystem.FileSystemImpl; -import org.apache.james.filesystem.api.FileSystem; -import org.apache.james.filesystem.api.JamesDirectoriesProvider; -import org.apache.james.utils.ConfigurationProvider; -import org.apache.james.utils.FileConfigurationProvider; -import org.apache.james.utils.GuiceServerProbe; - -import com.google.inject.AbstractModule; -import com.google.inject.Provides; - -public class CommonServicesModule extends AbstractModule { - - public static final String CONFIGURATION_PATH = "configurationPath"; - - @Override - protected void configure() { - bind(FileSystem.class).to(FileSystemImpl.class); - bind(ConfigurationProvider.class).to(FileConfigurationProvider.class); - bind(GuiceServerProbe.class).in(Singleton.class); - } - - @Provides @Singleton @Named(CONFIGURATION_PATH) - public String configurationPath() { - return FileSystem.FILE_PROTOCOL_AND_CONF; - } - - @Provides @Singleton - public JamesDirectoriesProvider directories() throws MissingArgumentException { - String rootDirectory = Optional - .ofNullable(System.getProperty("working.directory")) - .orElseThrow(() -> new MissingArgumentException("Server needs a working.directory env entry")); - return new JamesServerResourceLoader(rootDirectory); - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraDomainListModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraDomainListModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraDomainListModule.java deleted file mode 100644 index 4f815f2..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraDomainListModule.java +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ -package org.apache.james.modules.data; - -import org.apache.james.backends.cassandra.components.CassandraModule; -import org.apache.james.domainlist.api.DomainList; -import org.apache.james.domainlist.cassandra.CassandraDomainList; -import org.apache.james.utils.ConfigurationPerformer; -import org.apache.james.utils.ConfigurationProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.inject.AbstractModule; -import com.google.inject.Inject; -import com.google.inject.Scopes; -import com.google.inject.Singleton; -import com.google.inject.multibindings.Multibinder; - -public class CassandraDomainListModule extends AbstractModule { - - private static final Logger LOGGER = LoggerFactory.getLogger(DomainList.class); - - @Override - public void configure() { - bind(CassandraDomainList.class).in(Scopes.SINGLETON); - bind(DomainList.class).to(CassandraDomainList.class); - Multibinder.newSetBinder(binder(), CassandraModule.class).addBinding().to(org.apache.james.domainlist.cassandra.CassandraDomainListModule.class); - Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(CassandraDomainListConfigurationPerformer.class); - } - - @Singleton - public static class CassandraDomainListConfigurationPerformer implements ConfigurationPerformer { - - private final ConfigurationProvider configurationProvider; - private final CassandraDomainList cassandraDomainList; - - @Inject - public CassandraDomainListConfigurationPerformer(ConfigurationProvider configurationProvider, CassandraDomainList cassandraDomainList) { - this.configurationProvider = configurationProvider; - this.cassandraDomainList = cassandraDomainList; - } - - @Override - public void initModule() throws Exception { - cassandraDomainList.setLog(LOGGER); - cassandraDomainList.configure(configurationProvider.getConfiguration("domainlist")); - } - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraRecipientRewriteTableModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraRecipientRewriteTableModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraRecipientRewriteTableModule.java deleted file mode 100644 index d261a7d..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraRecipientRewriteTableModule.java +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ -package org.apache.james.modules.data; - -import org.apache.james.backends.cassandra.components.CassandraModule; -import org.apache.james.rrt.api.RecipientRewriteTable; -import org.apache.james.rrt.cassandra.CassandraRRTModule; -import org.apache.james.rrt.cassandra.CassandraRecipientRewriteTable; -import org.apache.james.utils.ConfigurationPerformer; -import org.apache.james.utils.ConfigurationProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.inject.AbstractModule; -import com.google.inject.Inject; -import com.google.inject.Scopes; -import com.google.inject.Singleton; -import com.google.inject.multibindings.Multibinder; - -public class CassandraRecipientRewriteTableModule extends AbstractModule { - - private static final Logger LOGGER = LoggerFactory.getLogger(RecipientRewriteTable.class); - - @Override - public void configure() { - bind(CassandraRecipientRewriteTable.class).in(Scopes.SINGLETON); - bind(RecipientRewriteTable.class).to(CassandraRecipientRewriteTable.class); - Multibinder<CassandraModule> cassandraDataDefinitions = Multibinder.newSetBinder(binder(), CassandraModule.class); - cassandraDataDefinitions.addBinding().to(CassandraRRTModule.class); - Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(CassandraRecipientRewriteTablePerformer.class); - } - - @Singleton - public static class CassandraRecipientRewriteTablePerformer implements ConfigurationPerformer { - - private final ConfigurationProvider configurationProvider; - private final CassandraRecipientRewriteTable recipientRewriteTable; - - @Inject - public CassandraRecipientRewriteTablePerformer(ConfigurationProvider configurationProvider, CassandraRecipientRewriteTable recipientRewriteTable) { - this.configurationProvider = configurationProvider; - this.recipientRewriteTable = recipientRewriteTable; - } - - @Override - public void initModule() throws Exception { - recipientRewriteTable.setLog(LOGGER); - recipientRewriteTable.configure(configurationProvider.getConfiguration("recipientrewritetable")); - } - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraUsersRepositoryModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraUsersRepositoryModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraUsersRepositoryModule.java deleted file mode 100644 index a776626..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraUsersRepositoryModule.java +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ -package org.apache.james.modules.data; - -import org.apache.james.backends.cassandra.components.CassandraModule; -import org.apache.james.user.api.UsersRepository; -import org.apache.james.user.cassandra.CassandraUsersRepository; - -import com.google.inject.AbstractModule; -import com.google.inject.multibindings.Multibinder; - -public class CassandraUsersRepositoryModule extends AbstractModule { - - @Override - public void configure() { - bind(UsersRepository.class).to(CassandraUsersRepository.class); - Multibinder<CassandraModule> cassandraDataDefinitions = Multibinder.newSetBinder(binder(), CassandraModule.class); - cassandraDataDefinitions.addBinding().to(org.apache.james.user.cassandra.CassandraUsersRepositoryModule.class); - - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java deleted file mode 100644 index 756ac62..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ -package org.apache.james.modules.mailbox; - -import javax.inject.Singleton; - -import org.apache.james.adapter.mailbox.store.UserRepositoryAuthenticator; -import org.apache.james.backends.cassandra.components.CassandraModule; -import org.apache.james.mailbox.MailboxManager; -import org.apache.james.mailbox.MailboxPathLocker; -import org.apache.james.mailbox.SubscriptionManager; -import org.apache.james.mailbox.cassandra.CassandraId; -import org.apache.james.mailbox.cassandra.CassandraMailboxManager; -import org.apache.james.mailbox.cassandra.CassandraMailboxSessionMapperFactory; -import org.apache.james.mailbox.cassandra.CassandraSubscriptionManager; -import org.apache.james.mailbox.cassandra.mail.CassandraModSeqProvider; -import org.apache.james.mailbox.cassandra.mail.CassandraUidProvider; -import org.apache.james.mailbox.exception.MailboxException; -import org.apache.james.mailbox.store.Authenticator; -import org.apache.james.mailbox.store.MailboxSessionMapperFactory; -import org.apache.james.mailbox.store.NoMailboxPathLocker; -import org.apache.james.mailbox.store.mail.MailboxMapperFactory; -import org.apache.james.mailbox.store.mail.MessageMapperFactory; -import org.apache.james.mailbox.store.mail.ModSeqProvider; -import org.apache.james.mailbox.store.mail.UidProvider; -import org.apache.james.mailbox.store.mail.model.MailboxId; - -import com.google.inject.AbstractModule; -import com.google.inject.Provides; -import com.google.inject.TypeLiteral; -import com.google.inject.multibindings.Multibinder; -import com.google.inject.name.Named; - -public class CassandraMailboxModule extends AbstractModule { - - public static final String MAILBOXMANAGER_NAME = "mailboxmanager"; - - @Override - protected void configure() { - bind(new TypeLiteral<MessageMapperFactory<CassandraId>>(){}).to(CassandraMailboxSessionMapperFactory.class); - bind(new TypeLiteral<MailboxMapperFactory<CassandraId>>(){}).to(CassandraMailboxSessionMapperFactory.class); - bind(new TypeLiteral<MailboxSessionMapperFactory<CassandraId>>(){}).to(CassandraMailboxSessionMapperFactory.class); - bind(new TypeLiteral<MailboxSessionMapperFactory<? extends MailboxId>>(){}).to(CassandraMailboxSessionMapperFactory.class); - bind(new TypeLiteral<ModSeqProvider<CassandraId>>(){}).to(new TypeLiteral<CassandraModSeqProvider>(){}); - bind(new TypeLiteral<UidProvider<CassandraId>>(){}).to(new TypeLiteral<CassandraUidProvider>(){}); - - bind(SubscriptionManager.class).to(CassandraSubscriptionManager.class); - bind(MailboxSessionMapperFactory.class).to(CassandraMailboxSessionMapperFactory.class); - bind(MailboxPathLocker.class).to(NoMailboxPathLocker.class); - bind(Authenticator.class).to(UserRepositoryAuthenticator.class); - bind(MailboxManager.class).to(CassandraMailboxManager.class); - - Multibinder<CassandraModule> cassandraDataDefinitions = Multibinder.newSetBinder(binder(), CassandraModule.class); - cassandraDataDefinitions.addBinding().to(org.apache.james.mailbox.cassandra.modules.CassandraAclModule.class); - cassandraDataDefinitions.addBinding().to(org.apache.james.mailbox.cassandra.modules.CassandraMailboxCounterModule.class); - cassandraDataDefinitions.addBinding().to(org.apache.james.mailbox.cassandra.modules.CassandraMailboxModule.class); - cassandraDataDefinitions.addBinding().to(org.apache.james.mailbox.cassandra.modules.CassandraMessageModule.class); - cassandraDataDefinitions.addBinding().to(org.apache.james.mailbox.cassandra.modules.CassandraSubscriptionModule.class); - cassandraDataDefinitions.addBinding().to(org.apache.james.mailbox.cassandra.modules.CassandraUidAndModSeqModule.class); - } - - @Provides @Named(MAILBOXMANAGER_NAME) @Singleton - public MailboxManager provideMailboxManager(CassandraMailboxManager cassandraMailboxManager) throws MailboxException { - cassandraMailboxManager.init(); - return cassandraMailboxManager; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraSessionModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraSessionModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraSessionModule.java deleted file mode 100644 index f40cf41..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraSessionModule.java +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ -package org.apache.james.modules.mailbox; - -import java.io.FileNotFoundException; -import java.util.Set; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ScheduledExecutorService; - -import org.apache.commons.configuration.ConfigurationException; -import org.apache.commons.configuration.PropertiesConfiguration; -import org.apache.james.backends.cassandra.components.CassandraModule; -import org.apache.james.backends.cassandra.init.CassandraModuleComposite; -import org.apache.james.backends.cassandra.init.ClusterFactory; -import org.apache.james.backends.cassandra.init.ClusterWithKeyspaceCreatedFactory; -import org.apache.james.backends.cassandra.init.SessionWithInitializedTablesFactory; -import org.apache.james.filesystem.api.FileSystem; - -import com.datastax.driver.core.Cluster; -import com.datastax.driver.core.Session; -import com.datastax.driver.core.exceptions.NoHostAvailableException; -import com.google.inject.AbstractModule; -import com.google.inject.Provides; -import com.google.inject.Singleton; -import com.nurkiewicz.asyncretry.AsyncRetryExecutor; - -public class CassandraSessionModule extends AbstractModule { - - private static final int DEFAULT_CONNECTION_MAX_RETRIES = 10; - private static final int DEFAULT_CONNECTION_MIN_DELAY = 5000; - - @Override - protected void configure() { - bind(ScheduledExecutorService.class).toProvider(ScheduledExecutorServiceProvider.class); - } - - @Provides - @Singleton - CassandraModule composeDataDefinitions(Set<CassandraModule> modules) { - return new CassandraModuleComposite(modules.toArray(new CassandraModule[0])); - } - - @Provides - @Singleton - Session provideSession(FileSystem fileSystem, Cluster cluster, CassandraModule cassandraModule) - throws FileNotFoundException, ConfigurationException{ - PropertiesConfiguration configuration = getConfiguration(fileSystem); - String keyspace = configuration.getString("cassandra.keyspace"); - return new SessionWithInitializedTablesFactory(cassandraModule).createSession(cluster, keyspace); - } - - @Provides - @Singleton - Cluster provideCluster(FileSystem fileSystem, AsyncRetryExecutor executor) throws FileNotFoundException, ConfigurationException, ExecutionException, InterruptedException { - PropertiesConfiguration configuration = getConfiguration(fileSystem); - - return getRetryer(executor, configuration) - .getWithRetry(ctx -> ClusterWithKeyspaceCreatedFactory.clusterWithInitializedKeyspace( - ClusterFactory.createClusterForSingleServerWithoutPassWord( - configuration.getString("cassandra.ip"), - configuration.getInt("cassandra.port")), - configuration.getString("cassandra.keyspace"), - configuration.getInt("cassandra.replication.factor"))) - .get(); - } - - private static AsyncRetryExecutor getRetryer(AsyncRetryExecutor executor, PropertiesConfiguration configuration) { - return executor.retryOn(NoHostAvailableException.class) - .withProportionalJitter() - .withMaxRetries(configuration.getInt("cassandra.retryConnection.maxRetries", DEFAULT_CONNECTION_MAX_RETRIES)) - .withMinDelay(configuration.getInt("cassandra.retryConnection.minDelay", DEFAULT_CONNECTION_MIN_DELAY)); - } - - @Provides - private AsyncRetryExecutor provideAsyncRetryExecutor(ScheduledExecutorService scheduler) { - return new AsyncRetryExecutor(scheduler); - } - - private PropertiesConfiguration getConfiguration(FileSystem fileSystem) throws FileNotFoundException, ConfigurationException { - return new PropertiesConfiguration(fileSystem.getFile(FileSystem.FILE_PROTOCOL_AND_CONF + "cassandra.properties")); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java deleted file mode 100644 index 7fc7638..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ - -package org.apache.james.modules.mailbox; - -import java.io.FileNotFoundException; -import java.util.concurrent.ExecutionException; - -import javax.inject.Singleton; - -import org.apache.commons.configuration.ConfigurationException; -import org.apache.commons.configuration.PropertiesConfiguration; -import org.apache.james.filesystem.api.FileSystem; -import org.apache.james.mailbox.cassandra.CassandraId; -import org.apache.james.mailbox.elasticsearch.ClientProvider; -import org.apache.james.mailbox.elasticsearch.ClientProviderImpl; -import org.apache.james.mailbox.elasticsearch.IndexCreationFactory; -import org.apache.james.mailbox.elasticsearch.NodeMappingFactory; -import org.apache.james.mailbox.elasticsearch.events.ElasticSearchListeningMessageSearchIndex; -import org.apache.james.mailbox.store.extractor.TextExtractor; -import org.apache.james.mailbox.store.search.MessageSearchIndex; -import org.apache.james.mailbox.tika.extractor.TikaTextExtractor; -import org.elasticsearch.client.transport.NoNodeAvailableException; - -import com.google.inject.AbstractModule; -import com.google.inject.Provides; -import com.google.inject.TypeLiteral; -import com.nurkiewicz.asyncretry.AsyncRetryExecutor; - -public class ElasticSearchMailboxModule extends AbstractModule { - - private static final int DEFAULT_CONNECTION_MAX_RETRIES = 7; - private static final int DEFAULT_CONNECTION_MIN_DELAY = 3000; - - @Override - protected void configure() { - bind(new TypeLiteral<MessageSearchIndex<CassandraId>>(){}).to(new TypeLiteral<ElasticSearchListeningMessageSearchIndex<CassandraId>>() {}); - bind(TextExtractor.class).to(TikaTextExtractor.class); - } - - @Provides - @Singleton - protected ClientProvider provideClientProvider(FileSystem fileSystem, AsyncRetryExecutor executor) throws ConfigurationException, FileNotFoundException, ExecutionException, InterruptedException { - PropertiesConfiguration propertiesReader = new PropertiesConfiguration(fileSystem.getFile(FileSystem.FILE_PROTOCOL_AND_CONF + "elasticsearch.properties")); - - ClientProvider clientProvider = new ClientProviderImpl(propertiesReader.getString("elasticsearch.masterHost"), - propertiesReader.getInt("elasticsearch.port")); - getRetryer(executor, propertiesReader) - .getWithRetry(ctx -> IndexCreationFactory.createIndex(clientProvider, - propertiesReader.getInt("elasticsearch.nb.shards"), - propertiesReader.getInt("elasticsearch.nb.replica"))) - .get(); - NodeMappingFactory.applyMapping(clientProvider); - return clientProvider; - } - - private static AsyncRetryExecutor getRetryer(AsyncRetryExecutor executor, PropertiesConfiguration configuration) { - return executor - .withProportionalJitter() - .retryOn(NoNodeAvailableException.class) - .withMaxRetries(configuration.getInt("elasticsearch.retryConnection.maxRetries", DEFAULT_CONNECTION_MAX_RETRIES)) - .withMinDelay(configuration.getInt("elasticsearch.retryConnection.minDelay", DEFAULT_CONNECTION_MIN_DELAY)); - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ScheduledExecutorServiceProvider.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ScheduledExecutorServiceProvider.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ScheduledExecutorServiceProvider.java deleted file mode 100644 index 48fe3f1..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ScheduledExecutorServiceProvider.java +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ - -package org.apache.james.modules.mailbox; - -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; - -import javax.annotation.PreDestroy; - -import com.google.common.annotations.VisibleForTesting; -import com.google.inject.Provider; - -@VisibleForTesting -class ScheduledExecutorServiceProvider implements Provider<ScheduledExecutorService> { - - private final ScheduledExecutorService scheduler; - - @VisibleForTesting - ScheduledExecutorServiceProvider() { - scheduler = Executors.newSingleThreadScheduledExecutor(); - } - - @Override - public ScheduledExecutorService get() { - return scheduler; - } - - @PreDestroy - private void stop() { - scheduler.shutdown(); - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/IMAPServerModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/IMAPServerModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/IMAPServerModule.java deleted file mode 100644 index 1b9b8ac..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/IMAPServerModule.java +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ -package org.apache.james.modules.protocols; - -import org.apache.james.imap.api.process.ImapProcessor; -import org.apache.james.imap.decode.ImapDecoder; -import org.apache.james.imap.encode.ImapEncoder; -import org.apache.james.imap.encode.main.DefaultImapEncoderFactory; -import org.apache.james.imap.main.DefaultImapDecoderFactory; -import org.apache.james.imap.processor.main.DefaultImapProcessorFactory; -import org.apache.james.imapserver.netty.IMAPServerFactory; -import org.apache.james.mailbox.MailboxManager; -import org.apache.james.mailbox.SubscriptionManager; -import org.apache.james.mailbox.quota.QuotaManager; -import org.apache.james.mailbox.quota.QuotaRootResolver; -import org.apache.james.modules.mailbox.CassandraMailboxModule; -import org.apache.james.utils.ConfigurationPerformer; -import org.apache.james.utils.ConfigurationProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.collect.ImmutableSet; -import com.google.inject.AbstractModule; -import com.google.inject.Inject; -import com.google.inject.Provides; -import com.google.inject.Singleton; -import com.google.inject.multibindings.Multibinder; -import com.google.inject.name.Named; - -public class IMAPServerModule extends AbstractModule { - - private static final Logger LOGGER = LoggerFactory.getLogger(IMAPServerModule.class); - - @Override - protected void configure() { - Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(IMAPModuleConfigurationPerformer.class); - } - - @Provides - @Singleton - ImapProcessor provideImapProcessor( - @Named(CassandraMailboxModule.MAILBOXMANAGER_NAME)MailboxManager mailboxManager, - SubscriptionManager subscriptionManager, - QuotaManager quotaManager, - QuotaRootResolver quotaRootResolver) { - return DefaultImapProcessorFactory.createXListSupportingProcessor( - mailboxManager, - subscriptionManager, - null, - quotaManager, - quotaRootResolver, - 120, - ImmutableSet.of("ACL", "MOVE")); - } - - @Provides - @Singleton - ImapDecoder provideImapDecoder() { - return DefaultImapDecoderFactory.createDecoder(); - } - - @Provides - @Singleton - ImapEncoder provideImapEncoder() { - return new DefaultImapEncoderFactory().buildImapEncoder(); - } - - @Singleton - public static class IMAPModuleConfigurationPerformer implements ConfigurationPerformer { - - private final ConfigurationProvider configurationProvider; - private final IMAPServerFactory imapServerFactory; - - @Inject - public IMAPModuleConfigurationPerformer(ConfigurationProvider configurationProvider, IMAPServerFactory imapServerFactory) { - this.configurationProvider = configurationProvider; - this.imapServerFactory = imapServerFactory; - } - - @Override - public void initModule() throws Exception { - imapServerFactory.setLog(LOGGER); - imapServerFactory.configure(configurationProvider.getConfiguration("imapserver")); - imapServerFactory.init(); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java deleted file mode 100644 index 69740b1..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ - -package org.apache.james.modules.protocols; - -import org.apache.james.jmap.JMAPModule; -import org.apache.james.jmap.JMAPServer; -import org.apache.james.jmap.crypto.JamesSignatureHandler; -import org.apache.james.utils.ConfigurationPerformer; - -import com.google.inject.AbstractModule; -import com.google.inject.Inject; -import com.google.inject.Singleton; -import com.google.inject.multibindings.Multibinder; -import org.bouncycastle.jce.provider.BouncyCastleProvider; - -import java.security.Security; - -public class JMAPServerModule extends AbstractModule { - - @Override - protected void configure() { - install(new JMAPModule()); - Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(JMAPModuleConfigurationPerformer.class); - } - - @Singleton - public static class JMAPModuleConfigurationPerformer implements ConfigurationPerformer { - - private final JMAPServer server; - private final JamesSignatureHandler signatureHandler; - - @Inject - public JMAPModuleConfigurationPerformer(JMAPServer server, JamesSignatureHandler signatureHandler) { - this.server = server; - this.signatureHandler = signatureHandler; - } - - @Override - public void initModule() throws Exception { - signatureHandler.init(); - server.configure(null); - registerPEMWithSecurityProvider(); - } - - private void registerPEMWithSecurityProvider() { - Security.addProvider(new BouncyCastleProvider()); - } - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/LMTPServerModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/LMTPServerModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/LMTPServerModule.java deleted file mode 100644 index a7b7c83..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/LMTPServerModule.java +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ - -package org.apache.james.modules.protocols; - -import org.apache.james.lmtpserver.netty.LMTPServerFactory; -import org.apache.james.utils.ConfigurationPerformer; -import org.apache.james.utils.ConfigurationProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.inject.AbstractModule; -import com.google.inject.Inject; -import com.google.inject.Singleton; -import com.google.inject.multibindings.Multibinder; - -public class LMTPServerModule extends AbstractModule { - - private static final Logger LOGGER = LoggerFactory.getLogger(LMTPServerModule.class); - - @Override - protected void configure() { - Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(LMTPModuleConfigurationPerformer.class); - } - - @Singleton - public static class LMTPModuleConfigurationPerformer implements ConfigurationPerformer { - - private final ConfigurationProvider configurationProvider; - private final LMTPServerFactory lmtpServerFactory; - - @Inject - public LMTPModuleConfigurationPerformer(ConfigurationProvider configurationProvider, LMTPServerFactory lmtpServerFactory) { - this.configurationProvider = configurationProvider; - this.lmtpServerFactory = lmtpServerFactory; - } - - @Override - public void initModule() throws Exception { - lmtpServerFactory.setLog(LOGGER); - lmtpServerFactory.configure(configurationProvider.getConfiguration("lmtpserver")); - lmtpServerFactory.init(); - } - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/ManageSieveServerModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/ManageSieveServerModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/ManageSieveServerModule.java deleted file mode 100644 index cb2429e..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/ManageSieveServerModule.java +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ -package org.apache.james.modules.protocols; - -import com.google.inject.AbstractModule; -import com.google.inject.Inject; -import com.google.inject.Singleton; -import com.google.inject.multibindings.Multibinder; -import org.apache.james.managesieve.api.commands.CoreCommands; -import org.apache.james.managesieve.core.CoreProcessor; -import org.apache.james.managesieveserver.netty.ManageSieveServerFactory; -import org.apache.james.utils.ConfigurationPerformer; -import org.apache.james.utils.ConfigurationProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ManageSieveServerModule extends AbstractModule { - - private static final Logger LOGGER = LoggerFactory.getLogger(ManageSieveServerModule.class); - - @Override - protected void configure() { - bind(CoreCommands.class).to(CoreProcessor.class); - Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(ManageSieveModuleConfigurationPerformer.class); - } - - @Singleton - public static class ManageSieveModuleConfigurationPerformer implements ConfigurationPerformer { - - private final ConfigurationProvider configurationProvider; - private final ManageSieveServerFactory manageSieveServerFactory; - - @Inject - public ManageSieveModuleConfigurationPerformer(ConfigurationProvider configurationProvider, ManageSieveServerFactory manageSieveServerFactory) { - this.configurationProvider = configurationProvider; - this.manageSieveServerFactory = manageSieveServerFactory; - } - - @Override - public void initModule() throws Exception { - manageSieveServerFactory.setLog(LOGGER); - manageSieveServerFactory.configure(configurationProvider.getConfiguration("managesieveserver")); - manageSieveServerFactory.init(); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/POP3ServerModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/POP3ServerModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/POP3ServerModule.java deleted file mode 100644 index 2bbe6a8..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/POP3ServerModule.java +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ - -package org.apache.james.modules.protocols; - -import org.apache.james.pop3server.netty.POP3ServerFactory; -import org.apache.james.utils.ConfigurationPerformer; -import org.apache.james.utils.ConfigurationProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.inject.AbstractModule; -import com.google.inject.Inject; -import com.google.inject.Singleton; -import com.google.inject.multibindings.Multibinder; - -public class POP3ServerModule extends AbstractModule { - - private static final Logger LOGGER = LoggerFactory.getLogger(POP3ServerModule.class); - - @Override - protected void configure() { - Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(POP3ModuleConfigurationPerformer.class); - } - - @Singleton - public static class POP3ModuleConfigurationPerformer implements ConfigurationPerformer { - - private final ConfigurationProvider configurationProvider; - private final POP3ServerFactory pop3ServerFactory; - - @Inject - public POP3ModuleConfigurationPerformer(ConfigurationProvider configurationProvider, POP3ServerFactory pop3ServerFactory) { - this.configurationProvider = configurationProvider; - this.pop3ServerFactory = pop3ServerFactory; - } - - @Override - public void initModule() throws Exception { - pop3ServerFactory.setLog(LOGGER); - pop3ServerFactory.configure(configurationProvider.getConfiguration("pop3server")); - pop3ServerFactory.init(); - } - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/ProtocolHandlerModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/ProtocolHandlerModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/ProtocolHandlerModule.java deleted file mode 100644 index 10d20d2..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/ProtocolHandlerModule.java +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ - -package org.apache.james.modules.protocols; - -import org.apache.james.protocols.lib.handler.ProtocolHandlerLoader; -import org.apache.james.utils.GuiceProtocolHandlerLoader; - -import com.google.inject.AbstractModule; - -public class ProtocolHandlerModule extends AbstractModule { - - @Override - protected void configure() { - bind(ProtocolHandlerLoader.class).to(GuiceProtocolHandlerLoader.class); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/SMTPServerModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/SMTPServerModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/SMTPServerModule.java deleted file mode 100644 index 6275822..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/SMTPServerModule.java +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ - -package org.apache.james.modules.protocols; - -import org.apache.james.smtpserver.SendMailHandler; -import org.apache.james.smtpserver.netty.SMTPServerFactory; -import org.apache.james.utils.ConfigurationPerformer; -import org.apache.james.utils.ConfigurationProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.inject.AbstractModule; -import com.google.inject.Inject; -import com.google.inject.Singleton; -import com.google.inject.multibindings.Multibinder; - -public class SMTPServerModule extends AbstractModule { - - private static final Logger LOGGER = LoggerFactory.getLogger(SMTPServerModule.class); - - @Override - protected void configure() { - Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(SMTPModuleConfigurationPerformer.class); - } - - @Singleton - public static class SMTPModuleConfigurationPerformer implements ConfigurationPerformer { - - private final ConfigurationProvider configurationProvider; - private final SMTPServerFactory smtpServerFactory; - private final SendMailHandler sendMailHandler; - - @Inject - public SMTPModuleConfigurationPerformer(ConfigurationProvider configurationProvider, - SMTPServerFactory smtpServerFactory, - SendMailHandler sendMailHandler) { - this.configurationProvider = configurationProvider; - this.smtpServerFactory = smtpServerFactory; - this.sendMailHandler = sendMailHandler; - } - - @Override - public void initModule() throws Exception { - smtpServerFactory.setLog(LOGGER); - smtpServerFactory.configure(configurationProvider.getConfiguration("smtpserver")); - smtpServerFactory.init(); - sendMailHandler.init(null); - } - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/517a4cfe/server/container/cassandra-guice/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java ---------------------------------------------------------------------- diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java deleted file mode 100644 index e7602bb..0000000 --- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************** - * 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. * - ****************************************************************/ - -package org.apache.james.modules.server; - -import javax.jms.ConnectionFactory; - -import org.apache.james.jmap.send.PostDequeueDecoratorFactory; -import org.apache.james.mailbox.cassandra.CassandraId; -import org.apache.james.queue.activemq.ActiveMQMailQueueFactory; -import org.apache.james.queue.api.MailQueueFactory; -import org.apache.james.queue.api.MailQueueItemDecoratorFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.inject.AbstractModule; -import com.google.inject.Provides; -import com.google.inject.Singleton; -import com.google.inject.TypeLiteral; - -public class ActiveMQQueueModule extends AbstractModule { - - private static final Logger LOGGER = LoggerFactory.getLogger(ActiveMQQueueModule.class); - - @Override - protected void configure() { - bind(MailQueueItemDecoratorFactory.class).to(new TypeLiteral<PostDequeueDecoratorFactory<CassandraId>>(){}).in(Singleton.class); - } - - @Provides - @Singleton - ConnectionFactory provideEmbededActiveMQ(EmbeddedActiveMQ embeddedActiveMQ) { - return embeddedActiveMQ.getConnectionFactory(); - } - - @Provides - @Singleton - public MailQueueFactory createActiveMailQueueFactory(ActiveMQMailQueueFactory activeMQMailQueueFactory) { - activeMQMailQueueFactory.setUseJMX(true); - activeMQMailQueueFactory.setLog(LOGGER); - activeMQMailQueueFactory.init(); - return activeMQMailQueueFactory; - } -} --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org