Examples of ProxyInfo


Examples of org.apache.openejb.ProxyInfo

                res.setResult(new ThrowableArtifact(namingException));
                return;
            }
        }

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

        updateServer(req, res, proxyInfo);

        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);
                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,
                        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);
                    NamingException namingException = 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.");
                    res.setResult(new ThrowableArtifact(namingException));
View Full Code Here

Examples of org.apache.openejb.ProxyInfo

    protected Object createProxy(Object retValue) throws Throwable {
        if (retValue instanceof java.util.Collection) {
            Object [] proxyInfos = ((java.util.Collection) retValue).toArray();
            Vector proxies = new Vector();
            for (int i = 0; i < proxyInfos.length; i++) {
                ProxyInfo proxyInfo = (ProxyInfo) proxyInfos[i];
                proxies.addElement(Util.getEJBProxy(proxyInfo));
            }
            return proxies;
        } else if (retValue instanceof org.apache.openejb.util.ArrayEnumeration) {
            org.apache.openejb.util.ArrayEnumeration enumeration = (org.apache.openejb.util.ArrayEnumeration) retValue;
            for (int i = enumeration.size() - 1; i >= 0; --i) {
                ProxyInfo proxyInfo = ((ProxyInfo) enumeration.get(i));
                enumeration.set(i, Util.getEJBProxy(proxyInfo));
            }
            return enumeration;
        } else if (retValue instanceof java.util.Enumeration) {
            java.util.Enumeration enumeration = (java.util.Enumeration) retValue;

            java.util.List proxies = new java.util.ArrayList();
            while (enumeration.hasMoreElements()) {
                ProxyInfo proxyInfo = ((ProxyInfo) enumeration.nextElement());
                proxies.add(Util.getEJBProxy(proxyInfo));
            }
            return new org.apache.openejb.util.ArrayEnumeration(proxies);
        } else {
            org.apache.openejb.ProxyInfo proxyInfo = (org.apache.openejb.ProxyInfo) retValue;
View Full Code Here

Examples of org.apache.openejb.ProxyInfo

    protected Object createProxy(Object retValue) throws Throwable {
        if (retValue instanceof java.util.Collection) {
            Object [] proxyInfos = ((java.util.Collection) retValue).toArray();
            Vector proxies = new Vector();
            for (int i = 0; i < proxyInfos.length; i++) {
                ProxyInfo proxyInfo = (ProxyInfo) proxyInfos[i];
                proxies.addElement(Util.getEJBProxy(proxyInfo));
            }
            return proxies;
        } else if (retValue instanceof org.apache.openejb.util.ArrayEnumeration) {
            org.apache.openejb.util.ArrayEnumeration enumeration = (org.apache.openejb.util.ArrayEnumeration) retValue;
            for (int i = enumeration.size() - 1; i >= 0; --i) {
                ProxyInfo proxyInfo = ((ProxyInfo) enumeration.get(i));
                enumeration.set(i, Util.getEJBProxy(proxyInfo));
            }
            return enumeration;
        } else if (retValue instanceof java.util.Enumeration) {
            java.util.Enumeration enumeration = (java.util.Enumeration) retValue;

            java.util.List proxies = new java.util.ArrayList();
            while (enumeration.hasMoreElements()) {
                ProxyInfo proxyInfo = ((ProxyInfo) enumeration.nextElement());
                proxies.add(Util.getEJBProxy(proxyInfo));
            }
            return new org.apache.openejb.util.ArrayEnumeration(proxies);
        } else {
            org.apache.openejb.ProxyInfo proxyInfo = (org.apache.openejb.ProxyInfo) retValue;
View Full Code Here

Examples of org.fao.geonet.utils.ProxyInfo

      throw new OperationAbortedEx("Parameters saved but cannot restart Lucene Index Optimizer: "+e.getMessage());
    }

        try {
        // Load proxy information into Jeeves
        ProxyInfo pi = JeevesProxyInfo.getInstance();
        boolean useProxy = settingMan.getValueAsBool(SettingManager.SYSTEM_PROXY_USE, false);
        if (useProxy) {
          String  proxyHost      = settingMan.getValue(SettingManager.SYSTEM_PROXY_HOST);
          String  proxyPort      = settingMan.getValue(SettingManager.SYSTEM_PROXY_PORT);
          String  username       = settingMan.getValue(SettingManager.SYSTEM_PROXY_USERNAME);
          String  password       = settingMan.getValue(SettingManager.SYSTEM_PROXY_PASSWORD);
          pi.setProxyInfo(proxyHost, Integer.valueOf(proxyPort), username, password);
        }
      } catch (Exception e) {
            e.printStackTrace();
            throw new OperationAbortedEx("Parameters saved but cannot set proxy information: " + e.getMessage());
        }
View Full Code Here

Examples of org.jivesoftware.smack.proxy.ProxyInfo

        if (server == null) {
            throw new URISyntaxException(preferenceUtils.getServer(),
                "The XMPP/Jabber server address is invalid: " + serverString); //$NON-NLS-1$
        }

        ProxyInfo proxyInfo = getProxyInfo(uri.getHost());
        ConnectionConfiguration conConfig = null;

        if (uri.getPort() < 0) {
            conConfig = proxyInfo == null ? new ConnectionConfiguration(
                uri.getHost()) : new ConnectionConfiguration(uri.getHost(),
View Full Code Here

Examples of org.omg.CosTrading.ProxyPackage.ProxyInfo

        // examine the offers of this service type
        Enumeration o = table.elements();
        while (o.hasMoreElements() && searchCount < searchCard)
        {
      ProxyInfo info = (ProxyInfo)o.nextElement();

      ProxySourceAdapter source = new ProxySourceAdapter(info);

      if (considerOffer(source, useDynamic, useModifiable, ts)) {
          potentialOffers.addElement(source);
View Full Code Here

Examples of org.rhq.modules.plugins.jbossas7.modcluster.ProxyInfo

        Address addr = new Address(path);
        Operation op = new Operation(PROXY_INFO_OPERATION, addr);
        Result result = connection.execute(op);
        //get ProxyInfo and parse
        rawProxyInfo = extractRawProxyInfo(result);
        ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);

        //only discover the virtualhosts and webcontexts relevant to this modcluster node.
        for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
            if (availableContext.getJvmRoute().equals(jvmRoute)) {
                //prepend the modcluster component to the webcontext key for identification later
                String resourceKey = path + ":" + availableContext.createKey();
                DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
                    resourceKey, availableContext.createName(), null, "Webapp Context", null, null);
View Full Code Here

Examples of org.rhq.plugins.modcluster.model.ProxyInfo

    public void testProxyInfo() throws Exception {
        String[] availableFiles = new String[] { "/proxy_config/proxy_config_1.txt", "/proxy_config/proxy_config_2.txt" };

        for (String testConfigurationFile : availableFiles) {
            String testConfiguration = readConfigFile(testConfigurationFile);
            ProxyInfo proxyInfo = new ProxyInfo(testConfiguration);

            for (ProxyInfo.Context context : proxyInfo.getAvailableContexts()) {
                assert (proxyInfo.getAvailableContexts().indexOf(context) != -1) : "Equals and hash functions not implemented correctly for "
                    + ProxyInfo.Context.class.getCanonicalName();

                assert (context.equals(ProxyInfo.Context.fromString(context.toString())) == true) : "fromString and toString are not equivalent for:"
                    + ProxyInfo.Context.class.getCanonicalName();
            }

            assert (proxyInfo.getAvailableContexts().size() != 0) : "Raw proxy info parsing failed to parse application contexts!";
            assert (proxyInfo.getAvailableVhosts().size() != 0) : "Raw proxy info parsing failed to parse vhosts!";
        }
    }
View Full Code Here

Examples of org.sonatype.nexus.client.rest.ProxyInfo

    }
  }

  protected void applyProxyIfAny(final ConnectionInfo connectionInfo, ApacheHttpClient4Config config) {
    if (connectionInfo.getProxyInfos().size() > 0) {
      final ProxyInfo proxyInfo = connectionInfo.getProxyInfos().get(connectionInfo.getBaseUrl().getProtocol());
      if (proxyInfo != null) {
        config.getProperties().put(
            PROPERTY_PROXY_URI, "http://" + proxyInfo.getProxyHost() + ":" + proxyInfo.getProxyPort()
        );

        if (proxyInfo.getProxyAuthentication() != null) {
          if (proxyInfo.getProxyAuthentication() instanceof UsernamePasswordAuthenticationInfo) {
            final UsernamePasswordAuthenticationInfo upinfo =
                (UsernamePasswordAuthenticationInfo) connectionInfo.getAuthenticationInfo();
            config.getProperties().put(PROPERTY_PROXY_USERNAME, upinfo.getUsername());
            config.getProperties().put(PROPERTY_PROXY_PASSWORD, upinfo.getPassword());
          }
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.