Top Description Fields Constructors Methods
org.springframework.http.client.reactive

public Class JettyResourceFactory

extends Object
implements InitializingBean, DisposableBean
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean
Imports
java.nio.ByteBuffer, java.util.concurrent.Executor, org.eclipse.jetty.io.ArrayByteBufferPool, .ByteBufferPool, org.eclipse.jetty.util.ProcessorUtils, org.eclipse.jetty.util.component.LifeCycle, org.eclipse.jetty.util.thread.QueuedThreadPool, .ScheduledExecutorScheduler, .Scheduler, .ThreadPool, org.springframework.beans.factory.DisposableBean, .InitializingBean, org.springframework.lang.Nullable, org.springframework.util.Assert

Factory to manage Jetty resources, i.e. Executor, ByteBufferPool and Scheduler, within the lifecycle of a Spring ApplicationContext.

This factory implements InitializingBean and DisposableBean and is expected typically to be declared as a Spring-managed bean.

Author
Sebastien Deleuze
Since
5.1

Field Summary

Modifier and TypeField and Description
private ByteBufferPool
private Executor
private Scheduler
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
afterPropertiesSet()

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

public void
destroy()

Implements org.springframework.beans.factory.DisposableBean.destroy.

Invoked by the containing BeanFactory on destruction of a bean.

public ByteBufferPool
getByteBufferPool()

Return the configured ByteBufferPool.

public Executor
getExecutor()

Return the configured Executor.

public Scheduler
getScheduler()

Return the configured Scheduler.

public void
setByteBufferPool(ByteBufferPool
the ByteBuffer pool to use
byteBufferPool
)

Configure the ByteBufferPool to use.

public void
setExecutor(Executor
the executor to use
executor
)

Configure the Executor to use.

public void
setScheduler(Scheduler
the Scheduler to use
scheduler
)

Configure the Scheduler to use.

public void
setThreadPrefix(String
the thread prefix to use
threadPrefix
)

Configure the thread prefix to initialize QueuedThreadPool executor with.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

byteBufferPoolback to summary
private ByteBufferPool byteBufferPool
Annotations
@Nullable
executorback to summary
private Executor executor
Annotations
@Nullable
schedulerback to summary
private Scheduler scheduler
Annotations
@Nullable
threadPrefixback to summary
private String threadPrefix

Constructor Detail

JettyResourceFactoryback to summary
public JettyResourceFactory()

Method Detail

afterPropertiesSetback to summary
public void afterPropertiesSet() throws Exception

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Doc from org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

Annotations
@Override
Exceptions
Exception:
in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
destroyback to summary
public void destroy() throws Exception

Implements org.springframework.beans.factory.DisposableBean.destroy.

Doc from org.springframework.beans.factory.DisposableBean.destroy.

Invoked by the containing BeanFactory on destruction of a bean.

Annotations
@Override
Exceptions
Exception:
in case of shutdown errors. Exceptions will get logged but not rethrown to allow other beans to release their resources as well.
getByteBufferPoolback to summary
public ByteBufferPool getByteBufferPool()

Return the configured ByteBufferPool.

Annotations
@Nullable
getExecutorback to summary
public Executor getExecutor()

Return the configured Executor.

Annotations
@Nullable
getSchedulerback to summary
public Scheduler getScheduler()

Return the configured Scheduler.

Annotations
@Nullable
setByteBufferPoolback to summary
public void setByteBufferPool(ByteBufferPool byteBufferPool)

Configure the ByteBufferPool to use.

By default, initialized with a ArrayByteBufferPool.

Parameters
byteBufferPool:ByteBufferPool

the ByteBuffer pool to use

setExecutorback to summary
public void setExecutor(Executor executor)

Configure the Executor to use.

By default, initialized with a QueuedThreadPool.

Parameters
executor:Executor

the executor to use

setSchedulerback to summary
public void setScheduler(Scheduler scheduler)

Configure the Scheduler to use.

By default, initialized with a ScheduledExecutorScheduler.

Parameters
scheduler:Scheduler

the Scheduler to use

setThreadPrefixback to summary
public void setThreadPrefix(String threadPrefix)

Configure the thread prefix to initialize QueuedThreadPool executor with. This is used only when a Executor instance isn't provided.

By default set to "jetty-http".

Parameters
threadPrefix:String

the thread prefix to use