### start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jms/connection/SingleConnectionFactory.html Initialize the underlying shared connection on start. ```APIDOC ## start ### Description Initialize the underlying shared connection on start. ### Method Signature `void start()` ``` -------------------------------- ### start() Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/socket/sockjs/client/SockJsClient.html Starts the SockJsClient component. ```APIDOC ## start() ### Description Start this component. ``` -------------------------------- ### start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/socket/sockjs/transport/handler/WebSocketTransportHandler.html Starts this component. ```APIDOC ## void start() ### Description Initiates the startup sequence for this component. ``` -------------------------------- ### start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/socket/sockjs/transport/handler/WebSocketTransportHandler.html Starts the component. Should not throw an exception if already running. ```APIDOC ## start ### Description Starts this component. This method should not throw an exception if the component is already running. In a container context, this propagates a start signal to all applicable components. ### Signature `public void start()` ``` -------------------------------- ### Method: start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/socket/server/support/WebSocketHandlerMapping.html Starts this component. ```APIDOC ## Method start ### Description Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate a hard start signal to all components that apply, even to non-auto-startup components. ### Signature `public void start()` ### Specified by `start` in interface `Lifecycle` ``` -------------------------------- ### Typical Usage Example Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/env/SimpleCommandLinePropertySource.html A basic example demonstrating how to create and use a SimpleCommandLinePropertySource with command-line arguments. ```APIDOC ## Typical Usage ```java public static void main(String[] args) { PropertySource ps = new SimpleCommandLinePropertySource(args); // ... } ``` ``` -------------------------------- ### Start Component Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/socket/server/support/WebSocketHttpRequestHandler.html Starts this component. Should not throw an exception if the component is already running. ```APIDOC ## start `public void start()` Description copied from interface: `Lifecycle` Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate a hard start signal to all components that apply, even to non-auto-startup components. Specified by: `start` in interface `Lifecycle` ``` -------------------------------- ### start() Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/support/DefaultLifecycleProcessor.html Starts all registered beans that implement the Lifecycle interface and are not already running. Beans are started in order of their phase, with SmartLifecycle beans respecting their defined phases and others defaulting to phase 0. Dependencies are respected, ensuring dependent beans start after their dependencies. ```APIDOC ## start ### Description Starts all registered beans that implement `Lifecycle` and are not already running. Beans implementing `SmartLifecycle` are started within their 'phase', ordered from lowest to highest. Other beans start in the default phase 0. Dependencies are handled, ensuring dependent beans start after their dependencies. ### Method public void start() ### Interface `Lifecycle` ``` -------------------------------- ### start() Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/concurrent/SimpleAsyncTaskScheduler.html Starts the lifecycle component. This method should not throw an exception if the component is already running. For containers, this propagates a start signal to all components. ```APIDOC ## start() ### Description Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate a hard start signal to all components that apply, even to non-auto-startup components. ### Method `start` ### Parameters None ### Returns None ``` -------------------------------- ### ApplicationStartup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/index-files/index-1.html Interface for instrumenting the application startup phase using steps. ```APIDOC ## ApplicationStartup ### Description Instruments the application startup phase using `steps`. ### Interface `org.springframework.core.metrics.ApplicationStartup` ``` -------------------------------- ### RestTemplate Usage - GET Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/HttpEntity.html Example of using HttpEntity with RestTemplate for a GET request. ```java HttpEntity entity = template.getForEntity("https://example.com", String.class); String body = entity.getBody(); MediaType contentType = entity.getHeaders().getContentType(); ``` -------------------------------- ### HTTP GET Request Builder Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/mock/http/server/reactive/MockServerHttpRequest.html Creates an HTTP GET builder with the given URI template. This is a starting point for constructing a mock GET request. ```APIDOC ## GET /uriTemplate ### Description Creates an HTTP GET builder with the given URI template. This is a starting point for constructing a mock GET request. ### Method GET ### Endpoint /uriTemplate ### Parameters #### Path Parameters - **uriTemplate** (String) - Required - The URI template for the request. - **uriVars** (Object...) - Optional - Variable arguments to populate the URI template. ### Request Example ```json { "example": "MockServerHttpRequest.get(\"/{id}\", 123).build()" } ``` ### Response #### Success Response (200) - **BaseBuilder** (MockServerHttpRequest.BaseBuilder) - A builder to further configure the request. ``` -------------------------------- ### StartupStep Methods Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/index-files/index-5.html Methods for recording the state and metrics of a startup step. ```APIDOC ## end() ### Description Record the state of the step and possibly other metrics like execution time. ### Method StartupStep (interface) ### Endpoint N/A (Method Signature) ### Parameters None ### Response N/A (Method typically has a void return type) ### Response Example N/A ``` -------------------------------- ### ContextStartedEvent Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/index-files/index-3.html Event raised when an ApplicationContext gets started. ```APIDOC ## ContextStartedEvent ### Description Event raised when an `ApplicationContext` gets started. ### Constructor - **ContextStartedEvent(ApplicationContext)** ``` -------------------------------- ### Methods returning WebClient.RequestHeadersUriSpec Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/reactive/function/client/class-use/WebClient.RequestHeadersUriSpec.html Examples of starting HTTP requests using WebClient. ```java WebClient.RequestHeadersUriSpec webClientDelete = WebClient.delete(); WebClient.RequestHeadersUriSpec webClientGet = WebClient.get(); WebClient.RequestHeadersUriSpec webClientHead = WebClient.head(); WebClient.RequestHeadersUriSpec webClientOptions = WebClient.options(); ``` -------------------------------- ### FlightRecorderApplicationStartup Constructor Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/jfr/FlightRecorderApplicationStartup.html Initializes a new instance of the FlightRecorderApplicationStartup class. ```APIDOC ## FlightRecorderApplicationStartup() ### Description Initializes a new instance of the `FlightRecorderApplicationStartup` class. ### Constructor `public FlightRecorderApplicationStartup()` ``` -------------------------------- ### EncoderHttpMessageWriter.getWriteHints Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/class-use/ResolvableType.html Get additional hints for encoding, for example, based on the server request or annotations from controller method parameters. ```APIDOC ## EncoderHttpMessageWriter.getWriteHints ### Description Get additional hints for encoding, for example, based on the server request or annotations from controller method parameters. ### Method Not specified (likely internal or protected) ### Endpoint Not applicable (method signature) ### Parameters - **streamType** (ResolvableType) - Description not specified - **elementType** (ResolvableType) - Description not specified - **mediaType** (MediaType) - Optional - Description not specified - **request** (ServerHttpRequest) - Description not specified - **response** (ServerHttpResponse) - Description not specified ### Return Type protected Map ``` -------------------------------- ### getExpressionPrefix Method Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/expression/common/TemplateParserContext.html Returns the prefix that identifies the start of an expression block within a template string. For example, "${". ```java public final String getExpressionPrefix() ``` -------------------------------- ### start Method Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/jfr/FlightRecorderApplicationStartup.html Creates a new startup step and marks its beginning. This method is part of the ApplicationStartup interface. ```APIDOC ## start(String name) ### Description Create a new step and marks its beginning. A step name describes the current action or phase. This technical name should be '.' namespaced and can be reused to describe other instances of the same step during application startup. ### Method `StartupStep start(String name)` ### Parameters #### Path Parameters - **name** (String) - Required - The step name. ### Specified By `start` in interface `ApplicationStartup` ``` -------------------------------- ### Starting a Back-off Execution Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/backoff/class-use/BackOffExecution.html Illustrates how to start a new back-off execution using different `BackOff` implementations. ```APIDOC ## start ### Description Starts a new back-off execution. ### Method Signature `BackOffExecution start()` ### Returns `BackOffExecution` - An instance representing the current back-off execution. ``` -------------------------------- ### DecoderHttpMessageReader.getReadHints (ServerHttpRequest, ServerHttpResponse) Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/class-use/ResolvableType.html Get additional hints for decoding, for example, based on the server request or annotations from controller method parameters. ```APIDOC ## DecoderHttpMessageReader.getReadHints (ServerHttpRequest, ServerHttpResponse) ### Description Get additional hints for decoding, for example, based on the server request or annotations from controller method parameters. ### Method Not specified (likely internal or protected) ### Endpoint Not applicable (method signature) ### Parameters - **actualType** (ResolvableType) - Description not specified - **elementType** (ResolvableType) - Description not specified - **request** (ServerHttpRequest) - Description not specified - **response** (ServerHttpResponse) - Description not specified ### Return Type protected Map ``` -------------------------------- ### start(String) - ApplicationStartup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/index-files/index-19.html Creates a new step and marks its beginning. This is used for application startup performance monitoring. ```APIDOC ## start(String stepName) ### Description Creates a new step and marks its beginning. This is used for application startup performance monitoring. ### Method Method ### Endpoint N/A (Java Method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Obtain a WebClient builder Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/reactive/function/client/class-use/WebClient.Builder.html This method provides a static way to get an instance of WebClient.Builder, which is the starting point for configuring and creating a WebClient. ```java static WebClient.Builder WebClient.builder() ``` -------------------------------- ### FixedBackOff Methods Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/backoff/FixedBackOff.html Demonstrates the methods available for getting and setting the interval and maximum attempts, as well as starting a back-off execution. ```java public void setInterval(long interval) Set the interval between two attempts in milliseconds. ``` ```java public long getInterval() Return the interval between two attempts in milliseconds. ``` ```java public void setMaxAttempts(long maxAttempts) Set the maximum number of back-off attempts. Note that in a retry scenario, this is equivalent to the maximum number of retries excluding the original invocation. ``` ```java public long getMaxAttempts() Return the maximum number of back-off attempts. Note that in a retry scenario, this is equivalent to the maximum number of retries excluding the original invocation. ``` ```java public BackOffExecution start() Description copied from interface: BackOff Start a new back off execution. Specified by: start in interface BackOff Returns: a fresh BackOffExecution ready to be used ``` ```java public String toString() ``` -------------------------------- ### Get Expression Prefix Method Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/expression/ParserContext.html Demonstrates how to retrieve the prefix used to identify the start of an expression block in template expressions. The default prefix is '${'. ```java String getExpressionPrefix() ``` -------------------------------- ### Application Startup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/support/AbstractBeanFactory.html Method to get the ApplicationStartup. ```APIDOC ## Method Summary All MethodsInstance MethodsAbstract MethodsConcrete Methods Modifier and Type Method Description `ApplicationStartup` `getApplicationStartup()` Return the `ApplicationStartup` for this bean factory. ``` -------------------------------- ### IncorrectResultSizeDataAccessException Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/allclasses-index.html Data access exception thrown when a result was not of the expected size, for example when expecting a single row but getting 0 or more than 1 rows. ```APIDOC ## Class IncorrectResultSizeDataAccessException ### Description Data access exception thrown when a result was not of the expected size, for example when expecting a single row but getting 0 or more than 1 rows. ``` -------------------------------- ### StartupStep Interface Methods Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/StartupStep.html This section details the methods available on the StartupStep interface for managing and querying startup metrics. ```APIDOC ## StartupStep Interface ### Description Represents a step in the `ApplicationStartup` process, used for recording metrics. ### Methods #### `getName()` **Return Type:** `String` **Description:** Returns the name of the startup step. This name is a technical identifier, often namespaced, describing the current action or phase. #### `getId()` **Return Type:** `long` **Description:** Returns the unique ID of this step within the application startup. #### `getParentId()` **Return Type:** `@Nullable Long` **Description:** Returns the ID of the parent step, if available. This indicates the step that was most recently started when the current step was created. #### `tag(String key, String value)` **Return Type:** `StartupStep` **Description:** Adds a key/value tag to the step for storing metadata. Returns the `StartupStep` instance for chaining. **Parameters:** - `key` (String) - The tag key. - `value` (String) - The tag value. #### `tag(String key, Supplier value)` **Return Type:** `StartupStep` **Description:** Adds a key/value tag to the step using a `Supplier` for the value. This is useful for lazy evaluation of tag values. Returns the `StartupStep` instance for chaining. **Parameters:** - `key` (String) - The tag key. - `value` (Supplier) - A supplier for the tag value. #### `getTags()` **Return Type:** `StartupStep.Tags` **Description:** Returns an immutable collection of `StartupStep.Tag` objects associated with this step. #### `end()` **Description:** Records the completion of the step, potentially including metrics like execution time. Once called, the step's state should not be modified. #### `close()` **Description:** Closes the startup step. This method is part of the `AutoCloseable` interface and ensures resources are released. ``` -------------------------------- ### SQL Table Setup for SqlServerMaxValueIncrementer Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jdbc/support/incrementer/SqlServerMaxValueIncrementer.html Example SQL statements to create a table and a sequence table for use with SqlServerMaxValueIncrementer. The sequence table should not be defined with IDENTITY. ```sql create table tab (id int not null primary key, text varchar(100)) create table tab_sequence (id bigint identity) insert into tab_sequence default values ``` -------------------------------- ### StartupStep Methods Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/class-use/StartupStep.html Methods that return a StartupStep, allowing for the creation and tagging of application startup metrics. ```APIDOC ## ApplicationStartup.start ### Description Creates a new startup step and marks its beginning. ### Method Signature `StartupStep` ApplicationStartup.`start(String name)` ## StartupStep.tag (String, String) ### Description Adds a `StartupStep.Tag` to the step with a key and a string value. ### Method Signature `StartupStep` StartupStep.`tag(String key, String value)` ## StartupStep.tag (String, Supplier) ### Description Adds a `StartupStep.Tag` to the step with a key and a supplier for the string value. ### Method Signature `StartupStep` StartupStep.`tag(String key, Supplier value)` ## FlightRecorderApplicationStartup.start ### Description Creates a new startup step and marks its beginning using Java Flight Recorder. ### Method Signature `StartupStep` FlightRecorderApplicationStartup.`start(String name)` ``` -------------------------------- ### HTTP Method Operations Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/client/RestClient.html Methods to start building HTTP requests for different HTTP methods (GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS). ```APIDOC ## HTTP Method Operations ### `get()` Starts building an HTTP GET request. Returns: `RestClient.RequestHeadersUriSpec` - A spec for specifying the target URL. ### `head()` Starts building an HTTP HEAD request. Returns: `RestClient.RequestHeadersUriSpec` - A spec for specifying the target URL. ### `post()` Starts building an HTTP POST request. Returns: `RestClient.RequestBodyUriSpec` - A spec for specifying the target URL. ### `put()` Starts building an HTTP PUT request. Returns: `RestClient.RequestBodyUriSpec` - A spec for specifying the target URL. ### `patch()` Starts building an HTTP PATCH request. Returns: `RestClient.RequestBodyUriSpec` - A spec for specifying the target URL. ### `delete()` Starts building an HTTP DELETE request. Returns: `RestClient.RequestHeadersUriSpec` - A spec for specifying the target URL. ### `options()` Starts building an HTTP OPTIONS request. Returns: `RestClient.RequestHeadersUriSpec` - A spec for specifying the target URL. ``` -------------------------------- ### IncorrectResultSetColumnCountException Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/allclasses-index.html Data access exception thrown when a result set did not have the correct column count, for example when expecting a single column but getting 0 or more than 1 column. ```APIDOC ## Class IncorrectResultSetColumnCountException ### Description Data access exception thrown when a result set did not have the correct column count, for example when expecting a single column but getting 0 or more than 1 column. ``` -------------------------------- ### onStartup(ServletContext) Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/index-files/index-15.html Configures the given ServletContext with necessary components for initializing a web application. This method is part of AbstractContextLoaderInitializer, AbstractReactiveWebInitializer, and AbstractDispatcherServletInitializer classes. ```APIDOC ## onStartup(ServletContext) ### Description Configures the given `ServletContext` with necessary components for initializing a web application. This method is part of `AbstractContextLoaderInitializer`, `AbstractReactiveWebInitializer`, and `AbstractDispatcherServletInitializer` classes. ### Method N/A (Java Method Signature) ### Endpoint N/A (Java Method Signature) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response N/A #### Response Example N/A ``` -------------------------------- ### Set Method Name Prefix Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/aot/generate/GeneratedMethods.html Specifies a prefix to be used for all generated method names. This prefix is applied with special handling for suggested names starting with 'get', 'set', or 'is'. ```APIDOC ## withPrefix ### Description Specify the prefix to use for method names. ### Method Signature `GeneratedMethods withPrefix(String prefix)` ### Parameters * `prefix` (String) - The prefix to add to suggested method names. ### Returns * `GeneratedMethods` - A new instance with the specified prefix. ``` -------------------------------- ### setAllowRawInjectionDespiteWrapping Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.html Set whether to allow the raw injection of a bean instance into some other bean's property, despite the injected bean eventually getting wrapped (for example, through AOP auto-proxying). ```APIDOC ## setAllowRawInjectionDespiteWrapping ### Description Set whether to allow the raw injection of a bean instance into some other bean's property, despite the injected bean eventually getting wrapped (for example, through AOP auto-proxying). ### Method Signature `void setAllowRawInjectionDespiteWrapping(boolean allowRawInjectionDespiteWrapping)` ``` -------------------------------- ### Initialize Headers and Create Message Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/messaging/support/MessageHeaderAccessor.html Demonstrates how to initialize headers using MessageHeaderAccessor, create MessageHeaders, and then build a Message. This is useful for setting up initial message metadata. ```java MessageHeaderAccessor accessor = new MessageHeaderAccessor(); accessor.setHeader("foo", "bar"); MessageHeaders headers = accessor.getMessageHeaders(); Message message = MessageBuilder.createMessage("payload", headers); ``` -------------------------------- ### Example Spring Integration Test Setup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/context/junit4/rules/SpringClassRule.html Demonstrates how to configure SpringClassRule and SpringMethodRule in a JUnit 4 test class to enable Spring's class-level and method-level test context features. ```java public class ExampleSpringIntegrationTest { @ClassRule public static final SpringClassRule springClassRule = new SpringClassRule(); @Rule public final SpringMethodRule springMethodRule = new SpringMethodRule(); // ... } ``` -------------------------------- ### Code-based Web Application Initialization Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/WebApplicationInitializer.html Implement WebApplicationInitializer to programmatically configure the ServletContext, replacing web.xml. This example demonstrates setting up the root and dispatcher application contexts using AnnotationConfigWebApplicationContext and registering the ContextLoaderListener and DispatcherServlet. ```java public class MyWebAppInitializer implements WebApplicationInitializer { @Override public void onStartup(ServletContext container) { // Create the 'root' Spring application context AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext(); rootContext.register(AppConfig.class); // Manage the lifecycle of the root application context container.addListener(new ContextLoaderListener(rootContext)); // Create the dispatcher servlet's Spring application context AnnotationConfigWebApplicationContext dispatcherContext = new AnnotationConfigWebApplicationContext(); dispatcherContext.register(DispatcherConfig.class); // Register and map the dispatcher servlet ServletRegistration.Dynamic dispatcher = container.addServlet("dispatcher", new DispatcherServlet(dispatcherContext)); dispatcher.setLoadOnStartup(1); dispatcher.addMapping("/"); } } ``` -------------------------------- ### HSQL Table and Sequence Setup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jdbc/support/incrementer/HsqlMaxValueIncrementer.html Example SQL statements to create a table and its corresponding sequence table for HSQLMaxValueIncrementer. Ensure the sequence table's value column is set to identity. ```SQL create table tab (id int not null primary key, text varchar(100)); create table tab_sequence (value identity); insert into tab_sequence values(0); ``` -------------------------------- ### Configuration Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/socket/client/ConnectionManagerSupport.html Methods for configuring the auto-startup behavior and phase for establishing and closing the WebSocket connection. ```APIDOC ## Configuration ### setAutoStartup(boolean autoStartup) Sets whether to auto-connect to the remote endpoint after this connection manager has been initialized and the Spring context has been refreshed. Default is "false". ### isAutoStartup() Returns the value for the 'autoStartup' property. If "true", this endpoint connection manager will connect to the remote endpoint upon a ContextRefreshedEvent. Specified by: `isAutoStartup` in interface `SmartLifecycle` See Also: `Lifecycle.start()` `SmartLifecycle.getPhase()` `LifecycleProcessor.onRefresh()` `LifecycleProcessor.onRestart()` `ConfigurableApplicationContext.refresh()` `ConfigurableApplicationContext.restart()` ### setPhase(int phase) Specifies the phase in which a connection should be established to the remote endpoint and subsequently closed. The startup order proceeds from lowest to highest, and the shutdown order is the reverse of that. By default, this value is Integer.MAX_VALUE meaning that this endpoint connection factory connects as late as possible and is closed as soon as possible. ### getPhase() Returns the phase in which this endpoint connection factory will be auto-connected and stopped. Specified by: `getPhase` in interface `Phased` Specified by: `getPhase` in interface `SmartLifecycle` See Also: `SmartLifecycle.isAutoStartup()` `Lifecycle.start()` `SmartLifecycle.stop(Runnable)` `DefaultLifecycleProcessor.getPhase(Lifecycle)` ``` -------------------------------- ### Customizing DocumentBuilderFactory via System Property Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/xml/DefaultDocumentLoader.html To change the DocumentBuilder used for parsing XML documents, you can define a Java system property when starting your JVM. This example shows how to specify an Oracle DocumentBuilderFactory. ```bash java -Djavax.xml.parsers.DocumentBuilderFactory=oracle.xml.jaxp.JXDocumentBuilderFactory MyMainClass ``` -------------------------------- ### onStartup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/context/AbstractContextLoaderInitializer.html Configures the ServletContext with necessary components for initializing the web application. This method is required by the WebApplicationInitializer interface. ```APIDOC ## onStartup ### Description Configure the given ServletContext with any servlets, filters, listeners context-params and attributes necessary for initializing this web application. ### Method public void ### Endpoint N/A (Interface method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (void) This method does not return a value. #### Response Example None ### Throws jakarta.servlet.ServletException - if any call against the given ServletContext throws a ServletException ``` -------------------------------- ### Add Generated Method (String) Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/aot/generate/GeneratedMethods.html Adds a new generated method with a single suggested name. The name is automatically qualified using the current prefix, with special handling for names starting with 'get', 'set', or 'is'. ```APIDOC ## add ### Description Adds a new `GeneratedMethod`. ### Method Signature `GeneratedMethod add(String suggestedName, Consumer method)` ### Parameters * `suggestedName` (String) - The suggested name for the method. * `method` (Consumer) - A `Consumer` used to build the method. ### Returns * `GeneratedMethod` - The newly added `GeneratedMethod`. ``` -------------------------------- ### Working with Option Arguments Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/env/CommandLinePropertySource.html Demonstrates how command-line option arguments are represented as properties. Shows assertions for checking property existence and retrieving their values, including handling options with and without arguments. ```java CommandLinePropertySource ps = ...; assert ps.containsProperty("o1") == true; assert ps.containsProperty("o2") == true; assert ps.containsProperty("o3") == false; assert ps.getProperty("o1").equals("v1"); assert ps.getProperty("o2").equals(""); assert ps.getProperty("o3") == null; ``` -------------------------------- ### BackOff Interface Usage Example Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/backoff/BackOff.html Demonstrates how to use the BackOff interface to manage retry operations. Obtain a BackOffExecution, then repeatedly call nextBackOff() to get the wait interval. Stop retrying if nextBackOff() returns BackOffExecution.STOP. ```java BackOffExecution execution = backOff.start(); // In the operation recovery/retry loop: long waitInterval = execution.nextBackOff(); if (waitInterval == BackOffExecution.STOP) { // do not retry operation } else { // sleep, for example, Thread.sleep(waitInterval) // retry operation } ``` -------------------------------- ### Example Properties File Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.html Provides example key-value pairs for properties that can be used to resolve placeholders defined in XML bean definitions. ```properties jdbc.driver=com.mysql.jdbc.Driver jdbc.dbname=mysql:mydb ``` -------------------------------- ### Add Generated Method (String Array) Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/aot/generate/GeneratedMethods.html Adds a new generated method with multiple suggested name parts. These parts are combined and qualified using the current prefix, with special handling for parts starting with 'get', 'set', or 'is'. ```APIDOC ## add ### Description Adds a new `GeneratedMethod`. ### Method Signature `GeneratedMethod add(String[] suggestedNameParts, Consumer method)` ### Parameters * `suggestedNameParts` (String[]) - The suggested name parts for the method. * `method` (Consumer) - A `Consumer` used to build the method. ### Returns * `GeneratedMethod` - The newly added `GeneratedMethod`. ``` -------------------------------- ### start Method Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/ApplicationStartup.html Creates a new step and marks its beginning. A step name describes the current action or phase. This technical name should be '.' namespaced and can be reused to describe other instances of the same step during application startup. ```APIDOC ## Method: ApplicationStartup.start(String name) Create a new step and marks its beginning. Parameters: - `name` (String) - the step name ``` -------------------------------- ### Configure ServletWrappingController for Struts Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/mvc/ServletWrappingController.html This example shows how to configure a ServletWrappingController in a Spring XML context to wrap a Struts ActionServlet. It demonstrates setting the servlet class, servlet name, and initialization parameters, including the Struts configuration file path. This setup allows Struts requests to be processed through Spring's interceptor chain. ```xml strutsWrappingController org.apache.struts.action.ActionServlet action /WEB-INF/struts-config.xml ``` -------------------------------- ### AutoStartup Configuration Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jca/endpoint/GenericMessageEndpointManager.html Methods for configuring and checking the auto-startup behavior. ```APIDOC ## AutoStartup Configuration ### setAutoStartup public void setAutoStartup(boolean autoStartup) Set whether to auto-start the endpoint activation after this endpoint manager has been initialized and the context has been refreshed. Default is "true". Turn this flag off to defer the endpoint activation until an explicit `start()` call. ### isAutoStartup public boolean isAutoStartup() Return the value for the 'autoStartup' property. If "true", this endpoint manager will start upon a ContextRefreshedEvent. Specified by: `isAutoStartup` in interface `SmartLifecycle` See Also: * `Lifecycle.start()` * `SmartLifecycle.getPhase()` * `LifecycleProcessor.onRefresh()` * `LifecycleProcessor.onRestart()` * `ConfigurableApplicationContext.refresh()` * `ConfigurableApplicationContext.restart()` ``` -------------------------------- ### StartupStep.Tag Interface Methods Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/StartupStep.Tag.html This snippet details the methods available on the StartupStep.Tag interface for retrieving tag information. ```APIDOC ## Interface: StartupStep.Tag Simple key/value association for storing step metadata. ### Methods #### `String getKey()` * **Description**: Return the `Tag` name. * **Return Type**: `String` #### `String getValue()` * **Description**: Return the `Tag` value. * **Return Type**: `String` ``` -------------------------------- ### onStartup Method Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/SpringServletContainerInitializer.html Delegates the ServletContext to any WebApplicationInitializer implementations found on the application classpath. This method is automatically invoked by Servlet containers. ```APIDOC ## onStartup(Set> webAppInitializerClasses, ServletContext servletContext) ### Description Delegates the `ServletContext` to any `WebApplicationInitializer` implementations present on the application classpath. Servlet containers automatically scan the classpath for implementations of Spring's `WebApplicationInitializer` interface and provide the set of all such types to this method. If no `WebApplicationInitializer` implementations are found, this method is effectively a no-op. If implementations are found, they are instantiated, sorted if applicable, and their `onStartup(ServletContext)` method is invoked. ### Method `public void onStartup(@Nullable Set> webAppInitializerClasses, jakarta.servlet.ServletContext servletContext) throws jakarta.servlet.ServletException` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - `webAppInitializerClasses` (Set>) - All implementations of `WebApplicationInitializer` found on the application classpath. - `servletContext` (ServletContext) - The servlet context to be initialized. ### Throws - `jakarta.servlet.ServletException` - If an error occurs during servlet initialization. ``` -------------------------------- ### ApplicationStartup Interface Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/ApplicationStartup.html Instruments the application startup phase using `steps`. The core container and its infrastructure components can use the `ApplicationStartup` to mark steps during the application startup and collect data about the execution context or their processing time. ```APIDOC ## Interface: ApplicationStartup Instruments the application startup phase using `steps`. Since: 5.3 ### Field Summary - `static final ApplicationStartup` **DEFAULT**: Default "no op" `ApplicationStartup` implementation. ### Method Summary - `StartupStep` **start**(String name): Create a new step and marks its beginning. ``` -------------------------------- ### get Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/client/RestTestClient.html Prepare an HTTP GET request. ```APIDOC ## get ### Description Prepare an HTTP GET request. ### Method `RestTestClient.RequestHeadersUriSpec` ### Returns A `RestTestClient.RequestHeadersUriSpec` to configure the request. ``` -------------------------------- ### setupMessageListener(Object) Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/index-files/index-19.html Sets up the message listener to use. ```APIDOC ## setupMessageListener(Object) ### Description Sets up the message listener to use. ### Method Not specified (likely a setter method). ### Endpoint Not applicable (Java method). ### Parameters * **messageListener** (Object) - The message listener to set up. ``` -------------------------------- ### Initializing and Using MessageHeaderAccessor Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/messaging/support/MessageHeaderAccessor.html Demonstrates the basic workflow of creating a MessageHeaderAccessor, setting headers, creating a message, and retrieving the accessor later. ```APIDOC ## Initialize and Use MessageHeaderAccessor ### Description This example shows how to create a `MessageHeaderAccessor`, add headers, build a `Message`, and then retrieve the accessor from the `Message`. ### Workflow ```java // Create a message with headers MessageHeaderAccessor accessor = new MessageHeaderAccessor(); accessor.setHeader("foo", "bar"); MessageHeaders headers = accessor.getMessageHeaders(); Message message = MessageBuilder.createMessage("payload", headers); // Later on MessageHeaderAccessor accessor = MessageHeaderAccessor.getAccessor(message); Assert.notNull(accessor, "No MessageHeaderAccessor"); ``` ``` -------------------------------- ### start Method Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/socket/sockjs/client/WebSocketTransport.html Starts this component. ```java public void start() ``` -------------------------------- ### getParametersStartingWith Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/util/WebUtils.html Return a map containing all parameters with the given prefix. ```APIDOC ## getParametersStartingWith ### Description Return a map containing all parameters with the given prefix. ### Method `static Map getParametersStartingWith(jakarta.servlet.ServletRequest request, @Nullable String prefix)` ``` -------------------------------- ### setApplicationStartup(ApplicationStartup applicationStartup) Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/support/AbstractApplicationContext.html Sets the ApplicationStartup for this application context, allowing for custom startup monitoring and reporting. ```APIDOC ## setApplicationStartup(ApplicationStartup applicationStartup) ### Description Set the `ApplicationStartup` for this application context. This allows for custom startup monitoring and reporting. ### Method `void` ### Parameters #### Path Parameters - **applicationStartup** (ApplicationStartup) - Description: The ApplicationStartup instance to set. ``` -------------------------------- ### getApplicationStartup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/ConfigurableApplicationContext.html Returns the ApplicationStartup for this application context, which can be used to monitor and analyze the application's startup performance. ```APIDOC ## getApplicationStartup ### Description Return the `ApplicationStartup` for this application context. Since: 5.3 ### Method ApplicationStartup getApplicationStartup() ``` -------------------------------- ### start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/support/AbstractApplicationContext.html Starts this component. It should not throw an exception if the component is already running. For containers, this propagates a hard start signal to all applicable components, including non-auto-startup ones. ```APIDOC ## start ### Description Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate a hard start signal to all components that apply, even to non-auto-startup components. ### Method Signature public void start() ### See Also * `SmartLifecycle.isAutoStartup()` ``` -------------------------------- ### getApplicationStartup() Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/index-files/index-7.html Retrieves the ApplicationStartup instance for the bean factory or application context. This provides insights into the application's startup process. ```APIDOC ## getApplicationStartup() ### Description Returns the `ApplicationStartup` for this bean factory or application context. This interface provides information about the application's startup process, including events and timings. ### Method Methods in `org.springframework.beans.factory.config.ConfigurableBeanFactory`, `org.springframework.beans.factory.support.AbstractBeanFactory`, `org.springframework.context.ConfigurableApplicationContext`, and `org.springframework.context.support.AbstractApplicationContext`. ### Endpoint N/A (Method invocation) ### Parameters None ### Request Example N/A ### Response #### Success Response - **ApplicationStartup** (org.springframework.beans.factory.config.ApplicationStartup) - The application startup information. ``` -------------------------------- ### Method Details: start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/socket/sockjs/support/SockJsHttpRequestHandler.html Starts this component. ```java public void start() Description copied from interface: `Lifecycle` Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate a hard start signal to all components that apply, even to non-auto-startup components. Specified by: `start` in interface `Lifecycle` See Also: * `SmartLifecycle.isAutoStartup()` ``` -------------------------------- ### Constructor Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/bind/support/ConfigurableWebBindingInitializer.html Initializes a new instance of the ConfigurableWebBindingInitializer class. ```APIDOC ## ConfigurableWebBindingInitializer() ### Description Initializes a new instance of the `ConfigurableWebBindingInitializer` class. ### Constructor `public ConfigurableWebBindingInitializer()` ``` -------------------------------- ### Methods Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jca/support/SimpleBootstrapContext.html Methods available in SimpleBootstrapContext. ```APIDOC ## getWorkManager() ### Description Get the JCA WorkManager. ### Returns * `jakarta.resource.spi.work.WorkManager` - the JCA WorkManager ``` ```APIDOC ## getXATerminator() ### Description Get the JCA XATerminator. ### Returns * `@Nullable jakarta.resource.spi.XATerminator` - the JCA XATerminator ``` ```APIDOC ## createTimer() ### Description Create a new java.util.Timer instance. ### Returns * `Timer` - a new Timer instance ### Throws * `jakarta.resource.spi.UnavailableException` - if a Timer cannot be created ``` ```APIDOC ## isContextSupported(Class workContextClass) ### Description Check if the given WorkContext type is supported. ### Parameters * `workContextClass` (Class) - the WorkContext class to check ### Returns * `boolean` - true if the WorkContext is supported, false otherwise ``` ```APIDOC ## getTransactionSynchronizationRegistry() ### Description Get the TransactionSynchronizationRegistry. ### Returns * `@Nullable jakarta.transaction.TransactionSynchronizationRegistry` - the TransactionSynchronizationRegistry ``` -------------------------------- ### CacheControl Example Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/ResponseEntity.HeadersBuilder.html Example of building a CacheControl instance. ```java CacheControl.maxAge(3600).cachePublic().noTransform() ``` -------------------------------- ### Find vs. Get Semantics Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/annotation/AnnotatedElementUtils.html Methods in this class use either 'find' or 'get' semantics for searching annotations. 'Get semantics' are limited, while 'find semantics' are more exhaustive. ```APIDOC ## Find vs. Get Semantics The search algorithms used by methods in this class follow either _find_ or _get_ semantics. Consult the javadocs for each individual method for details on which search algorithm is used. **Get semantics** are limited to searching for annotations that are either _present_ on an `AnnotatedElement` (i.e. declared locally or inherited) or declared within the annotation hierarchy _above_ the `AnnotatedElement`. **Find semantics** are much more exhaustive, providing _get semantics_ plus support for the following: * Searching on interfaces, if the annotated element is a class * Searching on superclasses, if the annotated element is a class * Resolving bridged methods, if the annotated element is a method * Searching on methods in interfaces, if the annotated element is a method * Searching on methods in superclasses, if the annotated element is a method ``` -------------------------------- ### DEFAULT ApplicationStartup Implementation Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/ApplicationStartup.html The default "no op" `ApplicationStartup` implementation. This variant is designed for minimal overhead and does not record data. ```APIDOC ## Field: ApplicationStartup.DEFAULT Default "no op" `ApplicationStartup` implementation. This variant is designed for minimal overhead and does not record data. ``` -------------------------------- ### DeferredResultProcessingInterceptor.beforeConcurrentHandling Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/context/request/class-use/NativeWebRequest.html Invoked immediately before the start of concurrent handling, in the same thread that started it. ```APIDOC ## beforeConcurrentHandling ### Description Invoked immediately before the start of concurrent handling, in the same thread that started it. ### Method `void` ### Parameters * **request** (NativeWebRequest) - The native web request. * **deferredResult** (DeferredResult) - The deferred result. ### Returns `void` ``` -------------------------------- ### Constructor Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/context/support/StaticWebApplicationContext.html Initializes a new instance of the StaticWebApplicationContext class. ```APIDOC ## Constructor ### Description Initializes a new instance of the `StaticWebApplicationContext` class. ### Signature `StaticWebApplicationContext()` ``` -------------------------------- ### GET Request Builders Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/request/MockMvcRequestBuilders.html Factory methods for creating GET requests. ```APIDOC ## get(String uriTemplate, @Nullable Object... uriVariables) ### Description Create a `MockHttpServletRequestBuilder` for a GET request. ### Parameters * `uriTemplate` (String) - a URI template; the resulting URI will be encoded * `uriVariables` (Object...) - zero or more URI variables ### Method GET ``` ```APIDOC ## get(URI uri) ### Description Create a `MockHttpServletRequestBuilder` for a GET request. ### Parameters * `uri` (URI) - the URI ### Since 4.0.3 ### Method GET ``` -------------------------------- ### assertNotEquals method example Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/util/AssertionErrors.html Example of using the assertNotEquals method. ```java assertNotEquals("Response header [" + name + "]", expected, actual); ``` -------------------------------- ### Constructor Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/context/support/StaticWebApplicationContext.html Initializes a new instance of the StaticWebApplicationContext class. ```APIDOC ## Constructor ### StaticWebApplicationContext public StaticWebApplicationContext() Initializes a new instance of the `StaticWebApplicationContext` class. ``` -------------------------------- ### Method: begin Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/transaction/jta/UserTransactionAdapter.html Starts a new transaction. ```APIDOC ## Method: begin ### Description Start a new transaction. ### Method `public void begin()` ### Throws * `jakarta.transaction.NotSupportedException` * `jakarta.transaction.SystemException` ``` -------------------------------- ### assertEquals method example Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/util/AssertionErrors.html Example of using the assertEquals method. ```java assertEquals("Response header [" + name + "]", expected, actual); ``` -------------------------------- ### Configuration Example Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/quartz/MethodInvokingJobDetailFactoryBean.html Example of how to configure MethodInvokingJobDetailFactoryBean in a Spring application context. ```APIDOC ## MethodInvokingJobDetailFactoryBean Configuration ### Description This snippet demonstrates how to configure `MethodInvokingJobDetailFactoryBean` to create a `JobDetail` that executes a specific method on a target bean. ### Bean Definition ```xml ``` ### Properties * **targetBeanName**: The name of the target bean in the Spring BeanFactory. * **targetMethod**: The name of the method to invoke on the target bean. * **concurrent**: Specifies whether multiple jobs should be run in a concurrent fashion (defaults to true). * **group**: Sets the group of the job. * **name**: Sets the name of the job. ### Note JobDetails created by this FactoryBean are not serializable and thus not suitable for persistent job stores. ``` -------------------------------- ### isAutoStartup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/quartz/SchedulerFactoryBean.html Returns the auto-startup configuration of the scheduler. If true, the scheduler starts automatically after the context is refreshed and any specified startup delay. ```APIDOC ## isAutoStartup ### Description Return whether this scheduler is configured for auto-startup. If "true", the scheduler will start after the context is refreshed and after the start delay, if any. Specified by: `isAutoStartup` in interface `SmartLifecycle` ### Method public boolean isAutoStartup() ``` -------------------------------- ### StartupStep.close() Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/index-files/index-3.html Marks the startup step as completed. ```APIDOC ## StartupStep.close() ### Description Marks the startup step as completed. ### Method Instance method ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A (void) ``` -------------------------------- ### ExecuteFunction Example Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/r2dbc/core/ExecuteFunction.html Example of how to use DatabaseClient.builder() with an executeFunction. ```java DatabaseClient.builder() .executeFunction(statement -> statement.execute()) .build(); ```