code
stringlengths
1
1.05M
repo_name
stringlengths
6
83
path
stringlengths
3
242
language
stringclasses
222 values
license
stringclasses
20 values
size
int64
1
1.05M
package cn.bugstack.springframework.core.io; import cn.hutool.core.lang.Assert; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; public class UrlResource implements Resource{ private final URL url; public UrlResou...
2302_77879529/spring
small-spring-step-10/src/main/java/cn/bugstack/springframework/core/io/UrlResource.java
Java
apache-2.0
807
package cn.bugstack.springframework.util; public class ClassUtils { public static ClassLoader getDefaultClassLoader() { ClassLoader cl = null; try { cl = Thread.currentThread().getContextClassLoader(); } catch (Throwable ex) { // Cannot access thread context...
2302_77879529/spring
small-spring-step-10/src/main/java/cn/bugstack/springframework/util/ClassUtils.java
Java
apache-2.0
1,125
package cn.bugstack.springframework.test.event; import cn.bugstack.springframework.context.ApplicationListener; import cn.bugstack.springframework.context.event.ContextClosedEvent; public class ContextClosedEventListener implements ApplicationListener<ContextClosedEvent> { @Override public void onApplication...
2302_77879529/spring
small-spring-step-10/src/test/java/cn/bugstack/springframework/test/event/ContextClosedEventListener.java
Java
apache-2.0
438
package cn.bugstack.springframework.test.event; import cn.bugstack.springframework.context.ApplicationListener; import cn.bugstack.springframework.context.event.ContextRefreshedEvent; public class ContextRefreshedEventListener implements ApplicationListener<ContextRefreshedEvent> { @Override public void onAp...
2302_77879529/spring
small-spring-step-10/src/test/java/cn/bugstack/springframework/test/event/ContextRefreshedEventListener.java
Java
apache-2.0
450
package cn.bugstack.springframework.test.event; import cn.bugstack.springframework.context.event.ApplicationContextEvent; public class CustomEvent extends ApplicationContextEvent { private Long id; private String message; /** * Constructs a prototypical Event. * * @param source The object...
2302_77879529/spring
small-spring-step-10/src/test/java/cn/bugstack/springframework/test/event/CustomEvent.java
Java
apache-2.0
839
package cn.bugstack.springframework.test.event; import cn.bugstack.springframework.context.ApplicationListener; import java.util.Date; public class CustomEventListener implements ApplicationListener<CustomEvent> { @Override public void onApplicationEvent(CustomEvent event) { System.out.println("收到:"...
2302_77879529/spring
small-spring-step-10/src/test/java/cn/bugstack/springframework/test/event/CustomEventListener.java
Java
apache-2.0
476
package cn.bugstack.springframework.aop; import org.aopalliance.intercept.MethodInterceptor; /** * Base class for AOP proxy configuration managers. * These are not themselves AOP proxies, but subclasses of this class are * normally factories from which AOP proxy instances are obtained directly. * <p> * * * * ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/aop/AdvisedSupport.java
Java
apache-2.0
1,290
package cn.bugstack.springframework.aop; /** * Filter that restricts matching of a pointcut or introduction to * a given set of target classes. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public interface ClassFilter { /** * Should the pointcut apply to the given interface ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/aop/ClassFilter.java
Java
apache-2.0
511
package cn.bugstack.springframework.aop; import java.lang.reflect.Method; /** * Part of a {@link Pointcut}: Checks whether the target method is eligible for advice. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public interface MethodMatcher { /** * Perform static checking wh...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/aop/MethodMatcher.java
Java
apache-2.0
500
package cn.bugstack.springframework.aop; /** * Core Spring pointcut abstraction. * * <p>A pointcut is composed of a {@link ClassFilter} and a {@link MethodMatcher}. * Both these basic terms and a Pointcut itself can be combined to build up combinations * <p> * * * * * * 作者:DerekYRC https://github.com/DerekY...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/aop/Pointcut.java
Java
apache-2.0
712
package cn.bugstack.springframework.aop; /** * A <code>TargetSource</code> is used to obtain the current "target" of * an AOP invocation, which will be invoked via reflection if no around * advice chooses to end the interceptor chain itself. * <p> * 被代理的目标对象 * <p> * * * * * * 作者:DerekYRC https://github.com...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/aop/TargetSource.java
Java
apache-2.0
1,281
package cn.bugstack.springframework.aop.aspectj; import cn.bugstack.springframework.aop.ClassFilter; import cn.bugstack.springframework.aop.MethodMatcher; import cn.bugstack.springframework.aop.Pointcut; import org.aspectj.weaver.tools.PointcutExpression; import org.aspectj.weaver.tools.PointcutParser; import org.aspe...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/aop/aspectj/AspectJExpressionPointcut.java
Java
apache-2.0
1,858
package cn.bugstack.springframework.aop.framework; /** * Delegate interface for a configured AOP proxy, allowing for the creation * of actual proxy objects. * * <p>Out-of-the-box implementations are available for JDK dynamic proxies * and for CGLIB proxies, as applied by DefaultAopProxyFactory * * AOP 代理的抽象 * ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/aop/framework/AopProxy.java
Java
apache-2.0
472
package cn.bugstack.springframework.aop.framework; import cn.bugstack.springframework.aop.AdvisedSupport; import net.sf.cglib.proxy.Enhancer; import net.sf.cglib.proxy.MethodInterceptor; import net.sf.cglib.proxy.MethodProxy; import java.lang.reflect.Method; /** * CGLIB2-based {@link AopProxy} implementation for th...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/aop/framework/Cglib2AopProxy.java
Java
apache-2.0
2,542
package cn.bugstack.springframework.aop.framework; import cn.bugstack.springframework.aop.AdvisedSupport; import org.aopalliance.intercept.MethodInterceptor; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; /** * JDK-based {@link AopProxy} implementation f...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/aop/framework/JdkDynamicAopProxy.java
Java
apache-2.0
1,445
package cn.bugstack.springframework.aop.framework; import org.aopalliance.intercept.MethodInvocation; import java.lang.reflect.AccessibleObject; import java.lang.reflect.Method; /** * <p>Invokes the target object using reflection. Subclasses can override the * #invokeJoinpoint() method to change this behavior, so ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/aop/framework/ReflectiveMethodInvocation.java
Java
apache-2.0
1,364
package cn.bugstack.springframework.beans; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public class BeansException extends RuntimeException { public BeansException(String msg) { super(msg); } public BeansException(String msg, Throwable cause) { super(msg, cause); } ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/BeansException.java
Java
apache-2.0
329
package cn.bugstack.springframework.beans; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring * * bean 属性信息 */ public class PropertyValue { private final String name; private final Object value; public PropertyValue(String name, Object value) { this.name = name; this.value = v...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/PropertyValue.java
Java
apache-2.0
467
package cn.bugstack.springframework.beans; import java.util.ArrayList; import java.util.List; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public class PropertyValues { private final List<PropertyValue> propertyValueList = new ArrayList<>(); public void addPropertyValue(PropertyValue pv) {...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/PropertyValues.java
Java
apache-2.0
756
package cn.bugstack.springframework.beans.factory; /** * Marker superinterface indicating that a bean is eligible to be * notified by the Spring container of a particular framework object * through a callback-style method. Actual method signature is * determined by individual subinterfaces, but should typically ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/Aware.java
Java
apache-2.0
605
package cn.bugstack.springframework.beans.factory; /** * Callback that allows a bean to be aware of the bean * {@link ClassLoader class loader}; that is, the class loader used by the * present bean factory to load bean classes. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public inte...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/BeanClassLoaderAware.java
Java
apache-2.0
432
package cn.bugstack.springframework.beans.factory; import cn.bugstack.springframework.beans.BeansException; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public interface BeanFactory { Object getBean(String name) throws BeansException; Object getBean(String name, Object... args) throws Bean...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/BeanFactory.java
Java
apache-2.0
419
package cn.bugstack.springframework.beans.factory; import cn.bugstack.springframework.beans.BeansException; /** * Interface to be implemented by beans that wish to be aware of their * owning {@link BeanFactory}. * * 实现此接口,既能感知到所属的 BeanFactory * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-sprin...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/BeanFactoryAware.java
Java
apache-2.0
485
package cn.bugstack.springframework.beans.factory; /** * Interface to be implemented by beans that want to be aware of their * bean name in a bean factory. Note that it is not usually recommended * that an object depend on its bean name, as this represents a potentially * brittle dependence on external configurati...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/BeanNameAware.java
Java
apache-2.0
559
package cn.bugstack.springframework.beans.factory; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.config.AutowireCapableBeanFactory; import cn.bugstack.springframework.beans.factory.config.BeanDefinition; import cn.bugstack.springframework.beans.factory.config...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/ConfigurableListableBeanFactory.java
Java
apache-2.0
1,012
package cn.bugstack.springframework.beans.factory; /** * Interface to be implemented by beans that want to release resources * on destruction. A BeanFactory is supposed to invoke the destroy * method if it disposes a cached singleton. An application context * is supposed to dispose all of its singletons on close. ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/DisposableBean.java
Java
apache-2.0
478
package cn.bugstack.springframework.beans.factory; /** * Interface to be implemented by objects used within a {@link BeanFactory} * which are themselves factories. If a bean implements this interface, * it is used as a factory for an object to expose, not directly as a bean * instance that will be exposed itself. ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/FactoryBean.java
Java
apache-2.0
550
package cn.bugstack.springframework.beans.factory; /** * Sub-interface implemented by bean factories that can be part * of a hierarchy. */ public interface HierarchicalBeanFactory extends BeanFactory { }
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/HierarchicalBeanFactory.java
Java
apache-2.0
209
package cn.bugstack.springframework.beans.factory; /** * Interface to be implemented by beans that need to react once all their * properties have been set by a BeanFactory: for example, to perform custom * initialization, or merely to check that all mandatory properties have been set. * * 实现此接口的 Bean 对象,会在 BeanFa...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/InitializingBean.java
Java
apache-2.0
738
package cn.bugstack.springframework.beans.factory; import cn.bugstack.springframework.beans.BeansException; import java.util.Map; /** * Extension of the {@link BeanFactory} interface to be implemented by bean factories * that can enumerate all their bean instances, rather than attempting bean lookup * by name one...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/ListableBeanFactory.java
Java
apache-2.0
1,019
package cn.bugstack.springframework.beans.factory.config; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.BeanFactory; /** * Extension of the {@link cn.bugstack.springframework.beans.factory.BeanFactory} * interface to be implemented by bean factories that a...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/config/AutowireCapableBeanFactory.java
Java
apache-2.0
1,160
package cn.bugstack.springframework.beans.factory.config; import cn.bugstack.springframework.beans.PropertyValues; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public class BeanDefinition { String SCOPE_SINGLETON = ConfigurableBeanFactory.SCOPE_SINGLETON; String SCOPE_PROTOTYPE = Configura...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/config/BeanDefinition.java
Java
apache-2.0
2,015
package cn.bugstack.springframework.beans.factory.config; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.ConfigurableListableBeanFactory; /** * Allows for custom modification of an application context's bean definitions, * adapting the bean property values ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/config/BeanFactoryPostProcessor.java
Java
apache-2.0
855
package cn.bugstack.springframework.beans.factory.config; import cn.bugstack.springframework.beans.BeansException; /** * Factory hook that allows for custom modification of new bean instances, * e.g. checking for marker interfaces or wrapping them with proxies. * * 用于修改新实例化 Bean 对象的扩展点 * * * * * * * 作者:Der...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/config/BeanPostProcessor.java
Java
apache-2.0
993
package cn.bugstack.springframework.beans.factory.config; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring * * Bean 的引用 */ public class BeanReference { private final String beanName; public BeanReference(String beanName) { this.beanName = beanName; } public String getBeanName() ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/config/BeanReference.java
Java
apache-2.0
368
package cn.bugstack.springframework.beans.factory.config; import cn.bugstack.springframework.beans.factory.HierarchicalBeanFactory; /** * Configuration interface to be implemented by most bean factories. Provides * facilities to configure a bean factory, in addition to the bean factory * client methods in the {@li...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/config/ConfigurableBeanFactory.java
Java
apache-2.0
725
package cn.bugstack.springframework.beans.factory.config; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring * <p> * 单例注册表 */ public interface SingletonBeanRegistry { Object getSingleton(String beanName); void registerSingleton(String beanName, Object singletonObject); } ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/config/SingletonBeanRegistry.java
Java
apache-2.0
359
package cn.bugstack.springframework.beans.factory.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.PropertyValue; import cn.bugstack.springframework.beans.PropertyValues; import cn.bugstack.springframework.beans.factory.*; import cn.bugstack.springframework.bea...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
Java
apache-2.0
7,586
package cn.bugstack.springframework.beans.factory.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.core.io.DefaultResourceLoader; import cn.bugstack.springframework.core.io.ResourceLoader; /** * Abstract base class for bean definition readers which implement * the...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/support/AbstractBeanDefinitionReader.java
Java
apache-2.0
1,159
package cn.bugstack.springframework.beans.factory.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.BeanFactory; import cn.bugstack.springframework.beans.factory.FactoryBean; import cn.bugstack.springframework.beans.factory.config.BeanDefinition; import ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/support/AbstractBeanFactory.java
Java
apache-2.0
3,260
package cn.bugstack.springframework.beans.factory.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.core.io.Resource; import cn.bugstack.springframework.core.io.ResourceLoader; /** * Simple interface for bean definition readers. * * * * * * * 作者:DerekYRC http...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/support/BeanDefinitionReader.java
Java
apache-2.0
785
package cn.bugstack.springframework.beans.factory.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.config.BeanDefinition; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public interface BeanDefinitionRegistry { /** * 向注册表中注册 B...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/support/BeanDefinitionRegistry.java
Java
apache-2.0
1,052
package cn.bugstack.springframework.beans.factory.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.config.BeanDefinition; import net.sf.cglib.proxy.Enhancer; import net.sf.cglib.proxy.NoOp; import java.lang.reflect.Constructor; public class CglibSubcl...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/support/CglibSubclassingInstantiationStrategy.java
Java
apache-2.0
932
package cn.bugstack.springframework.beans.factory.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.ConfigurableListableBeanFactory; import cn.bugstack.springframework.beans.factory.config.BeanDefinition; import cn.bugstack.springframework.beans.factory....
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/support/DefaultListableBeanFactory.java
Java
apache-2.0
2,134
package cn.bugstack.springframework.beans.factory.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.DisposableBean; import cn.bugstack.springframework.beans.factory.config.SingletonBeanRegistry; import java.util.HashMap; import java.util.LinkedHashMap; ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java
Java
apache-2.0
1,942
package cn.bugstack.springframework.beans.factory.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.DisposableBean; import cn.bugstack.springframework.beans.factory.config.BeanDefinition; import cn.hutool.core.util.StrUtil; import java.lang.reflect.Meth...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/support/DisposableBeanAdapter.java
Java
apache-2.0
1,746
package cn.bugstack.springframework.beans.factory.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.FactoryBean; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /** * Support base class for singleton registries which need to handl...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/support/FactoryBeanRegistrySupport.java
Java
apache-2.0
1,947
package cn.bugstack.springframework.beans.factory.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.config.BeanDefinition; import java.lang.reflect.Constructor; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring * <p> * Bean 实例化策略 */ public ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/support/InstantiationStrategy.java
Java
apache-2.0
501
package cn.bugstack.springframework.beans.factory.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.config.BeanDefinition; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; /** * 作者:DerekYRC https://github.com/D...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/support/SimpleInstantiationStrategy.java
Java
apache-2.0
1,109
package cn.bugstack.springframework.beans.factory.xml; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.PropertyValue; import cn.bugstack.springframework.beans.factory.config.BeanDefinition; import cn.bugstack.springframework.beans.factory.config.BeanReference; import c...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/beans/factory/xml/XmlBeanDefinitionReader.java
Java
apache-2.0
5,294
package cn.bugstack.springframework.context; import cn.bugstack.springframework.beans.factory.HierarchicalBeanFactory; import cn.bugstack.springframework.beans.factory.ListableBeanFactory; import cn.bugstack.springframework.core.io.ResourceLoader; /** * Central interface to provide configuration for an application. ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/ApplicationContext.java
Java
apache-2.0
684
package cn.bugstack.springframework.context; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.Aware; /** * Interface to be implemented by any object that wishes to be notified * of the {@link ApplicationContext} that it runs in. * * 实现此接口,既能感知到所属的 Applicati...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/ApplicationContextAware.java
Java
apache-2.0
599
package cn.bugstack.springframework.context; import java.util.EventObject; /** * Class to be extended by all application events. Abstract as it * doesn't make sense for generic events to be published directly. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public abstract class Applica...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/ApplicationEvent.java
Java
apache-2.0
629
package cn.bugstack.springframework.context; /** * Interface that encapsulates event publication functionality. * Serves as super-interface for ApplicationContext. * * 事件发布者接口 * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public interface ApplicationEventPublisher { /** * N...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/ApplicationEventPublisher.java
Java
apache-2.0
624
package cn.bugstack.springframework.context; import java.util.EventListener; /** * Interface to be implemented by application event listeners. * Based on the standard <code>java.util.EventListener</code> interface * for the Observer design pattern. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/ApplicationListener.java
Java
apache-2.0
564
package cn.bugstack.springframework.context; import cn.bugstack.springframework.beans.BeansException; /** * SPI interface to be implemented by most if not all application contexts. * Provides facilities to configure an application context in addition * to the application context client methods in the * {@link cn....
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/ConfigurableApplicationContext.java
Java
apache-2.0
716
package cn.bugstack.springframework.context.event; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.BeanFactory; import cn.bugstack.springframework.beans.factory.BeanFactoryAware; import cn.bugstack.springframework.context.ApplicationEvent; import cn.bugstack.sp...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/event/AbstractApplicationEventMulticaster.java
Java
apache-2.0
3,896
package cn.bugstack.springframework.context.event; import cn.bugstack.springframework.context.ApplicationContext; import cn.bugstack.springframework.context.ApplicationEvent; /** * Base class for events raised for an <code>ApplicationContext</code>. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-s...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/event/ApplicationContextEvent.java
Java
apache-2.0
890
package cn.bugstack.springframework.context.event; import cn.bugstack.springframework.context.ApplicationEvent; import cn.bugstack.springframework.context.ApplicationListener; /** * Interface to be implemented by objects that can manage a number of * {@link ApplicationListener} objects, and publish events to them. ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/event/ApplicationEventMulticaster.java
Java
apache-2.0
1,018
package cn.bugstack.springframework.context.event; /** * Event raised when an <code>ApplicationContext</code> gets closed. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public class ContextClosedEvent extends ApplicationContextEvent{ /** * Constructs a prototypical Event. ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/event/ContextClosedEvent.java
Java
apache-2.0
546
package cn.bugstack.springframework.context.event; /** * Event raised when an <code>ApplicationContext</code> gets initialized or refreshed. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public class ContextRefreshedEvent extends ApplicationContextEvent{ /** * Constructs a prot...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/event/ContextRefreshedEvent.java
Java
apache-2.0
569
package cn.bugstack.springframework.context.event; import cn.bugstack.springframework.beans.factory.BeanFactory; import cn.bugstack.springframework.context.ApplicationEvent; import cn.bugstack.springframework.context.ApplicationListener; /** * Simple implementation of the {@link ApplicationEventMulticaster} interfac...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/event/SimpleApplicationEventMulticaster.java
Java
apache-2.0
883
package cn.bugstack.springframework.context.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.ConfigurableListableBeanFactory; import cn.bugstack.springframework.beans.factory.config.BeanFactoryPostProcessor; import cn.bugstack.springframework.beans.fact...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/support/AbstractApplicationContext.java
Java
apache-2.0
5,805
package cn.bugstack.springframework.context.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.ConfigurableListableBeanFactory; import cn.bugstack.springframework.beans.factory.support.DefaultListableBeanFactory; /** * Base class for {@link cn.bugstack....
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/support/AbstractRefreshableApplicationContext.java
Java
apache-2.0
1,435
package cn.bugstack.springframework.context.support; import cn.bugstack.springframework.beans.factory.support.DefaultListableBeanFactory; import cn.bugstack.springframework.beans.factory.xml.XmlBeanDefinitionReader; /** * Convenient base class for {@link cn.bugstack.springframework.context.ApplicationContext} * imp...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/support/AbstractXmlApplicationContext.java
Java
apache-2.0
1,124
package cn.bugstack.springframework.context.support; import cn.bugstack.springframework.beans.BeansException; import cn.bugstack.springframework.beans.factory.config.BeanPostProcessor; import cn.bugstack.springframework.context.ApplicationContext; import cn.bugstack.springframework.context.ApplicationContextAware; /*...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/support/ApplicationContextAwareProcessor.java
Java
apache-2.0
1,114
package cn.bugstack.springframework.context.support; import cn.bugstack.springframework.beans.BeansException; /** * Standalone XML application context, taking the context definition files * from the class path, interpreting plain paths as class path resource names * that include the package path (e.g. "mypackage/m...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/context/support/ClassPathXmlApplicationContext.java
Java
apache-2.0
1,414
package cn.bugstack.springframework.core.io; import cn.bugstack.springframework.util.ClassUtils; import cn.hutool.core.lang.Assert; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; public class ClassPathResource implements Resource { private final String path; p...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/core/io/ClassPathResource.java
Java
apache-2.0
1,029
package cn.bugstack.springframework.core.io; import cn.hutool.core.lang.Assert; import java.net.MalformedURLException; import java.net.URL; public class DefaultResourceLoader implements ResourceLoader { @Override public Resource getResource(String location) { Assert.notNull(location, "Location must ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/core/io/DefaultResourceLoader.java
Java
apache-2.0
756
package cn.bugstack.springframework.core.io; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; public class FileSystemResource implements Resource { private final File file; private final String path; public FileSystemResource(File file) { ...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/core/io/FileSystemResource.java
Java
apache-2.0
699
package cn.bugstack.springframework.core.io; import java.io.IOException; import java.io.InputStream; public interface Resource { InputStream getInputStream() throws IOException; }
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/core/io/Resource.java
Java
apache-2.0
188
package cn.bugstack.springframework.core.io; public interface ResourceLoader { /** * Pseudo URL prefix for loading from the class path: "classpath:" */ String CLASSPATH_URL_PREFIX = "classpath:"; Resource getResource(String location); }
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/core/io/ResourceLoader.java
Java
apache-2.0
263
package cn.bugstack.springframework.core.io; import cn.hutool.core.lang.Assert; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; public class UrlResource implements Resource{ private final URL url; public UrlResou...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/core/io/UrlResource.java
Java
apache-2.0
807
package cn.bugstack.springframework.util; public class ClassUtils { public static ClassLoader getDefaultClassLoader() { ClassLoader cl = null; try { cl = Thread.currentThread().getContextClassLoader(); } catch (Throwable ex) { // Cannot access thread context...
2302_77879529/spring
small-spring-step-11/src/main/java/cn/bugstack/springframework/util/ClassUtils.java
Java
apache-2.0
1,125
package cn.bugstack.springframework.test.bean; public interface IUserService { String queryUserInfo(); String register(String userName); }
2302_77879529/spring
small-spring-step-11/src/test/java/cn/bugstack/springframework/test/bean/IUserService.java
Java
apache-2.0
150
package cn.bugstack.springframework.test.bean; import java.util.Random; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public class UserService implements IUserService { public String queryUserInfo() { try { Thread.sleep(new Random(1).nextInt(100)); } catch (Interrupte...
2302_77879529/spring
small-spring-step-11/src/test/java/cn/bugstack/springframework/test/bean/UserService.java
Java
apache-2.0
708
package cn.bugstack.springframework.test.bean; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; public class UserServiceInterceptor implements MethodInterceptor { @Override public Object invoke(MethodInvocation invocation) throws Throwable { long ...
2302_77879529/spring
small-spring-step-11/src/test/java/cn/bugstack/springframework/test/bean/UserServiceInterceptor.java
Java
apache-2.0
732
package cn.bugstack.springframework.aop; import org.aopalliance.intercept.MethodInterceptor; /** * Base class for AOP proxy configuration managers. * These are not themselves AOP proxies, but subclasses of this class are * normally factories from which AOP proxy instances are obtained directly. * <p> * * * * ...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/AdvisedSupport.java
Java
apache-2.0
1,559
package cn.bugstack.springframework.aop; import org.aopalliance.aop.Advice; /** * Base interface holding AOP <b>advice</b> (action to take at a joinpoint) * and a filter determining the applicability of the advice (such as * a pointcut). <i>This interface is not for use by Spring users, but to * allow for commona...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/Advisor.java
Java
apache-2.0
799
package cn.bugstack.springframework.aop; import org.aopalliance.aop.Advice; /** * Common marker interface for before advice, such as {@link MethodBeforeAdvice}. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public interface BeforeAdvice extends Advice { }
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/BeforeAdvice.java
Java
apache-2.0
297
package cn.bugstack.springframework.aop; /** * Filter that restricts matching of a pointcut or introduction to * a given set of target classes. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public interface ClassFilter { /** * Should the pointcut apply to the given interface ...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/ClassFilter.java
Java
apache-2.0
511
package cn.bugstack.springframework.aop; import java.lang.reflect.Method; /** * Advice invoked before a method is invoked. Such advices cannot * prevent the method call proceeding, unless they throw a Throwable. * <p> * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public interface Method...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/MethodBeforeAdvice.java
Java
apache-2.0
983
package cn.bugstack.springframework.aop; import java.lang.reflect.Method; /** * Part of a {@link Pointcut}: Checks whether the target method is eligible for advice. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public interface MethodMatcher { /** * Perform static checking wh...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/MethodMatcher.java
Java
apache-2.0
500
package cn.bugstack.springframework.aop; /** * Core Spring pointcut abstraction. * * <p>A pointcut is composed of a {@link ClassFilter} and a {@link MethodMatcher}. * Both these basic terms and a Pointcut itself can be combined to build up combinations * <p> * * * * * * 作者:DerekYRC https://github.com/DerekY...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/Pointcut.java
Java
apache-2.0
712
package cn.bugstack.springframework.aop; /** * Superinterface for all Advisors that are driven by a pointcut. * This covers nearly all advisors except introduction advisors, * for which method-level matching doesn't apply. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public interface...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/PointcutAdvisor.java
Java
apache-2.0
459
package cn.bugstack.springframework.aop; /** * A <code>TargetSource</code> is used to obtain the current "target" of * an AOP invocation, which will be invoked via reflection if no around * advice chooses to end the interceptor chain itself. * <p> * 被代理的目标对象 * <p> * * * * * * 作者:DerekYRC https://github.com...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/TargetSource.java
Java
apache-2.0
1,281
package cn.bugstack.springframework.aop.aspectj; import cn.bugstack.springframework.aop.ClassFilter; import cn.bugstack.springframework.aop.MethodMatcher; import cn.bugstack.springframework.aop.Pointcut; import org.aspectj.weaver.tools.PointcutExpression; import org.aspectj.weaver.tools.PointcutParser; import org.aspe...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/aspectj/AspectJExpressionPointcut.java
Java
apache-2.0
1,858
package cn.bugstack.springframework.aop.aspectj; import cn.bugstack.springframework.aop.Pointcut; import cn.bugstack.springframework.aop.PointcutAdvisor; import org.aopalliance.aop.Advice; /** * Spring AOP Advisor that can be used for any AspectJ pointcut expression. * * * * * * * 作者:DerekYRC https://github.c...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java
Java
apache-2.0
1,039
package cn.bugstack.springframework.aop.framework; /** * Delegate interface for a configured AOP proxy, allowing for the creation * of actual proxy objects. * * <p>Out-of-the-box implementations are available for JDK dynamic proxies * and for CGLIB proxies, as applied by DefaultAopProxyFactory * * AOP 代理的抽象 * ...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/framework/AopProxy.java
Java
apache-2.0
472
package cn.bugstack.springframework.aop.framework; import cn.bugstack.springframework.aop.AdvisedSupport; import net.sf.cglib.proxy.Enhancer; import net.sf.cglib.proxy.MethodInterceptor; import net.sf.cglib.proxy.MethodProxy; import java.lang.reflect.Method; /** * CGLIB2-based {@link AopProxy} implementation for th...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/framework/Cglib2AopProxy.java
Java
apache-2.0
2,542
package cn.bugstack.springframework.aop.framework; import cn.bugstack.springframework.aop.AdvisedSupport; import org.aopalliance.intercept.MethodInterceptor; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; /** * JDK-based {@link AopProxy} implementation f...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/framework/JdkDynamicAopProxy.java
Java
apache-2.0
1,445
package cn.bugstack.springframework.aop.framework; import cn.bugstack.springframework.aop.AdvisedSupport; /** * Factory for AOP proxies for programmatic use, rather than via a bean * factory. This class provides a simple way of obtaining and configuring * AOP proxies in code. * <p> * * * * * * 作者:DerekYRC h...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/framework/ProxyFactory.java
Java
apache-2.0
855
package cn.bugstack.springframework.aop.framework; import org.aopalliance.intercept.MethodInvocation; import java.lang.reflect.AccessibleObject; import java.lang.reflect.Method; /** * <p>Invokes the target object using reflection. Subclasses can override the * #invokeJoinpoint() method to change this behavior, so ...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/framework/ReflectiveMethodInvocation.java
Java
apache-2.0
1,364
package cn.bugstack.springframework.aop.framework.adapter; import cn.bugstack.springframework.aop.MethodBeforeAdvice; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; /** * Interceptor to wrap am {@link cn.bugstack.springframework.aop.MethodBeforeAdvice}. * Used...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/framework/adapter/MethodBeforeAdviceInterceptor.java
Java
apache-2.0
966
package cn.bugstack.springframework.aop.framework.autoproxy; import cn.bugstack.springframework.aop.*; import cn.bugstack.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor; import cn.bugstack.springframework.aop.framework.ProxyFactory; import cn.bugstack.springframework.beans.BeansException; import cn.bugst...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/aop/framework/autoproxy/DefaultAdvisorAutoProxyCreator.java
Java
apache-2.0
3,165
package cn.bugstack.springframework.beans; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public class BeansException extends RuntimeException { public BeansException(String msg) { super(msg); } public BeansException(String msg, Throwable cause) { super(msg, cause); } ...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/beans/BeansException.java
Java
apache-2.0
329
package cn.bugstack.springframework.beans; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring * * bean 属性信息 */ public class PropertyValue { private final String name; private final Object value; public PropertyValue(String name, Object value) { this.name = name; this.value = v...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/beans/PropertyValue.java
Java
apache-2.0
467
package cn.bugstack.springframework.beans; import java.util.ArrayList; import java.util.List; /** * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public class PropertyValues { private final List<PropertyValue> propertyValueList = new ArrayList<>(); public void addPropertyValue(PropertyValue pv) {...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/beans/PropertyValues.java
Java
apache-2.0
756
package cn.bugstack.springframework.beans.factory; /** * Marker superinterface indicating that a bean is eligible to be * notified by the Spring container of a particular framework object * through a callback-style method. Actual method signature is * determined by individual subinterfaces, but should typically ...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/beans/factory/Aware.java
Java
apache-2.0
605
package cn.bugstack.springframework.beans.factory; /** * Callback that allows a bean to be aware of the bean * {@link ClassLoader class loader}; that is, the class loader used by the * present bean factory to load bean classes. * * * * * * * 作者:DerekYRC https://github.com/DerekYRC/mini-spring */ public inte...
2302_77879529/spring
small-spring-step-12/src/main/java/cn/bugstack/springframework/beans/factory/BeanClassLoaderAware.java
Java
apache-2.0
432