use of javax.enterprise.context.ApplicationScoped in project oxTrust by GluuFederation.
the class ApplicationFactory method getSmtpConfiguration.
@Produces
@ApplicationScoped
public SmtpConfiguration getSmtpConfiguration() {
GluuAppliance appliance = applianceService.getAppliance();
SmtpConfiguration smtpConfiguration = appliance.getSmtpConfiguration();
if (smtpConfiguration == null) {
return null;
}
String password = smtpConfiguration.getPassword();
if (StringHelper.isNotEmpty(password)) {
try {
smtpConfiguration.setPasswordDecrypted(encryptionService.decrypt(password));
} catch (EncryptionException ex) {
log.error("Failed to decript SMTP user password", ex);
}
}
return smtpConfiguration;
}
use of javax.enterprise.context.ApplicationScoped in project camel by apache.
the class Jms method sjms.
@Produces
@Named("sjms")
@ApplicationScoped
SjmsComponent sjms() {
SjmsComponent component = new SjmsComponent();
component.setConnectionFactory(new ActiveMQConnectionFactory("vm://broker?broker.persistent=false&broker.useShutdownHook=false&broker.useJmx=false"));
component.setConnectionCount(maxConnections);
return component;
}
use of javax.enterprise.context.ApplicationScoped in project camel by apache.
the class Application method properties.
@Produces
@ApplicationScoped
@Named("properties")
// "properties" component bean that Camel uses to lookup properties
PropertiesComponent properties(PropertiesParser parser) {
PropertiesComponent component = new PropertiesComponent();
// Use DeltaSpike as configuration source for Camel CDI
component.setPropertiesParser(parser);
return component;
}
use of javax.enterprise.context.ApplicationScoped in project camel by apache.
the class PropertiesConfigurationTest method propertiesComponent.
@Produces
@ApplicationScoped
@Named("properties")
private static PropertiesComponent propertiesComponent() {
Properties configuration = new Properties();
configuration.put("property", "value");
PropertiesComponent component = new PropertiesComponent();
component.setInitialProperties(configuration);
component.setLocation("classpath:camel1.properties,classpath:camel2.properties");
return component;
}
use of javax.enterprise.context.ApplicationScoped in project camel by apache.
the class AdvisedRouteTest method configuration.
@Produces
@ApplicationScoped
@Named("properties")
private static PropertiesComponent configuration() {
Properties properties = new Properties();
properties.put("from", "inbound");
properties.put("to", "direct:outbound");
properties.put("header.message", "n/a");
PropertiesComponent component = new PropertiesComponent();
component.setInitialProperties(properties);
return component;
}
Aggregations