text stringlengths 81 467k |
|---|
Bind indexed elements to the supplied collection.
@param name the name of the property to bind
@param target the target bindable
@param elementBinder the binder to use for elements
@param aggregateType the aggregate type, may be a collection or an array
@param elementType the element type
@param result the destination ... |
Set {@link ServletRegistrationBean}s that the filter will be registered against.
@param servletRegistrationBeans the Servlet registration beans
public void setServletRegistrationBeans(
Collection<? extends ServletRegistrationBean<?>> servletRegistrationBeans) {
Assert.notNull(servletRegistrationBeans,
"Servle... |
Add {@link ServletRegistrationBean}s for the filter.
@param servletRegistrationBeans the servlet registration beans to add
@see #setServletRegistrationBeans
public void addServletRegistrationBeans(
ServletRegistrationBean<?>... servletRegistrationBeans) {
Assert.notNull(servletRegistrationBeans,
"ServletRegis... |
Set servlet names that the filter will be registered against. This will replace any
previously specified servlet names.
@param servletNames the servlet names
@see #setServletRegistrationBeans
@see #setUrlPatterns
public void setServletNames(Collection<String> servletNames) {
Assert.notNull(servletNames, "ServletName... |
Add servlet names for the filter.
@param servletNames the servlet names to add
public void addServletNames(String... servletNames) {
Assert.notNull(servletNames, "ServletNames must not be null");
this.servletNames.addAll(Arrays.asList(servletNames));
} |
Set the URL patterns that the filter will be registered against. This will replace
any previously specified URL patterns.
@param urlPatterns the URL patterns
@see #setServletRegistrationBeans
@see #setServletNames
public void setUrlPatterns(Collection<String> urlPatterns) {
Assert.notNull(urlPatterns, "UrlPatterns m... |
Add URL patterns, as defined in the Servlet specification, that the filter will be
registered against.
@param urlPatterns the URL patterns
public void addUrlPatterns(String... urlPatterns) {
Assert.notNull(urlPatterns, "UrlPatterns must not be null");
Collections.addAll(this.urlPatterns, urlPatterns);
} |
Convenience method to {@link #setDispatcherTypes(EnumSet) set dispatcher types}
using the specified elements.
@param first the first dispatcher type
@param rest additional dispatcher types
public void setDispatcherTypes(DispatcherType first, DispatcherType... rest) {
this.dispatcherTypes = EnumSet.of(first, rest);
... |
Configure registration settings. Subclasses can override this method to perform
additional configuration if required.
@param registration the registration
@Override
protected void configure(FilterRegistration.Dynamic registration) {
super.configure(registration);
EnumSet<DispatcherType> dispatcherTypes = this.dis... |
Create a nested {@link DependencyCustomizer} that only applies if any of the
specified class names are not on the class path.
@param classNames the class names to test
@return a nested {@link DependencyCustomizer}
public DependencyCustomizer ifAnyMissingClasses(String... classNames) {
return new DependencyCustomizer... |
Create a nested {@link DependencyCustomizer} that only applies if all of the
specified class names are not on the class path.
@param classNames the class names to test
@return a nested {@link DependencyCustomizer}
public DependencyCustomizer ifAllMissingClasses(String... classNames) {
return new DependencyCustomizer... |
Create a nested {@link DependencyCustomizer} that only applies if the specified
paths are on the class path.
@param paths the paths to test
@return a nested {@link DependencyCustomizer}
public DependencyCustomizer ifAllResourcesPresent(String... paths) {
return new DependencyCustomizer(this) {
@Override
protec... |
Add dependencies and all of their dependencies. The group ID and version of the
dependencies are resolved from the modules using the customizer's
{@link ArtifactCoordinatesResolver}.
@param modules the module IDs
@return this {@link DependencyCustomizer} for continued use
public DependencyCustomizer add(String... modu... |
Add a single dependency and, optionally, all of its dependencies. The group ID and
version of the dependency are resolved from the module using the customizer's
{@link ArtifactCoordinatesResolver}.
@param module the module ID
@param transitive {@code true} if the transitive dependencies should also be added,
otherwise ... |
Add a single dependency with the specified classifier and type and, optionally, all
of its dependencies. The group ID and version of the dependency are resolved from
the module by using the customizer's {@link ArtifactCoordinatesResolver}.
@param module the module ID
@param classifier the classifier, may be {@code null... |
Create a {@link ReactiveHealthIndicatorRegistry} based on the specified health
indicators. Each {@link HealthIndicator} are wrapped to a
{@link HealthIndicatorReactiveAdapter}. If two instances share the same name, the
reactive variant takes precedence.
@param reactiveHealthIndicators the {@link ReactiveHealthIndicator... |
Parse the source data, triggering {@link CentralDirectoryVisitor visitors}.
@param data the source data
@param skipPrefixBytes if prefix bytes should be skipped
@return the actual archive data without any prefix bytes
@throws IOException on error
public RandomAccessData parse(RandomAccessData data, boolean skipPrefixB... |
Get the value from the properties or use a fallback from the {@code defaults}.
@param getter the getter for the properties
@param fallback the fallback method, usually super interface method reference
@param <V> the value type
@return the property or fallback value
protected final <V> V get(Function<T, V> getter, Supp... |
Return a sub-directory of the application temp.
@param subDir the sub-directory name
@return a sub-directory
public File getDir(String subDir) {
File dir = new File(getDir(), subDir);
dir.mkdirs();
return dir;
} |
Return the directory to be used for application specific temp files.
@return the application temp directory
public File getDir() {
if (this.dir == null) {
synchronized (this) {
byte[] hash = generateHash(this.sourceClass);
this.dir = new File(getTempDirectory(), toHexString(hash));
this.dir.mkdirs();
... |
Extract the content to contribute to the info endpoint.
@return the content to expose
@see #extractContent(PropertySource)
@see #postProcessContent(Map)
protected Map<String, Object> generateContent() {
Map<String, Object> content = extractContent(toPropertySource());
postProcessContent(content);
return content;... |
Extract the raw content based on the specified {@link PropertySource}.
@param propertySource the property source to use
@return the raw content
protected Map<String, Object> extractContent(PropertySource<?> propertySource) {
return new Binder(ConfigurationPropertySources.from(propertySource))
.bind("", STRING_OB... |
Copy the specified key to the target {@link Properties} if it is set.
@param target the target properties to update
@param key the key
protected void copyIfSet(Properties target, String key) {
String value = this.properties.get(key);
if (StringUtils.hasText(value)) {
target.put(key, value);
}
} |
Replace the {@code value} for the specified key if the value is not {@code null}.
@param content the content to expose
@param key the property to replace
@param value the new value
protected void replaceValue(Map<String, Object> content, String key, Object value) {
if (content.containsKey(key) && value != null) {
... |
Return the nested map with the specified key or empty map if the specified map
contains no mapping for the key.
@param map the content
@param key the key of a nested map
@return the nested map
@SuppressWarnings("unchecked")
protected Map<String, Object> getNestedMap(Map<String, Object> map, String key) {
Object val... |
Return the {@link Health} of a particular component or {@code null} if such
component does not exist.
@param component the name of a particular {@link HealthIndicator}
@return the {@link Health} for the component or {@code null}
@ReadOperation
public Health healthForComponent(@Selector String component) {
HealthInd... |
Return the {@link Health} of a particular {@code instance} managed by the specified
{@code component} or {@code null} if that particular component is not a
{@link CompositeHealthIndicator} or if such instance does not exist.
@param component the name of a particular {@link CompositeHealthIndicator}
@param instance the ... |
Return a new {@link MeterValue} instance for the given String value. The value may
contain a simple number, or a {@link DurationStyle duration style string}.
@param value the source value
@return a {@link MeterValue} instance
public static MeterValue valueOf(String value) {
if (isNumber(value)) {
return new Meter... |
Start a call to a single callback instance, dealing with common generic type
concerns and exceptions.
@param callbackType the callback type (a {@link FunctionalInterface functional
interface})
@param callbackInstance the callback instance (may be a lambda)
@param argument the primary argument passed to the callback
@pa... |
Start a call to callback instances, dealing with common generic type concerns and
exceptions.
@param callbackType the callback type (a {@link FunctionalInterface functional
interface})
@param callbackInstances the callback instances (elements may be lambdas)
@param argument the primary argument passed to the callbacks
... |
Invoke the callback instances where the callback method returns a result.
@param invoker the invoker used to invoke the callback
@param <R> the result type
@return the results of the invocation (may be an empty stream if no callbacks
could be called)
public <R> Stream<R> invokeAnd(Function<C, R> invoker) {
Function... |
Start the livereload server and accept incoming connections.
@return the port on which the server is listening
@throws IOException in case of I/O errors
public int start() throws IOException {
synchronized (this.monitor) {
Assert.state(!isStarted(), "Server already started");
logger.debug("Starting live reload... |
Gracefully stop the livereload server.
@throws IOException in case of I/O errors
public void stop() throws IOException {
synchronized (this.monitor) {
if (this.listenThread != null) {
closeAllConnections();
try {
this.executor.shutdown();
this.executor.awaitTermination(1, TimeUnit.MINUTES);
... |
Trigger livereload of all connected clients.
public void triggerReload() {
synchronized (this.monitor) {
synchronized (this.connections) {
for (Connection connection : this.connections) {
try {
connection.triggerReload();
}
catch (Exception ex) {
logger.debug("Unable to send reload ... |
Factory method used to create the {@link Connection}.
@param socket the source socket
@param inputStream the socket input stream
@param outputStream the socket output stream
@return a connection
@throws IOException in case of I/O errors
protected Connection createConnection(Socket socket, InputStream inputStream,
O... |
Create an application context (and its parent if specified) with the command line
args provided. The parent is run first with the same arguments if has not yet been
started.
@param args the command line arguments
@return an application context created from the current state
public ConfigurableApplicationContext run(St... |
Returns a fully configured {@link SpringApplication} that is ready to run. Any
parent that has been configured will be run with the given {@code args}.
@param args the parent's args
@return the fully configured {@link SpringApplication}.
public SpringApplication build(String... args) {
configureAsChildIfNecessary(ar... |
Create a child application with the provided sources. Default args and environment
are copied down into the child, but everything else is a clean sheet.
@param sources the sources for the application (Spring configuration)
@return the child application builder
public SpringApplicationBuilder child(Class<?>... sources)... |
Add a parent application with the provided sources. Default args and environment
are copied up into the parent, but everything else is a clean sheet.
@param sources the sources for the application (Spring configuration)
@return the parent builder
public SpringApplicationBuilder parent(Class<?>... sources) {
if (this... |
Add an already running parent context to an existing application.
@param parent the parent context
@return the current builder (not the parent)
public SpringApplicationBuilder parent(ConfigurableApplicationContext parent) {
this.parent = new SpringApplicationBuilder();
this.parent.context = parent;
this.parent.r... |
Create a sibling application (one with the same parent). A side effect of calling
this method is that the current application (and its parent) are started if they
are not already running.
@param sources the sources for the application (Spring configuration)
@param args the command line arguments to use when starting th... |
Add more sources (configuration classes and components) to this application.
@param sources the sources to add
@return the current builder
public SpringApplicationBuilder sources(Class<?>... sources) {
this.sources.addAll(new LinkedHashSet<>(Arrays.asList(sources)));
return this;
} |
Default properties for the environment. Multiple calls to this method are
cumulative.
@param defaults the default properties
@return the current builder
@see SpringApplicationBuilder#properties(String...)
public SpringApplicationBuilder properties(Map<String, Object> defaults) {
this.defaultProperties.putAll(default... |
Add to the active Spring profiles for this app (and its parent and children).
@param profiles the profiles to add.
@return the current builder
public SpringApplicationBuilder profiles(String... profiles) {
this.additionalProfiles.addAll(Arrays.asList(profiles));
this.application.setAdditionalProfiles(
StringUt... |
Return a shared default application {@code ConversionService} instance, lazily
building it once needed.
<p>
Note: This method actually returns an {@link ApplicationConversionService}
instance. However, the {@code ConversionService} signature has been preserved for
binary compatibility.
@return the shared {@code Applica... |
Configure the given {@link FormatterRegistry} with formatters and converters
appropriate for most Spring Boot applications.
@param registry the registry of converters to add to (must also be castable to
ConversionService, e.g. being a {@link ConfigurableConversionService})
@throws ClassCastException if the given Format... |
Add converters useful for most Spring Boot applications.
@param registry the registry of converters to add to (must also be castable to
ConversionService, e.g. being a {@link ConfigurableConversionService})
@throws ClassCastException if the given ConverterRegistry could not be cast to a
ConversionService
public static... |
Add converters to support delimited strings.
@param registry the registry of converters to add to (must also be castable to
ConversionService, e.g. being a {@link ConfigurableConversionService})
@throws ClassCastException if the given ConverterRegistry could not be cast to a
ConversionService
public static void addDel... |
Add formatters useful for most Spring Boot applications.
@param registry the service to register default formatters with
public static void addApplicationFormatters(FormatterRegistry registry) {
registry.addFormatter(new CharArrayFormatter());
registry.addFormatter(new InetAddressFormatter());
registry.addFormat... |
Set {@link ServerRSocketFactoryCustomizer}s that should be applied to the RSocket
server builder. Calling this method will replace any existing customizers.
@param serverCustomizers the customizers to set
public void setServerCustomizers(
Collection<? extends ServerRSocketFactoryCustomizer> serverCustomizers) {
A... |
Add {@link ServerRSocketFactoryCustomizer}s that should applied while building the
server.
@param serverCustomizers the customizers to add
public void addServerCustomizers(
ServerRSocketFactoryCustomizer... serverCustomizers) {
Assert.notNull(serverCustomizers, "ServerCustomizer must not be null");
this.serverC... |
Create a new {@link MultipartConfigElement} instance.
@return the multipart config element
public MultipartConfigElement createMultipartConfig() {
long maxFileSizeBytes = convertToBytes(this.maxFileSize, -1);
long maxRequestSizeBytes = convertToBytes(this.maxRequestSize, -1);
long fileSizeThresholdBytes = conver... |
Return the amount of bytes from the specified {@link DataSize size}. If the size is
{@code null} or negative, returns {@code defaultValue}.
@param size the data size to handle
@param defaultValue the default value if the size is {@code null} or negative
@return the amount of bytes to use
private long convertToBytes(Da... |
Initialize a {@link DataSourceBuilder} with the state of this instance.
@return a {@link DataSourceBuilder} initialized with the customizations defined on
this instance
public DataSourceBuilder<?> initializeDataSourceBuilder() {
return DataSourceBuilder.create(getClassLoader()).type(getType())
.driverClassName(d... |
Determine the driver to use based on this configuration and the environment.
@return the driver to use
@since 1.4.0
public String determineDriverClassName() {
if (StringUtils.hasText(this.driverClassName)) {
Assert.state(driverClassIsLoadable(),
() -> "Cannot load driver class: " + this.driverClassName);
... |
Determine the url to use based on this configuration and the environment.
@return the url to use
@since 1.4.0
public String determineUrl() {
if (StringUtils.hasText(this.url)) {
return this.url;
}
String databaseName = determineDatabaseName();
String url = (databaseName != null)
? this.embeddedDatabaseC... |
Determine the name to used based on this configuration.
@return the database name to use or {@code null}
@since 2.0.0
public String determineDatabaseName() {
if (this.generateUniqueName) {
if (this.uniqueName == null) {
this.uniqueName = UUID.randomUUID().toString();
}
return this.uniqueName;
}
if (... |
Determine the username to use based on this configuration and the environment.
@return the username to use
@since 1.4.0
public String determineUsername() {
if (StringUtils.hasText(this.username)) {
return this.username;
}
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName())) {
return "sa";... |
Determine the password to use based on this configuration and the environment.
@return the password to use
@since 1.4.0
public String determinePassword() {
if (StringUtils.hasText(this.password)) {
return this.password;
}
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName())) {
return "";
... |
Helper method to extract a value from the given {@code jsonNode} or return
{@code null} when the node itself is {@code null}.
@param jsonNode the source node (may be {@code null})
@param type the data type. May be {@link String}, {@link Boolean}, {@link Long},
{@link Integer}, {@link Short}, {@link Double}, {@link Floa... |
Helper method to return a {@link JsonNode} from the tree.
@param tree the source tree
@param fieldName the field name to extract
@return the {@link JsonNode}
protected final JsonNode getRequiredNode(JsonNode tree, String fieldName) {
Assert.notNull(tree, "Tree must not be null");
JsonNode node = tree.get(fieldName... |
Create a {@link JmsPoolConnectionFactory} based on the specified
{@link ConnectionFactory}.
@param connectionFactory the connection factory to wrap
@return a pooled connection factory
public JmsPoolConnectionFactory createPooledConnectionFactory(
ConnectionFactory connectionFactory) {
JmsPoolConnectionFactory poo... |
Generate a project based on the specified {@link ProjectGenerationRequest}.
@param request the generation request
@return an entity defining the project
@throws IOException if generation fails
public ProjectGenerationResponse generate(ProjectGenerationRequest request)
throws IOException {
Log.info("Using service ... |
Load the {@link InitializrServiceMetadata} at the specified url.
@param serviceUrl to url of the initializer service
@return the metadata describing the service
@throws IOException if the service's metadata cannot be loaded
public InitializrServiceMetadata loadMetadata(String serviceUrl) throws IOException {
Closeab... |
Loads the service capabilities of the service at the specified URL. If the service
supports generating a textual representation of the capabilities, it is returned,
otherwise {@link InitializrServiceMetadata} is returned.
@param serviceUrl to url of the initializer service
@return the service capabilities (as a String)... |
Retrieves the meta-data of the service at the specified URL.
@param url the URL
@return the response
private CloseableHttpResponse executeInitializrMetadataRetrieval(String url) {
HttpGet request = new HttpGet(url);
request.setHeader(new BasicHeader(HttpHeaders.ACCEPT, ACCEPT_META_DATA));
return execute(request,... |
Analyse the {@link ConfigurableEnvironment environment} and attempt to rename
legacy properties if a replacement exists.
@return a report of the migration
public PropertiesMigrationReport getReport() {
PropertiesMigrationReport report = new PropertiesMigrationReport();
Map<String, List<PropertyMigration>> properti... |
Creates {@link Resource Resources} for the operations of the given
{@code webEndpoints}.
@param endpointMapping the base mapping for all endpoints
@param endpoints the web endpoints
@param endpointMediaTypes media types consumed and produced by the endpoints
@param linksResolver resolver for determining links to availa... |
Returns a matcher that includes the specified {@link StaticResourceLocation
Locations}. For example: <pre class="code">
PathRequest.toStaticResources().at(StaticResourceLocation.CSS, StaticResourceLocation.JAVA_SCRIPT)
</pre>
@param first the first location to include
@param rest additional locations to include
@return... |
Returns a matcher that includes the specified {@link StaticResourceLocation
Locations}. For example: <pre class="code">
PathRequest.toStaticResources().at(locations)
</pre>
@param locations the locations to include
@return the configured {@link ServerWebExchangeMatcher}
public StaticResourceServerWebExchange at(Set<St... |
Converts the given {@code environment} to the given {@link StandardEnvironment}
type. If the environment is already of the same type, no conversion is performed
and it is returned unchanged.
@param environment the Environment to convert
@param type the type to convert the Environment to
@return the converted Environmen... |
Return the names of beans matching the given type (including subclasses), judging
from either bean definitions or the value of {@link FactoryBean#getObjectType()} in
the case of {@link FactoryBean FactoryBeans}. Will include singletons but will not
cause early bean initialization.
@param type the class or interface to ... |
Customize the specified {@link CacheManager}. Locates all
{@link CacheManagerCustomizer} beans able to handle the specified instance and
invoke {@link CacheManagerCustomizer#customize(CacheManager)} on them.
@param <T> the type of cache manager
@param cacheManager the cache manager to customize
@return the cache manage... |
Compile and run the application.
@throws Exception on error
public void compileAndRun() throws Exception {
synchronized (this.monitor) {
try {
stop();
Class<?>[] compiledSources = compile();
monitorForChanges();
// Run in new thread to ensure that the context classloader is setup
this.runThrea... |
Generates the URI to use to generate a project represented by this request.
@param metadata the metadata that describes the service
@return the project generation URI
URI generateUrl(InitializrServiceMetadata metadata) {
try {
URIBuilder builder = new URIBuilder(this.serviceUrl);
StringBuilder sb = new StringB... |
Resolve the artifactId to use or {@code null} if it should not be customized.
@return the artifactId
protected String resolveArtifactId() {
if (this.artifactId != null) {
return this.artifactId;
}
if (this.output != null) {
int i = this.output.lastIndexOf('.');
return (i != -1) ? this.output.substring(0... |
Return true if any of the specified conditions match.
@param context the context
@param metadata the annotation meta-data
@param conditions conditions to test
@return {@code true} if any condition matches.
protected final boolean anyMatches(ConditionContext context,
AnnotatedTypeMetadata metadata, Condition... cond... |
Return true if any of the specified condition matches.
@param context the context
@param metadata the annotation meta-data
@param condition condition to test
@return {@code true} if the condition matches.
protected final boolean matches(ConditionContext context,
AnnotatedTypeMetadata metadata, Condition condition) ... |
Check if the exception is a log configuration message, i.e. the log call might not
have actually output anything.
@param ex the source exception
@return {@code true} if the exception contains a log configuration message
private boolean isLogConfigurationMessage(Throwable ex) {
if (ex instanceof InvocationTargetExcep... |
Handle a single exception in the chain. SQLExceptions might be nested multiple
levels deep. The outermost exception is usually the least interesting one ("Call
getNextException to see the cause."). Therefore the innermost exception is
propagated and all other exceptions are logged.
@param context the execute context
@p... |
Set the maximum time the executor is supposed to block on shutdown. When set, the
executor blocks on shutdown in order to wait for remaining tasks to complete their
execution before the rest of the container continues to shut down. This is
particularly useful if your remaining tasks are likely to need access to other
r... |
Set the prefix to use for the names of newly created threads.
@param threadNamePrefix the thread name prefix to set
@return a new builder instance
public TaskSchedulerBuilder threadNamePrefix(String threadNamePrefix) {
return new TaskSchedulerBuilder(this.poolSize, this.awaitTermination,
this.awaitTerminationPer... |
Set the {@link TaskSchedulerCustomizer TaskSchedulerCustomizers} that should be
applied to the {@link ThreadPoolTaskScheduler}. Customizers are applied in the
order that they were added after builder configuration has been applied. Setting
this value will replace any previously configured customizers.
@param customizer... |
Set the {@link TaskSchedulerCustomizer taskSchedulerCustomizers} that should be
applied to the {@link ThreadPoolTaskScheduler}. Customizers are applied in the
order that they were added after builder configuration has been applied. Setting
this value will replace any previously configured customizers.
@param customizer... |
Add {@link TaskSchedulerCustomizer taskSchedulerCustomizers} that should be applied
to the {@link ThreadPoolTaskScheduler}. Customizers are applied in the order that
they were added after builder configuration has been applied.
@param customizers the customizers to add
@return a new builder instance
@see #customizers(T... |
Configure the provided {@link ThreadPoolTaskScheduler} instance using this builder.
@param <T> the type of task scheduler
@param taskScheduler the {@link ThreadPoolTaskScheduler} to configure
@return the task scheduler instance
@see #build()
public <T extends ThreadPoolTaskScheduler> T configure(T taskScheduler) {
P... |
Detect and return the logging system in use. Supports Logback and Java Logging.
@param classLoader the classloader
@return the logging system
public static LoggingSystem get(ClassLoader classLoader) {
String loggingSystem = System.getProperty(SYSTEM_PROPERTY);
if (StringUtils.hasLength(loggingSystem)) {
if (NON... |
Add listener for file change events. Cannot be called after the watcher has been
{@link #start() started}.
@param fileChangeListener the listener to add
public void addListener(FileChangeListener fileChangeListener) {
Assert.notNull(fileChangeListener, "FileChangeListener must not be null");
synchronized (this.mon... |
Add source folders to monitor. Cannot be called after the watcher has been
{@link #start() started}.
@param folders the folders to monitor
public void addSourceFolders(Iterable<File> folders) {
Assert.notNull(folders, "Folders must not be null");
synchronized (this.monitor) {
for (File folder : folders) {
a... |
Add a source folder to monitor. Cannot be called after the watcher has been
{@link #start() started}.
@param folder the folder to monitor
public void addSourceFolder(File folder) {
Assert.notNull(folder, "Folder must not be null");
Assert.isTrue(!folder.isFile(), "Folder '" + folder + "' must not be a file");
sy... |
Start monitoring the source folder for changes.
public void start() {
synchronized (this.monitor) {
saveInitialSnapshots();
if (this.watchThread == null) {
Map<File, FolderSnapshot> localFolders = new HashMap<>();
localFolders.putAll(this.folders);
this.watchThread = new Thread(new Watcher(this.rem... |
Stop monitoring the source folders.
@param remainingScans the number of remaining scans
void stopAfter(int remainingScans) {
Thread thread;
synchronized (this.monitor) {
thread = this.watchThread;
if (thread != null) {
this.remainingScans.set(remainingScans);
if (remainingScans <= 0) {
thread.in... |
Extract the error attributes from the current request, to be used to populate error
views or JSON payloads.
@param request the source request
@param includeStackTrace whether to include the error stacktrace information
@return the error attributes as a Map.
protected Map<String, Object> getErrorAttributes(ServerReques... |
Check whether the trace attribute has been set on the given request.
@param request the source request
@return {@code true} if the error trace has been requested, {@code false} otherwise
protected boolean isTraceEnabled(ServerRequest request) {
String parameter = request.queryParam("trace").orElse("false");
return... |
Render the given error data as a view, using a template view if available or a
static HTML file if available otherwise. This will return an empty
{@code Publisher} if none of the above are available.
@param viewName the view name
@param responseBody the error response being built
@param error the error data as a map
@r... |
Render a default HTML "Whitelabel Error Page".
<p>
Useful when no other error view is available in the application.
@param responseBody the error response being built
@param error the error data as a map
@return a Publisher of the {@link ServerResponse}
protected Mono<ServerResponse> renderDefaultErrorView(
ServerR... |
Read the HTTP header from the {@link InputStream}. Note: This method doesn't expect
any HTTP content after the header since the initial request is usually just a
WebSocket upgrade.
@return the HTTP header
@throws IOException in case of I/O errors
public String readHeader() throws IOException {
byte[] buffer = new by... |
Repeatedly read the underlying {@link InputStream} until the requested number of
bytes have been loaded.
@param buffer the destination buffer
@param offset the buffer offset
@param length the amount of data to read
@throws IOException in case of I/O errors
public void readFully(byte[] buffer, int offset, int length) t... |
Read a number of bytes from the stream (checking that the end of the stream hasn't
been reached).
@param buffer the destination buffer
@param offset the buffer offset
@param length the length to read
@return the amount of data read
@throws IOException in case of I/O errors
public int checkedRead(byte[] buffer, int off... |
Get the name of an {@link EntityManagerFactory} based on its {@code beanName}.
@param beanName the name of the {@link EntityManagerFactory} bean
@return a name for the given entity manager factory
private String getEntityManagerFactoryName(String beanName) {
if (beanName.length() > ENTITY_MANAGER_FACTORY_SUFFIX.leng... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 5