Search in sources :

Example 31 with Produces

use of javax.enterprise.inject.Produces in project quickstarts by jboss-switchyard.

the class FlightInfoMetadataProducer method createFlightInfoFieldList.

@Produces
@Named("flightInfoFieldMetaData")
public List<FieldMetaData> createFlightInfoFieldList() {
    List<FieldMetaData> flightFields = new ArrayList<FieldMetaData>();
    FieldMetaData flighttime = RfcFactory.eINSTANCE.createFieldMetaData();
    flighttime.setName("FLIGHTTIME");
    flighttime.setType(DataType.NUM);
    flighttime.setByteLength(10);
    flighttime.setByteOffset(0);
    flighttime.setUnicodeByteLength(20);
    flighttime.setUnicodeByteOffset(0);
    flightFields.add(flighttime);
    FieldMetaData cityfrom = RfcFactory.eINSTANCE.createFieldMetaData();
    cityfrom.setName("CITYFROM");
    cityfrom.setType(DataType.CHAR);
    cityfrom.setByteLength(20);
    cityfrom.setByteOffset(10);
    cityfrom.setUnicodeByteLength(40);
    cityfrom.setUnicodeByteOffset(20);
    flightFields.add(cityfrom);
    FieldMetaData depdate = RfcFactory.eINSTANCE.createFieldMetaData();
    depdate.setName("DEPDATE");
    depdate.setType(DataType.DATE);
    depdate.setByteLength(8);
    depdate.setByteOffset(30);
    depdate.setUnicodeByteLength(16);
    depdate.setUnicodeByteOffset(60);
    flightFields.add(depdate);
    FieldMetaData deptime = RfcFactory.eINSTANCE.createFieldMetaData();
    deptime.setName("DEPTIME");
    deptime.setType(DataType.TIME);
    deptime.setByteLength(6);
    deptime.setByteOffset(38);
    deptime.setUnicodeByteLength(12);
    deptime.setUnicodeByteOffset(76);
    flightFields.add(deptime);
    FieldMetaData cityto = RfcFactory.eINSTANCE.createFieldMetaData();
    cityto.setName("CITYTO");
    cityto.setType(DataType.CHAR);
    cityto.setByteLength(20);
    cityto.setByteOffset(44);
    cityto.setUnicodeByteLength(40);
    cityto.setUnicodeByteOffset(88);
    flightFields.add(cityto);
    FieldMetaData arrdate = RfcFactory.eINSTANCE.createFieldMetaData();
    arrdate.setName("ARRDATE");
    arrdate.setType(DataType.DATE);
    arrdate.setByteLength(8);
    arrdate.setByteOffset(64);
    arrdate.setUnicodeByteLength(16);
    arrdate.setUnicodeByteOffset(128);
    flightFields.add(arrdate);
    FieldMetaData arrtime = RfcFactory.eINSTANCE.createFieldMetaData();
    arrtime.setName("ARRTIME");
    arrtime.setType(DataType.TIME);
    arrtime.setByteLength(6);
    arrtime.setByteOffset(72);
    arrtime.setUnicodeByteLength(12);
    arrtime.setUnicodeByteOffset(144);
    flightFields.add(arrtime);
    return flightFields;
}
Also used : FieldMetaData(org.fusesource.camel.component.sap.model.rfc.FieldMetaData) ArrayList(java.util.ArrayList) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces)

Example 32 with Produces

use of javax.enterprise.inject.Produces in project quickstarts by jboss-switchyard.

the class ServerMetadataProducer method createNplServerData.

@Produces
@Named("nplServerData")
public ServerData createNplServerData() {
    ServerData data = RfcFactory.eINSTANCE.createServerData();
    data.setGwhost("nplhost");
    data.setGwserv("3342");
    data.setProgid("JCO_SERVER");
    data.setRepositoryDestination("nplDest");
    data.setConnectionCount("2");
    data.setTrace("1");
    return data;
}
Also used : ServerData(org.fusesource.camel.component.sap.model.rfc.ServerData) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces)

Example 33 with Produces

use of javax.enterprise.inject.Produces 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;
}
Also used : Properties(java.util.Properties) PropertiesComponent(org.apache.camel.component.properties.PropertiesComponent) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Example 34 with Produces

use of javax.enterprise.inject.Produces 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;
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) SjmsComponent(org.apache.camel.component.sjms.SjmsComponent) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Example 35 with Produces

use of javax.enterprise.inject.Produces 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;
}
Also used : PropertiesComponent(org.apache.camel.component.properties.PropertiesComponent) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Aggregations

Produces (javax.enterprise.inject.Produces)56 Named (javax.inject.Named)32 ApplicationScoped (javax.enterprise.context.ApplicationScoped)25 Properties (java.util.Properties)12 PropertiesComponent (org.apache.camel.component.properties.PropertiesComponent)12 ArrayList (java.util.ArrayList)6 Dependent (javax.enterprise.context.Dependent)4 ParameterizedType (java.lang.reflect.ParameterizedType)3 Type (java.lang.reflect.Type)3 RequestScoped (javax.enterprise.context.RequestScoped)3 InjectableResource (org.apache.deltaspike.core.api.resourceloader.InjectableResource)3 InjectableResourceProvider (org.apache.deltaspike.core.api.resourceloader.InjectableResourceProvider)3 OperationsFacade (org.gluu.site.ldap.OperationsFacade)3 LdapEntryManager (org.gluu.site.ldap.persistence.LdapEntryManager)3 FunctionMapperImpl (com.sun.el.lang.FunctionMapperImpl)2 VariableMapperImpl (com.sun.el.lang.VariableMapperImpl)2 CompositeELResolver (javax.el.CompositeELResolver)2 FieldMetaData (org.fusesource.camel.component.sap.model.rfc.FieldMetaData)2 FunctionTemplate (org.fusesource.camel.component.sap.model.rfc.FunctionTemplate)2 ListFieldMetaData (org.fusesource.camel.component.sap.model.rfc.ListFieldMetaData)2