Creates an endpoint reference by duplicating the endpoint reference of a given server.
@param server
@param address
@param props
@return
3439
private static EndpointReferenceType createEPR(Server server, String address, SLProperties props) {
        EndpointReferenceType sourceEPR = server.getEndpoint().getEndpointInfo().getTarget();
        EndpointReferenceType targetEPR = WSAEndpointReferenceUtils.duplicate(sourceEPR);
        WSAEndpointReferenceUtils.setAddress(targetEPR, address);

        if (props != null) {
            addProperties(targetEPR, props);
        }
        return targetEPR;
    }
261399
static Map<String, Object> makeHttpMap(Properties props)
  {
    Map<String, Object> httpMap = Maps.newHashMap();

    final String urlProperty = "com.metamx.emitter.http.url";

    final String baseUrl = props.getProperty(urlProperty);
    if (baseUrl == null) {
      throw new IAE("Property[%s] must be set", urlProperty);
    }

    httpMap.put("recipientBaseUrl", baseUrl);
    httpMap.put("flushMillis", Long.parseLong(props.getProperty("com.metamx.emitter.flushMillis", "60000")));
    httpMap.put("flushCount", Integer.parseInt(props.getProperty("com.metamx.emitter.flushCount", "300")));
    /**
     * The defaultValue for "com.metamx.emitter.http.flushTimeOut" must be same as {@link HttpEmitterConfig.DEFAULT_FLUSH_TIME_OUT}
     * */
    httpMap.put("flushTimeOut", Long.parseLong(props.getProperty("com.metamx.emitter.http.flushTimeOut", String.valueOf(Long.MAX_VALUE))));
    if (props.containsKey("com.metamx.emitter.http.basicAuthentication")) {
      httpMap.put("basicAuthentication", props.getProperty("com.metamx.emitter.http.basicAuthentication"));
    }
    if (props.containsKey("com.metamx.emitter.http.batchingStrategy")) {
      httpMap.put("batchingStrategy", props.getProperty("com.metamx.emitter.http.batchingStrategy").toUpperCase());
    }
    if (props.containsKey("com.metamx.emitter.http.maxBatchSize")) {
      httpMap.put("maxBatchSize", Integer.parseInt(props.getProperty("com.metamx.emitter.http.maxBatchSize")));
    }
    if (props.containsKey("com.metamx.emitter.http.maxBufferSize")) {
      httpMap.put("maxBufferSize", Long.parseLong(props.getProperty("com.metamx.emitter.http.maxBufferSize")));
    }
    return httpMap;
  }
366259
public SingleServerConfig setAddress(String address) {
        if (address != null) {
            this.address = URIBuilder.create(address);
        }
        return this;
    }
774889
private EndpointActivationServiceInfo createEndpointActivationServiceInfo(String id) {
        EndpointActivationServiceInfo easInfo = endpointActivationServices.get(id);
        if (easInfo == null) {
            easInfo = new EndpointActivationServiceInfo(id);
            endpointActivationServices.put(id, easInfo);
        }
        return easInfo;
    }
483787
public ServerRedirect addServerMapping(String sourceHost, String destinationHost, String hostHeader) {
        JSONObject response = null;

        ArrayList<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();
        params.add(new BasicNameValuePair("srcUrl", sourceHost));
        params.add(new BasicNameValuePair("destUrl", destinationHost));
        params.add(new BasicNameValuePair("profileIdentifier", this._profileName));
        if (hostHeader != null) {
            params.add(new BasicNameValuePair("hostHeader", hostHeader));
        }

        try {
            BasicNameValuePair paramArray[] = new BasicNameValuePair[params.size()];
            params.toArray(paramArray);
            response = new JSONObject(doPost(BASE_SERVER, paramArray));
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        return getServerRedirectFromJSON(response);
    }
239206
public void addMovingEndpoint(Token token, InetAddress endpoint)
    {
        assert endpoint != null;

        lock.writeLock().lock();

        try
        {
            movingEndpoints.add(Pair.create(token, endpoint));
        }
        finally
        {
            lock.writeLock().unlock();
        }
    }
525919
private static Endpoint initServiceEndpoint(EndpointRegistry epRegistry, String contextPath, String servletName)
   {
      if (contextPath.startsWith("/"))
         contextPath = contextPath.substring(1);

      final ObjectName oname = ObjectNameFactory.create(Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_CONTEXT
            + "=" + contextPath + "," + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName);
      Endpoint endpoint = epRegistry.getEndpoint(oname);
      if (endpoint == null)
      {
         throw Messages.MESSAGES.cannotObtainEndpoint(oname);
      }

      //Inject the EJB and JNDI resources if possible
      injectServiceAndHandlerResources(endpoint);

      return endpoint;
   }
752006
private AddressComponent copy(final AddressComponent in) {
        final AddressComponent out = new AddressComponent();
        out.longName = in.longName;
        out.shortName = in.shortName;
        out.types = Arrays.copyOf(in.types, in.types.length);
        return out;
    }
766992
@Override
  public void setEndpointAddress(BindingProvider soapClient, String endpointAddress) {
    soapClient.getRequestContext().put(
        BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);
  }
108880
static Endpoint produceLocalEndpoint(String serviceName) {
    Endpoint.Builder builder = Endpoint.newBuilder().serviceName(serviceName);
    try {
      Enumeration<NetworkInterface> nics = NetworkInterface.getNetworkInterfaces();
      if (nics == null) {
        return builder.build();
      }
      while (nics.hasMoreElements()) {
        NetworkInterface nic = nics.nextElement();
        Enumeration<InetAddress> addresses = nic.getInetAddresses();
        while (addresses.hasMoreElements()) {
          InetAddress address = addresses.nextElement();
          if (address.isSiteLocalAddress()) {
            builder.ip(address);
            break;
          }
        }
      }
    } catch (Exception e) {
      // don't crash the caller if there was a problem reading nics.
      if (logger.isLoggable(Level.FINE)) {
        logger.log(Level.FINE, "error reading nics", e);
      }
    }
    return builder.build();
  }
1137369
public static Map<String, CmsClientProperty> copyProperties(Map<String, CmsClientProperty> props) {

        Map<String, CmsClientProperty> result = new HashMap<String, CmsClientProperty>();
        for (Map.Entry<String, CmsClientProperty> entry : props.entrySet()) {
            String key = entry.getKey();
            CmsClientProperty copiedValue = new CmsClientProperty(entry.getValue());
            result.put(key, copiedValue);
        }
        return result;
    }
951576
public static PortType createPortType(StringType namespace, StringType name, StringType address) {
        PortType endpointType = new PortType();
        endpointType.namespace = namespace;
        endpointType.name = name;
        endpointType.address = address;
        return endpointType;

    }
318531
public static ResponseAddressAttribute createResponseAddressAttribute(
			TransportAddress address) {
		ResponseAddressAttribute attribute = new ResponseAddressAttribute();

		attribute.setAddress(address);

		return attribute;
	}
974378
private Endpoint getEndpoint(String serviceName) {
        Endpoint cachedEndpoint = endpointCache.get(serviceName);

        if (cachedEndpoint == null) {
            cachedEndpoint = computeEndpoint(serviceName);
            if (cachedEndpoint == null) {
                return null;
            }
        }

        endpointCache.put(serviceName, cachedEndpoint);
        return cachedEndpoint;
    }
349669
public WSEJBEndpointManager createWebServiceEndpointManager(J2EEName j2eeName,
                                                                Class<?> provider, // d492780, F87951
                                                                Method[] methods) throws EJBException, EJBConfigurationException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2

        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "createWebServiceEndpointManager : " + j2eeName,
                     new Object[] { provider, methods });

        EJSHome home = (EJSHome) homeOfHomes.getHome(j2eeName);

        // If a WebService request comes in after a home has been uninstalled,
        // then it won't be found.                                         d547849
        if (home == null) {
            if (isTraceOn && tc.isEntryEnabled())
                Tr.exit(tc, "createWebServiceEndpointManager could not find home for : " +
                            j2eeName);
            throw ExceptionUtil.EJBException("Unable to find EJB component: " + j2eeName, null);
        }

        BeanMetaData bmd = home.beanMetaData;
        Method[] endpointMethods = methods;

        // -----------------------------------------------------------------------
        // If this is the first time the endpoint has been accessed,
        // then resolve the methods to insure this is a valid configuration
        // and JITDeploy the WSEJBProxy class if there are around invoke
        // interceptors.                                                   d497921
        // -----------------------------------------------------------------------
        synchronized (bmd) {
            if (!bmd.ivWebServiceEndpointCreated) {
                if (provider != null) {
                    // The Web Service Endpoint Interface from ejb-jar.xml is for
                    // JAX-RPC, and cannot be used with a JAX-WS Provider.
                    if (bmd.webserviceEndpointInterfaceClass != null) {
                        // Log the error and throw meaningful exception.
                        Tr.error(tc, "WS_ENDPOINT_PROVIDER_CONFLICT_CNTR0176E",
                                 new Object[] { bmd.webserviceEndpointInterfaceClass.getName(),
                                                bmd.j2eeName.getComponent(),
                                                bmd.j2eeName.getModule(),
                                                bmd.j2eeName.getApplication() });
                        throw new EJBConfigurationException("Web Service Provider interface conflicts with the " +
                                                            "configured Web Service Endpoint interface " +
                                                            bmd.webserviceEndpointInterfaceClass.getName() +
                                                            " for the " + bmd.j2eeName.getComponent() +
                                                            " bean in the " + bmd.j2eeName.getModule() +
                                                            " module of the " + bmd.j2eeName.getApplication() +
                                                            " application.");
                    }

                    endpointMethods = provider.getMethods();

                    if (isTraceOn && tc.isDebugEnabled())
                        Tr.debug(tc, "provider methods : ", (Object[]) endpointMethods);
                }

                // Resolve the Web Service Endpoint methods.  This will make sure that
                // the bean actually implements the methods, but will also remove any
                // excess methodInfos for the webservice endpoint interface in BMD.
                // Until now, EJBContainer is not aware of what the endpoint methods
                // are, so assumes all methods on the bean may be endpoint methods.
                boolean hasAroundInvoke = WSEJBWrapper.resolveWebServiceEndpointMethods(bmd, endpointMethods);

                // Finally, if any of the methods have around invoke interceptors,
                // then a WSEJBProxy must be created by JITDeploy.  An instance of
                // the proxy will be returned to WebServices component to invoke
                // the bean method, instead of an actual bean instance.
                if (hasAroundInvoke) {
                    try {
                        bmd.ivWebServiceEndpointProxyClass = JITDeploy.generateWSEJBProxy(bmd.classLoader,
                                                                                          bmd.ivWebServiceEndpointProxyName,
                                                                                          provider,
                                                                                          endpointMethods,
                                                                                          bmd.wsEndpointMethodInfos,
                                                                                          bmd.enterpriseBeanClassName,
                                                                                          bmd.j2eeName.toString(),
                                                                                          getEJBRuntime().getClassDefiner()); // F70650
                    } catch (ClassNotFoundException ex) {
                        // Log the error and throw meaningful exception.
                        Tr.error(tc, "WS_EJBPROXY_FAILURE_CNTR0177E",
                                 new Object[] { bmd.j2eeName.getComponent(),
                                                bmd.j2eeName.getModule(),
                                                bmd.j2eeName.getApplication(),
                                                ex });
                        throw ExceptionUtil.EJBException("Failure occurred attempting to create a Web service " +
                                                         "endpoint proxy for the " + bmd.j2eeName.getComponent() +
                                                         " bean in the " + bmd.j2eeName.getModule() +
                                                         " module of the " + bmd.j2eeName.getApplication() +
                                                         " application.", ex);
                    }
                }

                bmd.ivWebServiceEndpointCreated = true;

                // Dump the BeanMetaData now that the endpoint methodinfos are set.
                bmd.dump();
            }
        } // end synchronization                                        d521886

        // -----------------------------------------------------------------------
        // Create a new instance of the generic Web Services Endpoint EJB Wrapper,
        // and initialize it specific to the requested bean type.
        // -----------------------------------------------------------------------

        WSEJBWrapper wrapper = new WSEJBWrapper();

        wrapper.container = this;
        wrapper.wrapperManager = wrapperManager;
        wrapper.ivCommon = null; // Not cached
        wrapper.isManagedWrapper = false; // Not managed
        wrapper.ivInterface = WrapperInterface.SERVICE_ENDPOINT;

        // Now, fill in the home specific information.
        wrapper.beanId = home.ivStatelessId;
        wrapper.bmd = bmd;
        wrapper.methodInfos = bmd.wsEndpointMethodInfos;
        wrapper.methodNames = bmd.wsEndpointMethodNames;
        wrapper.isolationAttrs = null; // not used for EJB 2.x
        wrapper.ivPmiBean = home.pmiBean;

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "createWebServiceEndpointManager : " + wrapper);

        return wrapper;
    }
721859
public static InetSocketAddress getInetSocketAddress(String endpoint) {
    String[] array = endpoint.split(":");
    return new InetSocketAddress(array[0], Integer.parseInt(array[1]));
  }
1304325
private void parseServerHeader(Map<Object, Object> props) {
        // @PK15848
        String value = getProp(props, HttpConfigConstants.PROPNAME_SERVER_HEADER_VALUE);
        if (null == value || "".equals(value)) {
            // due to security change, do not default value in Server header. // PM87013 Start
        } else {
            if ("DefaultServerVersion".equalsIgnoreCase(value)) {
                value = "WebSphere Application Server";
            }
            this.baServerHeaderValue = GenericUtils.getEnglishBytes(value);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "Config: server header value [" + value + "]");
            }
        }
        // PM87013 (PM75371) End

        Object ov = props.get(HttpConfigConstants.PROPNAME_REMOVE_SERVER_HEADER);
        if (null != ov) {
            this.bRemoveServerHeader = convertBoolean(ov);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "Config: remove server header is " + removeServerHeader());
            }
        }
    }