Search in sources :

Example 1 with EJBClientConfiguration

use of org.jboss.ejb.client.EJBClientConfiguration in project eap-additional-testsuite by jboss-set.

the class EJBClientContextSelector method setup.

public static ContextSelector<EJBClientContext> setup(String file, Properties propertiesToReplace) throws IOException {
    // setUp the selector
    final InputStream inputStream = EJBClientContextSelector.class.getClassLoader().getResourceAsStream(file);
    if (inputStream == null) {
        throw new IllegalStateException("Could not find " + file + " in classpath");
    }
    final Properties properties = new Properties();
    properties.load(inputStream);
    // add or replace properties passed from file
    if (propertiesToReplace != null) {
        for (Object key : propertiesToReplace.keySet()) {
            properties.put(key, propertiesToReplace.get(key));
        }
    }
    final EJBClientConfiguration ejbClientConfiguration = new PropertiesBasedEJBClientConfiguration(properties);
    final ConfigBasedEJBClientContextSelector selector = new ConfigBasedEJBClientContextSelector(ejbClientConfiguration);
    return EJBClientContext.setSelector(selector);
}
Also used : PropertiesBasedEJBClientConfiguration(org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration) InputStream(java.io.InputStream) ConfigBasedEJBClientContextSelector(org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector) ConfigBasedEJBClientContextSelector(org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector) Properties(java.util.Properties) PropertiesBasedEJBClientConfiguration(org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration) EJBClientConfiguration(org.jboss.ejb.client.EJBClientConfiguration)

Example 2 with EJBClientConfiguration

use of org.jboss.ejb.client.EJBClientConfiguration in project eap-additional-testsuite by jboss-set.

the class EJBClientContextSelector method setup.

public static ContextSelector<EJBClientContext> setup(String file, Properties propertiesToReplace) throws IOException {
    // setUp the selector
    final InputStream inputStream = EJBClientContextSelector.class.getClassLoader().getResourceAsStream(file);
    if (inputStream == null) {
        throw new IllegalStateException("Could not find " + file + " in classpath");
    }
    final Properties properties = new Properties();
    properties.load(inputStream);
    // add or replace properties passed from file
    if (propertiesToReplace != null) {
        for (Object key : propertiesToReplace.keySet()) {
            properties.put(key, propertiesToReplace.get(key));
        }
    }
    final EJBClientConfiguration ejbClientConfiguration = new PropertiesBasedEJBClientConfiguration(properties);
    final ConfigBasedEJBClientContextSelector selector = new ConfigBasedEJBClientContextSelector(ejbClientConfiguration);
    return EJBClientContext.setSelector(selector);
}
Also used : PropertiesBasedEJBClientConfiguration(org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration) InputStream(java.io.InputStream) ConfigBasedEJBClientContextSelector(org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector) ConfigBasedEJBClientContextSelector(org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector) Properties(java.util.Properties) PropertiesBasedEJBClientConfiguration(org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration) EJBClientConfiguration(org.jboss.ejb.client.EJBClientConfiguration)

Example 3 with EJBClientConfiguration

use of org.jboss.ejb.client.EJBClientConfiguration in project eap-additional-testsuite by jboss-set.

the class EJBClientContextSelector method setup.

public static ContextSelector<EJBClientContext> setup(String file, Properties propertiesToReplace) throws IOException {
    // setUp the selector
    final InputStream inputStream = EJBClientContextSelector.class.getClassLoader().getResourceAsStream(file);
    if (inputStream == null) {
        throw new IllegalStateException("Could not find " + file + " in classpath");
    }
    final Properties properties = new Properties();
    properties.load(inputStream);
    // add or replace properties passed from file
    if (propertiesToReplace != null) {
        for (Object key : propertiesToReplace.keySet()) {
            properties.put(key, propertiesToReplace.get(key));
        }
    }
    final EJBClientConfiguration ejbClientConfiguration = new PropertiesBasedEJBClientConfiguration(properties);
    final ConfigBasedEJBClientContextSelector selector = new ConfigBasedEJBClientContextSelector(ejbClientConfiguration);
    return EJBClientContext.setSelector(selector);
}
Also used : PropertiesBasedEJBClientConfiguration(org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration) InputStream(java.io.InputStream) ConfigBasedEJBClientContextSelector(org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector) ConfigBasedEJBClientContextSelector(org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector) Properties(java.util.Properties) PropertiesBasedEJBClientConfiguration(org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration) EJBClientConfiguration(org.jboss.ejb.client.EJBClientConfiguration)

Aggregations

InputStream (java.io.InputStream)3 Properties (java.util.Properties)3 EJBClientConfiguration (org.jboss.ejb.client.EJBClientConfiguration)3 PropertiesBasedEJBClientConfiguration (org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration)3 ConfigBasedEJBClientContextSelector (org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector)3