Skip to content
24 changes: 9 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ Choose the version that matches your Spring Boot generation:

| Branch | Spring Boot Compatibility | Latest Version |
|--------|---------------------------|----------------|
| `main` | 3.0.x – 3.5.x, 4.0.x | `0.2.15` |
| `1.x` | 2.0.x – 2.7.x | `0.1.15` |
| `main` | 3.0.x – 3.5.x, 4.0.x | `0.2.16` |
| `1.x` | 2.0.x – 2.7.x | `0.1.16` |

### Add Module Dependencies

Expand Down Expand Up @@ -281,13 +281,13 @@ cd microsphere-spring-boot

## Getting Help

| Resource | Link |
|---------------------------|----------------------------------------------------------------------------------------|
| **User Guide (DeepWiki)** | https://deepwiki.com/microsphere-projects/microsphere-spring-boot |
| **User Guide (ZRead)** | https://zread.ai/microsphere-projects/microsphere-spring-boot |
| **User Guide (Github)** | [User Guide](./user-guide.md) |
| **GitHub Wiki** | https://github.com/microsphere-projects/microsphere-spring-boot/wiki |
| **Issue Tracker** | https://github.com/microsphere-projects/microsphere-spring-boot/issues |
| Resource | Link |
|---------------------------|------------------------------------------------------------------------|
| **User Guide (DeepWiki)** | https://deepwiki.com/microsphere-projects/microsphere-spring-boot |
| **User Guide (ZRead)** | https://zread.ai/microsphere-projects/microsphere-spring-boot |
| **User Guide (Github)** | [User Guide](./user-guide.md) |
| **GitHub Wiki** | https://github.com/microsphere-projects/microsphere-spring-boot/wiki |
| **Issue Tracker** | https://github.com/microsphere-projects/microsphere-spring-boot/issues |

**Reporting a bug:**

Expand All @@ -306,12 +306,6 @@ Contributions of all kinds are welcome — bug fixes, documentation improvements
4. Open a pull request against the `main` branch (or `1.x` for Spring Boot 2.x fixes).
5. Please read [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) before participating in the community.

## Maintainers

| Name | GitHub | Email |
|----------|----------------------------------------------|----------------------|
| Mercy Ma | [@mercyblitz](https://github.com/mercyblitz) | mercyblitz@gmail.com |

The project is maintained under the [Microsphere Projects](https://github.com/microsphere-projects) organisation.

## License
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public MonitoredThreadPoolTaskScheduler() {
* // The created executor is wrapped with monitoring support.
* }</pre>
*
* @param poolSize the core pool size for the executor
* @param threadFactory the {@link ThreadFactory} to use
* @param rejectedExecutionHandler the {@link RejectedExecutionHandler} to use
* @param poolSize the core pool size for the executor
* @param threadFactory the {@link ThreadFactory} to use
* @param rejectedExecutionHandler the {@link RejectedExecutionHandler} to use
* @return the created {@link ScheduledExecutorService}
*/
@Override
Expand Down Expand Up @@ -153,4 +153,4 @@ public void setBeanName(String name) {
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.context = applicationContext;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public class ActuatorAutoConfiguration {

/**
* The class name of {@link io.micrometer.core.instrument.MeterRegistry}
*
* @see io.micrometer.core.instrument.MeterRegistry
*/
static final String METER_REGISTRY_CLASS_NAME = "io.micrometer.core.instrument.MeterRegistry";
Expand Down Expand Up @@ -119,4 +120,4 @@ public ThreadPoolTaskScheduler actuatorTaskScheduler(
threadPoolTaskScheduler.setThreadNamePrefix(threadNamePrefix);
return threadPoolTaskScheduler;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,4 @@ public ConfigurationPropertiesEndpoint configurationPropertiesEndpoint(Configura
public void setBeanClassLoader(ClassLoader classLoader) {
this.classLoader = classLoader;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
* @see Conditional
* @since 1.0.0
*/
@Target({ TYPE, METHOD })
@Target({TYPE, METHOD})
@Retention(RUNTIME)
@Documented
@ConditionalOnClass(name = "org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata")
public @interface ConditionalOnConfigurationProcessorPresent {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ public interface PropertyConstants {
* The property name prefix of Microsphere Spring Boot Actuator Task Scheduler : "microsphere.spring.boot.actuator.task-scheduler."
*/
String TASK_SCHEDULER_PROPERTY_NAME_PREFIX = MICROSPHERE_SPRING_BOOT_ACTUATOR_PROPERTY_NAME_PREFIX + "task-scheduler.";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ public ArtifactsEndpoint(ClassLoader classLoader) {
public List<Artifact> getArtifactMetaInfoList() {
return artifactDetector.detect(false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ public Collection<ItemMetadata> getProperties() {
return properties;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ ConfigurationPropertiesDescriptor addConfigurationProperties(List<ConfigurationP
return this;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ static boolean isReadWebOperationCandidate(WebOperation webOperation) {
}
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ void testActuatorTaskScheduler() {
assertNull(actuatorTaskScheduler, "Actuator task scheduler should be null");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ void test() {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ void testConstants() {
assertEquals("microsphere.spring.boot.actuator.", MICROSPHERE_SPRING_BOOT_ACTUATOR_PROPERTY_NAME_PREFIX);
assertEquals("microsphere.spring.boot.actuator.task-scheduler.", TASK_SCHEDULER_PROPERTY_NAME_PREFIX);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ public WebOperationRequestPredicate getRequestPredicate() {
return null;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ void testEndpointsDefaultProperties() {
private void assertProperty(String propertyName, String expectedValue) {
assertEquals(expectedValue, environment.getRequiredProperty(propertyName));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,55 +33,60 @@
*/
public interface BootstrapContext {

/**
* Return an instance from the context if the type has been registered. The instance
* will be created it if it hasn't been accessed previously.
* @param <T> the instance type
* @param type the instance type
* @return the instance managed by the context
* @throws IllegalStateException if the type has not been registered
*/
<T> T get(Class<T> type) throws IllegalStateException;
/**
* Return an instance from the context if the type has been registered. The instance
* will be created it if it hasn't been accessed previously.
*
* @param <T> the instance type
* @param type the instance type
* @return the instance managed by the context
* @throws IllegalStateException if the type has not been registered
*/
<T> T get(Class<T> type) throws IllegalStateException;

/**
* Return an instance from the context if the type has been registered. The instance
* will be created it if it hasn't been accessed previously.
* @param <T> the instance type
* @param type the instance type
* @param other the instance to use if the type has not been registered
* @return the instance
*/
<T> T getOrElse(Class<T> type, T other);
/**
* Return an instance from the context if the type has been registered. The instance
* will be created it if it hasn't been accessed previously.
*
* @param <T> the instance type
* @param type the instance type
* @param other the instance to use if the type has not been registered
* @return the instance
*/
<T> T getOrElse(Class<T> type, T other);

/**
* Return an instance from the context if the type has been registered. The instance
* will be created it if it hasn't been accessed previously.
* @param <T> the instance type
* @param type the instance type
* @param other a supplier for the instance to use if the type has not been registered
* @return the instance
*/
<T> T getOrElseSupply(Class<T> type, Supplier<T> other);
/**
* Return an instance from the context if the type has been registered. The instance
* will be created it if it hasn't been accessed previously.
*
* @param <T> the instance type
* @param type the instance type
* @param other a supplier for the instance to use if the type has not been registered
* @return the instance
*/
<T> T getOrElseSupply(Class<T> type, Supplier<T> other);

/**
* Return an instance from the context if the type has been registered. The instance
* will be created it if it hasn't been accessed previously.
* @param <T> the instance type
* @param <X> the exception to throw if the type is not registered
* @param type the instance type
* @param exceptionSupplier the supplier which will return the exception to be thrown
* @return the instance managed by the context
* @throws X if the type has not been registered
* @throws IllegalStateException if the type has not been registered
*/
<T, X extends Throwable> T getOrElseThrow(Class<T> type, Supplier<? extends X> exceptionSupplier) throws X;
/**
* Return an instance from the context if the type has been registered. The instance
* will be created it if it hasn't been accessed previously.
*
* @param <T> the instance type
* @param <X> the exception to throw if the type is not registered
* @param type the instance type
* @param exceptionSupplier the supplier which will return the exception to be thrown
* @return the instance managed by the context
* @throws X if the type has not been registered
* @throws IllegalStateException if the type has not been registered
*/
<T, X extends Throwable> T getOrElseThrow(Class<T> type, Supplier<? extends X> exceptionSupplier) throws X;

/**
* Return if a registration exists for the given type.
* @param <T> the instance type
* @param type the instance type
* @return {@code true} if the type has already been registered
*/
<T> boolean isRegistered(Class<T> type);
/**
* Return if a registration exists for the given type.
*
* @param <T> the instance type
* @param type the instance type
* @return {@code true} if the type has already been registered
*/
<T> boolean isRegistered(Class<T> type);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,34 @@
* {@link ApplicationEvent} published by a {@link BootstrapContext} when it's closed.
*
* @author Phillip Webb
* @since 2.4.0
* @see BootstrapRegistry#addCloseListener(org.springframework.context.ApplicationListener)
* @since 2.4.0
*/
public class BootstrapContextClosedEvent extends ApplicationEvent {

private final ConfigurableApplicationContext applicationContext;

BootstrapContextClosedEvent(BootstrapContext source, ConfigurableApplicationContext applicationContext) {
super(source);
this.applicationContext = applicationContext;
}

/**
* Return the {@link BootstrapContext} that was closed.
* @return the bootstrap context
*/
public BootstrapContext getBootstrapContext() {
return (BootstrapContext) this.source;
}

/**
* Return the prepared application context.
* @return the application context
*/
public ConfigurableApplicationContext getApplicationContext() {
return this.applicationContext;
}

}
private final ConfigurableApplicationContext applicationContext;

BootstrapContextClosedEvent(BootstrapContext source, ConfigurableApplicationContext applicationContext) {
super(source);
this.applicationContext = applicationContext;
}

/**
* Return the {@link BootstrapContext} that was closed.
*
* @return the bootstrap context
*/
public BootstrapContext getBootstrapContext() {
return (BootstrapContext) this.source;
}

/**
* Return the prepared application context.
*
* @return the application context
*/
public ConfigurableApplicationContext getApplicationContext() {
return this.applicationContext;
}

}
Loading
Loading