Examples of PropertiesBasedEJBClientConfiguration


Examples of org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration

        p.put("remote.connection.one.port", "8080");
        p.put("remote.connection.one.host", "localhost");
        p.put("remote.connection.one.username", "quickuser");
        p.put("remote.connection.one.password", "quick-123");

        EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(p);
        ContextSelector<EJBClientContext> selector = new ConfigBasedEJBClientContextSelector(cc);
        EJBClientContext.setSelector(selector);

        Properties props = new Properties();
        props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
View Full Code Here

Examples of org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration

        if (inputStream == null) {
            throw new IllegalStateException("Could not find " + file + " in classpath");
        }
        final Properties properties = new Properties();
        properties.load(inputStream);
        final EJBClientConfiguration ejbClientConfiguration = new PropertiesBasedEJBClientConfiguration(properties);
        final ConfigBasedEJBClientContextSelector selector = new ConfigBasedEJBClientContextSelector(ejbClientConfiguration);

        return EJBClientContext.setSelector(selector);
    }
View Full Code Here

Examples of org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration

                    }
                }
                final ClassLoader oldTccl = SecurityActions.getContextClassLoader();
                try {
                    SecurityActions.setContextClassLoader(module.getClassLoader());
                    configuration = new PropertiesBasedEJBClientConfiguration(properties);

                    //if there is no username or callback handler specified in the ejb-client properties file
                    //we override the default
                    if (!properties.contains("username") && !properties.contains("callback.handler.class")) {
                        //no security config so we wrap the configuration
View Full Code Here

Examples of org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration

        if (inputStream == null) {
            throw new IllegalStateException("Could not find " + clientPropertiesFile + " in classpath");
        }
        final Properties properties = new Properties();
        properties.load(inputStream);
        final EJBClientConfiguration ejbClientConfiguration = new PropertiesBasedEJBClientConfiguration(properties);
        final ConfigBasedEJBClientContextSelector selector = new ConfigBasedEJBClientContextSelector(ejbClientConfiguration);

        return EJBClientContext.setSelector(selector);
    }
View Full Code Here

Examples of org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration

        if (inputStream == null) {
            throw new IllegalStateException("Could not find " + clientPropertiesFile + " in classpath");
        }
        final Properties properties = new Properties();
        properties.load(inputStream);
        final EJBClientConfiguration ejbClientConfiguration = new PropertiesBasedEJBClientConfiguration(properties);
        final ConfigBasedEJBClientContextSelector selector = new ConfigBasedEJBClientContextSelector(ejbClientConfiguration);

        return EJBClientContext.setSelector(selector);
    }
View Full Code Here

Examples of org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration

                    }
                }
                final ClassLoader oldTccl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
                try {
                    WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader());
                    configuration = new PropertiesBasedEJBClientConfiguration(properties);

                    //if there is no username or callback handler specified in the ejb-client properties file
                    //we override the default
                    if (!properties.contains("username") && !properties.contains("callback.handler.class")) {
                        //no security config so we wrap the configuration
View Full Code Here

Examples of org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration

            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);
    }
View Full Code Here

Examples of org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration

     * Perform the tests using the SecurityContextAssociation API to set the desired Principal.
     */
    private void callUsingSecurityContextAssociation(String userName, boolean hasRole1, boolean hasRole2) throws Exception {
        try {
            final Properties ejbClientConfiguration = EJBUtil.createEjbClientConfiguration(Utils.getHost(mgmtClient));
            EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(ejbClientConfiguration);
            final ContextSelector<EJBClientContext> selector = new ConfigBasedEJBClientContextSelector(cc);
            EJBClientContext.setSelector(selector);
            // register the client side interceptor
            final Registration clientInterceptorHandler = EJBClientContext.requireCurrent().registerInterceptor(112567,
                    new ClientSecurityInterceptor());
View Full Code Here

Examples of org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration

     * Perform the tests using the SecurityContextAssociation API to set the desired Principal.
     */
    private void callUsingSecurityContextAssociation(String userName, boolean hasRole1, boolean hasRole2) throws Exception {
        try {
            final Properties ejbClientConfiguration = EJBUtil.createEjbClientConfiguration(Utils.getHost(mgmtClient));
            EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(ejbClientConfiguration);
            final ContextSelector<EJBClientContext> selector = new ConfigBasedEJBClientContextSelector(cc);
            EJBClientContext.setSelector(selector);
            // register the client side interceptor
            final Registration clientInterceptorHandler = EJBClientContext.requireCurrent().registerInterceptor(112567,
                    new ClientSecurityInterceptor());
View Full Code Here

Examples of org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration

    }

    @Test
    public void testDirect() throws Exception {
        final Properties ejbClientConfiguration = EJBUtil.createEjbClientConfiguration(Utils.getHost(mgmtClient));
        EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(ejbClientConfiguration);
        final ContextSelector<EJBClientContext> selector = new ConfigBasedEJBClientContextSelector(cc);
        EJBClientContext.setSelector(selector);

        final SecurityInformation targetBean = EJBUtil.lookupEJB(SecuredBean.class, SecurityInformation.class);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.