Examples of ProxyInfo


Examples of org.apache.maven.wagon.proxy.ProxyInfo

        {
            throw new AuthenticationException( "Cannot connect. Reason: " + e.getMessage(), e );
        }

        Proxy proxy = null;
        ProxyInfo proxyInfo = getProxyInfo( ProxyInfo.PROXY_SOCKS5, getRepository().getHost() );
        if ( proxyInfo != null && proxyInfo.getHost() != null )
        {
            proxy = new ProxySOCKS5( proxyInfo.getHost(), proxyInfo.getPort() );
            ( (ProxySOCKS5) proxy ).setUserPasswd( proxyInfo.getUserName(), proxyInfo.getPassword() );
        }
        else
        {
            proxyInfo = getProxyInfo( ProxyInfo.PROXY_HTTP, getRepository().getHost() );
            if ( proxyInfo != null && proxyInfo.getHost() != null )
            {
                proxy = new ProxyHTTP( proxyInfo.getHost(), proxyInfo.getPort() );
                ( (ProxyHTTP) proxy ).setUserPasswd( proxyInfo.getUserName(), proxyInfo.getPassword() );
            }
            else
            {
                // Backwards compatibility
                proxyInfo = getProxyInfo( getRepository().getProtocol(), getRepository().getHost() );
                if ( proxyInfo != null && proxyInfo.getHost() != null )
                {
                    // if port == 1080 we will use SOCKS5 Proxy, otherwise will use HTTP Proxy
                    if ( proxyInfo.getPort() == SOCKS5_PROXY_PORT )
                    {
                        proxy = new ProxySOCKS5( proxyInfo.getHost(), proxyInfo.getPort() );
                        ( (ProxySOCKS5) proxy ).setUserPasswd( proxyInfo.getUserName(), proxyInfo.getPassword() );
                    }
                    else
                    {
                        proxy = new ProxyHTTP( proxyInfo.getHost(), proxyInfo.getPort() );
                        ( (ProxyHTTP) proxy ).setUserPasswd( proxyInfo.getUserName(), proxyInfo.getPassword() );
                    }
                }
            }
        }
        session.setProxy( proxy );
View Full Code Here

Examples of org.apache.maven.wagon.proxy.ProxyInfo

        throws ConnectionException, AuthenticationException, ComponentConfigurationException, IOException,
        TransferFailedException, ResourceDoesNotExistException, AuthorizationException
    {
        getServerFixture().addFilter( "*", new ProxyConnectionVerifierFilter() );

        ProxyInfo info = newProxyInfo();
        if ( !initTest( null, info ) )
        {
            return;
        }

View Full Code Here

Examples of org.apache.maven.wagon.proxy.ProxyInfo

        return false;
    }

    protected ProxyInfo newProxyInfo()
    {
        ProxyInfo info = new ProxyInfo();
        info.setType( isSsl() ? "https" : "http" );
        info.setHost( ServerFixture.SERVER_HOST );
        info.setPort( getPort() );

        return info;
    }
View Full Code Here

Examples of org.apache.openejb.ProxyInfo

                    res.setResult(new NamingException("Expected an ejb proxy, found unknown object: type="+object.getClass().getName() + ", toString="+object));
                    return;
                }
            }

            ProxyInfo proxyInfo = handler.getProxyInfo();
            DeploymentInfo deployment = proxyInfo.getDeploymentInfo();
            String deploymentID = deployment.getDeploymentID().toString();

            switch(proxyInfo.getInterfaceType()){
                case EJB_HOME: {
                    res.setResponseCode(ResponseCodes.JNDI_EJBHOME);
                    EJBMetaDataImpl metaData = new EJBMetaDataImpl(deployment.getHomeInterface(),
                            deployment.getRemoteInterface(),
                            deployment.getPrimaryKeyClass(),
                            deployment.getComponentType().toString(),
                            deploymentID,
                            -1, null);
                    res.setResult(metaData);
                    break;
                }
                case EJB_LOCAL_HOME: {
                    res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
                    res.setResult(new NamingException("Not remotable: '"+name+"'. EJBLocalHome interfaces are not remotable as per the EJB specification."));
                    break;
                }
                case BUSINESS_REMOTE: {
                    res.setResponseCode(ResponseCodes.JNDI_BUSINESS_OBJECT);
                    EJBMetaDataImpl metaData = new EJBMetaDataImpl(null,
                            null,
                            deployment.getPrimaryKeyClass(),
                            deployment.getComponentType().toString(),
                            deploymentID,
                            -1, proxyInfo.getInterfaces());
                    metaData.setPrimaryKey(proxyInfo.getPrimaryKey());
                    res.setResult(metaData);
                    break;
                }
                case BUSINESS_LOCAL: {
                    String property = SystemInstance.get().getProperty("openejb.remotable.businessLocals", "false");
                    if (property.equalsIgnoreCase("true")) {
                        res.setResponseCode(ResponseCodes.JNDI_BUSINESS_OBJECT);
                        EJBMetaDataImpl metaData = new EJBMetaDataImpl(null,
                                null,
                                deployment.getPrimaryKeyClass(),
                                deployment.getComponentType().toString(),
                                deploymentID,
                                -1, proxyInfo.getInterfaces());
                        metaData.setPrimaryKey(proxyInfo.getPrimaryKey());
                        res.setResult(metaData);
                    } else {
                        res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
                        res.setResult(new NamingException("Not remotable: '"+name+"'. Business Local interfaces are not remotable as per the EJB specification.  To disable this restriction, set the system property 'openejb.remotable.businessLocals=true' in the server."));
                    }
View Full Code Here

Examples of org.apache.openejb.ProxyInfo

                    return;
                }
            }
        }

        ProxyInfo proxyInfo = handler.getProxyInfo();
        BeanContext beanContext = proxyInfo.getBeanContext();
        String deploymentID = beanContext.getDeploymentID().toString();

        updateServer(req, res, proxyInfo);

        switch (proxyInfo.getInterfaceType()) {
            case EJB_HOME: {
                res.setResponseCode(ResponseCodes.JNDI_EJBHOME);
                EJBMetaDataImpl metaData = new EJBMetaDataImpl(beanContext.getHomeInterface(),
                                                               beanContext.getRemoteInterface(),
                                                               beanContext.getPrimaryKeyClass(),
                                                               beanContext.getComponentType().toString(),
                                                               deploymentID,
                                                               -1,
                                                               convert(proxyInfo.getInterfaceType()),
                                                               null,
                                                               beanContext.getAsynchronousMethodSignatures());
                metaData.loadProperties(beanContext.getProperties());
                log(metaData);
                res.setResult(metaData);
                break;
            }
            case EJB_LOCAL_HOME: {
                res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
                NamingException namingException = new NamingException("Not remotable: '" + name + "'. EJBLocalHome interfaces are not remotable as per the EJB specification.");
                res.setResult(new ThrowableArtifact(namingException));
                break;
            }
            case BUSINESS_REMOTE: {
                res.setResponseCode(ResponseCodes.JNDI_BUSINESS_OBJECT);
                EJBMetaDataImpl metaData = new EJBMetaDataImpl(null,
                                                               null,
                                                               beanContext.getPrimaryKeyClass(),
                                                               beanContext.getComponentType().toString(),
                                                               deploymentID,
                                                               -1,
                                                               convert(proxyInfo.getInterfaceType()),
                                                               proxyInfo.getInterfaces(),
                                                               beanContext.getAsynchronousMethodSignatures());
                metaData.setPrimaryKey(proxyInfo.getPrimaryKey());
                metaData.loadProperties(beanContext.getProperties());

                log(metaData);
                res.setResult(metaData);
                break;
View Full Code Here

Examples of org.apache.openejb.ProxyInfo

                req.getMethodParameters(),
                req.getPrimaryKey()
        );

        if (result instanceof ProxyInfo) {
            final ProxyInfo info = (ProxyInfo) result;
            res.setResponse(ResponseCodes.EJB_OK, info.getPrimaryKey());
        } else {

            result = new RemoteException("The bean is not EJB compliant.  The bean should be created or and exception should be thrown.");
            logger.error(req + "The bean is not EJB compliant.  The bean should be created or and exception should be thrown.");
            res.setResponse(ResponseCodes.EJB_SYS_EXCEPTION, new ThrowableArtifact((Throwable) result));
View Full Code Here

Examples of org.apache.openejb.ProxyInfo

        if (result instanceof Collection) {

            final Object[] primaryKeys = ((Collection) result).toArray();

            for (int i = 0; i < primaryKeys.length; i++) {
                final ProxyInfo proxyInfo = ((ProxyInfo) primaryKeys[i]);
                if (proxyInfo == null) {
                    primaryKeys[i] = null;
                } else {
                    primaryKeys[i] = proxyInfo.getPrimaryKey();
                }
            }

            res.setResponse(ResponseCodes.EJB_OK_FOUND_COLLECTION, primaryKeys);

        } else if (result instanceof java.util.Enumeration) {

            final java.util.Enumeration resultAsEnum = (java.util.Enumeration) result;
            final java.util.List<Object> listOfPKs = new ArrayList<Object>();
            while (resultAsEnum.hasMoreElements()) {
                final ProxyInfo proxyInfo = ((ProxyInfo) resultAsEnum.nextElement());
                if (proxyInfo == null) {
                    listOfPKs.add(null);
                } else {
                    listOfPKs.add(proxyInfo.getPrimaryKey());
                }
            }

            res.setResponse(ResponseCodes.EJB_OK_FOUND_ENUMERATION, listOfPKs.toArray(new Object[listOfPKs.size()]));
            /* Single instance found */
        } else if (result instanceof ProxyInfo) {
            final ProxyInfo proxyInfo = ((ProxyInfo) result);
            result = proxyInfo.getPrimaryKey();
            res.setResponse(ResponseCodes.EJB_OK_FOUND, result);
        } else if (result == null) {
            res.setResponse(ResponseCodes.EJB_OK_FOUND, null);
        } else {

View Full Code Here

Examples of org.apache.openejb.ProxyInfo

        checkAuthorization(method);
        return container.invoke(deploymentID, interfaceType, interfce, method, args, null);
    }

    protected Object create(Class interfce, Method method, Object[] args, Object proxy) throws Throwable {
        ProxyInfo proxyInfo = (ProxyInfo) container.invoke(deploymentID, interfaceType, interfce, method, args, null);
        assert proxyInfo != null : "Container returned a null ProxyInfo: ContainerID=" + container.getContainerID();
        return createProxy(proxyInfo.getPrimaryKey(), getMainInterface());
    }
View Full Code Here

Examples of org.apache.openejb.ProxyInfo

                handleException(createContext, txPolicy, e);
            } finally {
                afterInvoke(createContext, txPolicy, instance);
            }

            return new ProxyInfo(beanContext, primaryKey);
        } finally {
            ThreadContext.exit(oldCallContext);
        }
    }
View Full Code Here

Examples of org.apache.openejb.ProxyInfo

                unregisterEntityManagers(instance, createContext);

                afterInvoke(createContext, txPolicy, instance);
            }

            return new ProxyInfo(beanContext, primaryKey);
        } finally {
            ThreadContext.exit(oldCallContext);
        }
    }
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.