/*
(non-Javadoc)
@see javax.servlet.sip.Proxy#setOutboundInterface(java.net.InetAddress)
559342
public void setOutboundInterface(InetAddress inetAddress) {
		if(inetAddress == null) {
			throw new NullPointerException("outbound Interface param shouldn't be null");
		}
		String address = inetAddress.getHostAddress();
		List<SipURI> list = this.sipFactoryImpl.getSipNetworkInterfaceManager().getOutboundInterfaces();
		SipURI networkInterface = null;
		for(SipURI networkInterfaceURI : list) {
			if(networkInterfaceURI.toString().contains(address)) {
				networkInterface = networkInterfaceURI;
				break;
			}
		}
		
		if(networkInterface == null) throw new IllegalArgumentException("Network interface for " +
				inetAddress.getHostAddress() + " not found");
		
		outboundInterface = networkInterface;
	}
143666
public void setIndirectionHandlerClass(Class indirectionHandlerClass)
    {
        if(indirectionHandlerClass == null)
        {
            //throw new MetadataException("No IndirectionHandlerClass specified.");
            /**
             * andrew.clute
             * Allow the default IndirectionHandler for the given ProxyFactory implementation
             * when the parameter is not given
             */
            indirectionHandlerClass = getDefaultIndirectionHandlerClass();
        }
        if(indirectionHandlerClass.isInterface()
                || Modifier.isAbstract(indirectionHandlerClass.getModifiers())
                || !getIndirectionHandlerBaseClass().isAssignableFrom(indirectionHandlerClass))
        {
            throw new MetadataException("Illegal class "
                    + indirectionHandlerClass.getName()
                    + " specified for IndirectionHandlerClass. Must be a concrete subclass of "
                    + getIndirectionHandlerBaseClass().getName());
        }
        _indirectionHandlerClass = indirectionHandlerClass;
    }
312800
public void setInboundPermissions(java.util.Collection<IpPermission> inboundPermissions) {
        if (inboundPermissions == null) {
            this.inboundPermissions = null;
            return;
        }

        this.inboundPermissions = new java.util.ArrayList<IpPermission>(inboundPermissions);
    }
1023203
@Override
    public boolean setAddress(String addr)
    {
        address = new IpcAddress(addr);

        InetSocketAddress sock = (InetSocketAddress) address.address();
        String fake = sock.getAddress().getHostAddress() + ":" + sock.getPort();
        return super.setAddress(fake);
    }
1136816
public void setInternalHeader(String name, String s) {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"setInternalHeader", " name --> " + name + " value --> " + s,"["+this+"]");
        }
        setHeader(name, s, false);
    }
112600
public void setSocketProxy(String host, int port) {
        if (config == null) {
            config = new AipClientConfiguration();
        }
        this.config.setProxy(host, port, Proxy.Type.SOCKS);
    }
1004093
@Override
    public ProxyBuilder<T> setMessagingQos(final MessagingQos messagingQos) {
        if (messagingQos.getRoundTripTtl_ms() > maxMessagingTtl) {
            logger.warn("Error in MessageQos. domains: {} interface: {} Max allowed ttl: {}. Passed ttl: {}",
                        domains,
                        interfaceName,
                        maxMessagingTtl,
                        messagingQos.getRoundTripTtl_ms());
            messagingQos.setTtl_ms(maxMessagingTtl);
        }

        this.messagingQos = messagingQos;
        return this;
    }
1201364
@Override
    public void setConnectionProximity(String newConnectionProximity) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setConnectionProximity", newConnectionProximity);

        // Check for null and empty string, and set to default value if found
        if ((newConnectionProximity == null) || ("".equals(newConnectionProximity))) {
            jcaManagedConnectionFactory.setConnectionProximity(ApiJmsConstants.CONNECTION_PROXIMITY_BUS);
        }
        //ensure that the value is one of the permitted constants - if not throw an exception
        else if ((ApiJmsConstants.CONNECTION_PROXIMITY_BUS.equals(newConnectionProximity))
                 || (ApiJmsConstants.CONNECTION_PROXIMITY_HOST.equals(newConnectionProximity))
                 || (ApiJmsConstants.CONNECTION_PROXIMITY_CLUSTER.equals(newConnectionProximity))
                 || (ApiJmsConstants.CONNECTION_PROXIMITY_SERVER.equals(newConnectionProximity))) {
            jcaManagedConnectionFactory.setConnectionProximity(newConnectionProximity);
        }
        else {
            throw (JMSException) JmsErrorUtils.newThrowable(
                                                            JMSException.class,
                                                            "INVALID_VALUE_CWSIA0261",
                                                            new Object[] { "connectionProximity", newConnectionProximity },
                                                            tc
                            );
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setConnectionProximity");
    }
1373769
@Override
    protected InetAddress isAcceptable(NetworkInterface networkInterface, InetAddress address) throws SocketException {

        try {
            if( networkInterface.isLoopback() ) {
                return getAddress();
            }
        } catch (UnknownHostException e) {
            // One time only log a warning
            if (!unknownHostLogged) {
                MGMT_OP_LOGGER.cannotResolveAddress(this.address);
                unknownHostLogged = true;
            }
        }
        return null;
    }
38508
@Override
    public void setProviderEndpoints(String newProviderEndpoints) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setProviderEndpoints", newProviderEndpoints);
        jcaManagedConnectionFactory.setRemoteServerAddress(newProviderEndpoints);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setProviderEndpoints");
    }
1077151
public void setStandardSocketBindingInterface(String socketBindingName, String interfaceName) throws Exception {
        setStandardSocketBindingInterfaceExpression(socketBindingName, null, interfaceName);
    }
49701
@Override
	public void setProxyHostPort(String hostPort) {
    	int colonIdx = hostPort.indexOf(':');
    	if(colonIdx > 0) {
    		String host = hostPort.substring(0,colonIdx);
    		int port = Integer.valueOf(hostPort.substring(colonIdx+1));
    		
//            http.getHostConfiguration().setProxy(host, port);
    		hostConfiguration.setProxy(host, port);
    	}
    }
701533
public void setNetworkInterface(NetworkInterface netIf)
        throws SocketException {

        synchronized (infLock) {
            getImpl().setOption(SocketOptions.IP_MULTICAST_IF2, netIf);
            infAddress = null;
            interfaceSet = true;
        }
    }
1308635
@Override
   public void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation)
   {
      final Object _targetBean = this.getTargetBean(invocation);
      // TODO: refactor injection to AS IL
      final Reference reference = endpoint.getInstanceProvider().getInstance(_targetBean.getClass().getName());
      final Object targetBean = reference.getValue();

      InjectionHelper.injectWebServiceContext(targetBean, ThreadLocalAwareWebServiceContext.getInstance());

      if (!reference.isInitialized())
      {
         InjectionHelper.callPostConstructMethod(targetBean);
         reference.setInitialized();
      }

      endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
   }
89168
public void setInvocationHandler(Object proxy, InvocationHandler handler) {
        Field field = getInvocationHandlerField();
        try {
            field.set(proxy, handler);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
1350372
public void setProxy(String proxyHost, int proxyPort) {
        System.setProperty("http.proxySet", "true");
        System.setProperty("http.proxyHost", proxyHost);
        System.setProperty("http.proxyPort", "" + proxyPort);
        System.setProperty("https.proxyHost", proxyHost);
        System.setProperty("https.proxyPort", "" + proxyPort);
    }
1207623
protected <T extends ConnectFuture> ConnectFuture connectInternal(final ResourceAddress address, final IoHandler handler, final IoSessionInitializer<T> initializer) {
        // TODO: throw exception if address contains more then one resource
        ResourceAddress transport = address.getTransport();
        if (transport != null) {
            return getTransportConnectFuture(address, handler, initializer, transport);
        }

        final URI resource = address.getResource();
        final InetSocketAddress inetAddress = new InetSocketAddress(resource.getHost(), resource.getPort());
        if (logger.isTraceEnabled()) {
        	logger.trace(format("AbstractNioConnector.connectInternal(), resource: %s", resource));
        }

        // KG-1452: Avoid deadlock between dispose and connectInternal
        IoConnector connector = this.connectorReference.get();
        if (connector == null) {
            return DefaultConnectFuture.newFailedFuture(new IllegalStateException("Connector is being shut down"));
        }

        final String nextProtocol = address.getOption(ResourceAddress.NEXT_PROTOCOL);
        ConnectFuture future = connector.connect(inetAddress, new IoSessionInitializer<T>() {
            @Override
            public void initializeSession(IoSession session, T future) {
                if (logger.isTraceEnabled()) {
                    logger.trace(format("AbstractNioConnector.connectInternal()$initializeSession(), session: %s, resource: %s", session, resource));
                }
                registerConnectFilters(address, session);
                // connectors don't need lookup so set this directly on the session
                session.setAttribute(BridgeConnectHandler.DELEGATE_KEY, handler);
                // Currrently, the underlying TCP session has the remote
                // address being an InetSocketAddress.  Our top-level
                // ResourceAddress has more information than just that
                // remote InetSocketAddress -- so we set that as the
                // remote address in the created session.
                REMOTE_ADDRESS.set(session, address);
                LOCAL_ADDRESS.set(session, createResourceAddress(inetAddress, nextProtocol));
                if (initializer != null) {
                    initializer.initializeSession(session, future);
                }
            }
        });
        future.addListener(new IoFutureListener<ConnectFuture>() {
            @Override
            public void operationComplete(ConnectFuture future) {
                if (future.isConnected()) {
                    IoSession session = future.getSession();
                    SocketAddress localAddress = session.getLocalAddress();
                    if (localAddress instanceof InetSocketAddress) {
                        InetSocketAddress inetSocketAddress = (InetSocketAddress) localAddress;
                        ResourceAddress resourceAddress = createResourceAddress(inetSocketAddress, nextProtocol);
                        LOCAL_ADDRESS.set(session, resourceAddress);
                    }
                    else if (localAddress instanceof NamedPipeAddress) {
                        NamedPipeAddress namedPipeAddress = (NamedPipeAddress) localAddress;
                        ResourceAddress resourceAddress = createResourceAddress(namedPipeAddress, nextProtocol);
                        LOCAL_ADDRESS.set(session, resourceAddress);
                    }
                }
            }
        });
        return future;
    }