Examples of ProxyConfiguration


Examples of org.apache.http.osgi.services.ProxyConfiguration

    public Credentials getCredentials(final AuthScope authscope) {
        // iterate over all active proxy configurations at the moment of getting the credential
        for (final ServiceRegistration registration : registeredConfigurations.values()) {
            final Object proxyConfigurationObject = bundleContext.getService(registration.getReference());
            if (proxyConfigurationObject != null) {
                final ProxyConfiguration proxyConfiguration = (ProxyConfiguration) proxyConfigurationObject;
                if (proxyConfiguration.isEnabled()) {
                    final AuthScope actual = new AuthScope(proxyConfiguration.getHostname(), proxyConfiguration.getPort());
                    if (authscope.equals(actual)) {
                        return new UsernamePasswordCredentials(proxyConfiguration.getUsername(),
                                                               proxyConfiguration.getPassword());
                    }

                }
            }
        }
View Full Code Here

Examples of org.apache.http.osgi.services.ProxyConfiguration

    public Credentials getCredentials(final AuthScope authscope) {
        // iterate over all active proxy configurations at the moment of getting the credential
        for (final ServiceRegistration registration : registeredConfigurations.values()) {
            final Object proxyConfigurationObject = bundleContext.getService(registration.getReference());
            if (proxyConfigurationObject != null) {
                final ProxyConfiguration proxyConfiguration = (ProxyConfiguration) proxyConfigurationObject;
                if (proxyConfiguration.isEnabled()) {
                    final AuthScope actual = new AuthScope(proxyConfiguration.getHostname(), proxyConfiguration.getPort());
                    if (authscope.equals(actual)) {
                        return new UsernamePasswordCredentials(proxyConfiguration.getUsername(),
                                                               proxyConfiguration.getPassword());
                    }

                }
            }
        }
View Full Code Here

Examples of org.apache.http.osgi.services.ProxyConfiguration

    /**
     * {@inheritDoc}
     */
    @Override
    protected HttpHost determineProxy(final HttpHost target, final HttpRequest request, final HttpContext context) throws HttpException {
        ProxyConfiguration proxyConfiguration = null;

        for (final ServiceRegistration registration : registeredConfigurations.values()) {
            final Object proxyConfigurationObject = bundleContext.getService(registration.getReference());
            if (proxyConfigurationObject != null) {
                proxyConfiguration = (ProxyConfiguration) proxyConfigurationObject;
                if (proxyConfiguration.isEnabled()) {
                    for (final String exception : proxyConfiguration.getProxyExceptions()) {
                        if (createMatcher(exception).matches(target.getHostName())) {
                            return null;
                        } else {
                            return new HttpHost(proxyConfiguration.getHostname(), proxyConfiguration.getPort());
                        }
                    }
                }
            }
        }
View Full Code Here

Examples of org.apache.tuscany.core.invocation.ProxyConfiguration

        for (Method method : javaMethods) {
            InvocationConfiguration iConfig = new InvocationConfiguration(method);
            iConfigMap.put(method, iConfig);
        }
        QualifiedName qName = new QualifiedName(externalService.getName() + "/" + service.getName());
        ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory);
        proxyFactory.setBusinessInterface(serviceContract.getInterface());
        proxyFactory.setProxyConfiguration(pConfiguration);
        config.addTargetProxyFactory(service.getName(), proxyFactory);
        configuredService.setProxyFactory(proxyFactory);
        if (policyBuilder != null) {
View Full Code Here

Examples of org.apache.tuscany.core.invocation.ProxyConfiguration

        for (Method method : javaMethods) {
            InvocationConfiguration iConfig = new InvocationConfiguration(method);
            iConfigMap.put(method, iConfig);
        }
        QualifiedName qName = new QualifiedName(entryPoint.getConfiguredReference().getTargetConfiguredServices().get(0).getAggregatePart().getName() + "/" + service.getName());
        ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory);
        proxyFactory.setBusinessInterface(serviceContract.getInterface());
        proxyFactory.setProxyConfiguration(pConfiguration);
        config.addSourceProxyFactory(service.getName(), proxyFactory);
        configuredService.setProxyFactory(proxyFactory);
        if (policyBuilder != null) {
View Full Code Here

Examples of org.apache.tuscany.core.invocation.ProxyConfiguration

        for (Method method : javaMethods) {
            InvocationConfiguration iConfig = new InvocationConfiguration(method);
            iConfigMap.put(method, iConfig);
        }
        QualifiedName qName = new QualifiedName(externalService.getName() + "/" + service.getName());
        ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory);
        proxyFactory.setBusinessInterface(serviceContract.getInterface());
        proxyFactory.setProxyConfiguration(pConfiguration);
        config.addTargetProxyFactory(service.getName(), proxyFactory);
        configuredService.setProxyFactory(proxyFactory);
        if (policyBuilder != null) {
View Full Code Here

Examples of org.apache.tuscany.core.invocation.ProxyConfiguration

        for (Method method : javaMethods) {
            InvocationConfiguration iConfig = new InvocationConfiguration(method);
            iConfigMap.put(method, iConfig);
        }
        QualifiedName qName = new QualifiedName(entryPoint.getConfiguredReference().getTargetConfiguredServices().get(0).getAggregatePart().getName() + "/" + service.getName());
        ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory);
        proxyFactory.setBusinessInterface(serviceContract.getInterface());
        proxyFactory.setProxyConfiguration(pConfiguration);
        config.addSourceProxyFactory(service.getName(), proxyFactory);
        configuredService.setProxyFactory(proxyFactory);
        if (policyBuilder != null) {
View Full Code Here

Examples of org.eclipse.jetty.client.ProxyConfiguration

            }

            final Object proxyUri = config.getProperties().get(ClientProperties.PROXY_URI);
            if (proxyUri != null) {
                final URI u = getProxyUri(proxyUri);
                final ProxyConfiguration proxyConfig = client.getProxyConfiguration();
                proxyConfig.getProxies().add(new HttpProxy(u.getHost(), u.getPort()));
            }

            if (disableCookies) {
                client.setCookieStore(new HttpCookieStore.Empty());
            }
View Full Code Here

Examples of org.jboss.invocation.proxy.ProxyConfiguration

                    ROOT_LOGGER.transactionSubsystemNotAvailable(className);
                } else {
                    try {
                        final TransactionSynchronizationRegistry transactionSynchronizationRegistry = (TransactionSynchronizationRegistry) syncController.getValue();
                        final TransactionManager transactionManager = (TransactionManager) managerController.getValue();
                        final ProxyConfiguration proxyConfiguration = new ProxyConfiguration()
                                .setClassLoader(module.getClassLoader())
                                .setSuperClass(clazz)
                                .setProxyName(clazz.getName() + "$$DataSourceProxy" + proxyNameCount.incrementAndGet())
                                .setProtectionDomain(clazz.getProtectionDomain());
View Full Code Here

Examples of org.jboss.invocation.proxy.ProxyConfiguration

                } catch (ClassNotFoundException e) {
                    throw MESSAGES.cannotLoadViewClass(e, view.getViewClassName(), configuration);
                }
                final ViewConfiguration viewConfiguration;

                final ProxyConfiguration proxyConfiguration = new ProxyConfiguration();
                proxyConfiguration.setProxyName(viewClass.getName() + "$$$view" + PROXY_ID.incrementAndGet());
                proxyConfiguration.setClassLoader(module.getClassLoader());
                proxyConfiguration.setProtectionDomain(viewClass.getProtectionDomain());
                proxyConfiguration.setMetadataSource(proxyReflectionIndex);
                if (view.isSerializable()) {
                    proxyConfiguration.addAdditionalInterface(Serializable.class);
                    if (view.isUseWriteReplace()) {
                        proxyConfiguration.addAdditionalInterface(WriteReplaceInterface.class);
                    }
                }

                //we define it in the modules class loader to prevent permgen leaks
                if (viewClass.isInterface()) {
                    proxyConfiguration.setSuperClass(Object.class);
                    proxyConfiguration.addAdditionalInterface(viewClass);
                    viewConfiguration = view.createViewConfiguration(viewClass, configuration, new ProxyFactory(proxyConfiguration));
                } else {
                    proxyConfiguration.setSuperClass(viewClass);
                    viewConfiguration = view.createViewConfiguration(viewClass, configuration, new ProxyFactory(proxyConfiguration));
                }
                for (final ViewConfigurator configurator : view.getConfigurators()) {
                    configurator.configure(context, configuration, view, viewConfiguration);
                }
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.