Package org.springframework.http.client.support

# Class ProxyFactoryBean

java.lang.Object
org.springframework.http.client.support.ProxyFactoryBean

All Implemented Interfaces:
  `org.springframework.beans.factory.FactoryBean<Proxy>`, `org.springframework.beans.factory.InitializingBean`

public class ProxyFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean<Proxy>, org.springframework.beans.factory.InitializingBean
`FactoryBean` that creates a `java.net.Proxy`.

Since:
  3.0.4
Author:
  Arjen Poutsma
See Also:
  - `FactoryBean`
  - `Proxy`

## Field Summary

### Fields inherited from interface org.springframework.beans.factory.FactoryBean

`OBJECT_TYPE_ATTRIBUTE`

## Constructor Summary

Constructors
Constructor
Description
`ProxyFactoryBean()`

## Method Summary

Modifier and Type
Method
Description
`void`
`afterPropertiesSet()`
`Proxy`
`getObject()`
`Class<?>`
`getObjectType()`
`boolean`
`isSingleton()`
`void`
`setHostname(String hostname)`
Set the proxy host name.
`void`
`setPort(int port)`
Set the proxy port.
`void`
`setType(Proxy.Type type)`
Set the proxy type.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ProxyFactoryBean

public ProxyFactoryBean()

## Method Details

### setType

public void setType(Proxy.Type type)
Set the proxy type.

Defaults to `Proxy.Type.HTTP`.

### setHostname

public void setHostname(String hostname)
Set the proxy host name.

### setPort

public void setPort(int port)
Set the proxy port.

### afterPropertiesSet

public void afterPropertiesSet() throws IllegalArgumentException

Specified by:
  `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`
Throws:
  `IllegalArgumentException`

### getObject

@Nullable public Proxy getObject()

Specified by:
  `getObject` in interface `org.springframework.beans.factory.FactoryBean<Proxy>`

### getObjectType

public Class<?> getObjectType()

Specified by:
  `getObjectType` in interface `org.springframework.beans.factory.FactoryBean<Proxy>`

### isSingleton

public boolean isSingleton()

Specified by:
  `isSingleton` in interface `org.springframework.beans.factory.FactoryBean<Proxy>`