org.springframework.context.annotation.AdviceMode Java Examples

The following examples show how to use org.springframework.context.annotation.AdviceMode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AsyncConfigurationSelector.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Returns {@link ProxyAsyncConfiguration} or {@code AspectJAsyncConfiguration}
 * for {@code PROXY} and {@code ASPECTJ} values of {@link EnableAsync#mode()},
 * respectively.
 */
@Override
@Nullable
public String[] selectImports(AdviceMode adviceMode) {
	switch (adviceMode) {
		case PROXY:
			return new String[] {ProxyAsyncConfiguration.class.getName()};
		case ASPECTJ:
			return new String[] {ASYNC_EXECUTION_ASPECT_CONFIGURATION_CLASS_NAME};
		default:
			return null;
	}
}
 
Example #2
Source File: CachingConfigurationSelector.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Returns {@link ProxyCachingConfiguration} or {@code AspectJCachingConfiguration}
 * for {@code PROXY} and {@code ASPECTJ} values of {@link EnableCaching#mode()},
 * respectively. Potentially includes corresponding JCache configuration as well.
 */
@Override
public String[] selectImports(AdviceMode adviceMode) {
	switch (adviceMode) {
		case PROXY:
			return getProxyImports();
		case ASPECTJ:
			return getAspectJImports();
		default:
			return null;
	}
}
 
Example #3
Source File: TransactionManagementConfigurationSelector.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Returns {@link ProxyTransactionManagementConfiguration} or
 * {@code AspectJ(Jta)TransactionManagementConfiguration} for {@code PROXY}
 * and {@code ASPECTJ} values of {@link EnableTransactionManagement#mode()},
 * respectively.
 */
@Override
protected String[] selectImports(AdviceMode adviceMode) {
	switch (adviceMode) {
		case PROXY:
			return new String[] {AutoProxyRegistrar.class.getName(),
					ProxyTransactionManagementConfiguration.class.getName()};
		case ASPECTJ:
			return new String[] {determineTransactionAspectClass()};
		default:
			return null;
	}
}
 
Example #4
Source File: AsyncConfigurationSelector.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Returns {@link ProxyAsyncConfiguration} or {@code AspectJAsyncConfiguration}
 * for {@code PROXY} and {@code ASPECTJ} values of {@link EnableAsync#mode()},
 * respectively.
 */
@Override
@Nullable
public String[] selectImports(AdviceMode adviceMode) {
	switch (adviceMode) {
		case PROXY:
			return new String[] {ProxyAsyncConfiguration.class.getName()};
		case ASPECTJ:
			return new String[] {ASYNC_EXECUTION_ASPECT_CONFIGURATION_CLASS_NAME};
		default:
			return null;
	}
}
 
Example #5
Source File: CachingConfigurationSelector.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Returns {@link ProxyCachingConfiguration} or {@code AspectJCachingConfiguration}
 * for {@code PROXY} and {@code ASPECTJ} values of {@link EnableCaching#mode()},
 * respectively. Potentially includes corresponding JCache configuration as well.
 */
@Override
public String[] selectImports(AdviceMode adviceMode) {
	switch (adviceMode) {
		case PROXY:
			return getProxyImports();
		case ASPECTJ:
			return getAspectJImports();
		default:
			return null;
	}
}
 
Example #6
Source File: TransactionManagementConfigurationSelector.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Returns {@link ProxyTransactionManagementConfiguration} or
 * {@code AspectJ(Jta)TransactionManagementConfiguration} for {@code PROXY}
 * and {@code ASPECTJ} values of {@link EnableTransactionManagement#mode()},
 * respectively.
 */
@Override
protected String[] selectImports(AdviceMode adviceMode) {
	switch (adviceMode) {
		case PROXY:
			return new String[] {AutoProxyRegistrar.class.getName(),
					ProxyTransactionManagementConfiguration.class.getName()};
		case ASPECTJ:
			return new String[] {determineTransactionAspectClass()};
		default:
			return null;
	}
}
 
Example #7
Source File: LimiterConfigurationSelector.java    From Limiter with Apache License 2.0 5 votes vote down vote up
@Override
protected String[] selectImports(AdviceMode adviceMode) {
    logger.info("limiter start success...");
    switch (adviceMode) {
        case PROXY:
            return getProxyImports();
        case ASPECTJ:
            throw new RuntimeException("NotImplemented");
        default:
            return null;
    }
}
 
Example #8
Source File: AsyncConfigurationSelector.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 * @return {@link ProxyAsyncConfiguration} or {@code AspectJAsyncConfiguration} for
 * {@code PROXY} and {@code ASPECTJ} values of {@link EnableAsync#mode()}, respectively
 */
@Override
public String[] selectImports(AdviceMode adviceMode) {
	switch (adviceMode) {
		case PROXY:
			return new String[] { ProxyAsyncConfiguration.class.getName() };
		case ASPECTJ:
			return new String[] { ASYNC_EXECUTION_ASPECT_CONFIGURATION_CLASS_NAME };
		default:
			return null;
	}
}
 
Example #9
Source File: TransactionManagementConfigurationSelector.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 * @return {@link ProxyTransactionManagementConfiguration} or
 * {@code AspectJTransactionManagementConfiguration} for {@code PROXY} and
 * {@code ASPECTJ} values of {@link EnableTransactionManagement#mode()}, respectively
 */
@Override
protected String[] selectImports(AdviceMode adviceMode) {
	switch (adviceMode) {
		case PROXY:
			return new String[] {AutoProxyRegistrar.class.getName(), ProxyTransactionManagementConfiguration.class.getName()};
		case ASPECTJ:
			return new String[] {TransactionManagementConfigUtils.TRANSACTION_ASPECT_CONFIGURATION_CLASS_NAME};
		default:
			return null;
	}
}
 
Example #10
Source File: CachingConfigurationSelector.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 * @return {@link ProxyCachingConfiguration} or {@code AspectJCacheConfiguration} for
 * {@code PROXY} and {@code ASPECTJ} values of {@link EnableCaching#mode()}, respectively
 */
@Override
public String[] selectImports(AdviceMode adviceMode) {
	switch (adviceMode) {
		case PROXY:
			return getProxyImports();
		case ASPECTJ:
			return getAspectJImports();
		default:
			return null;
	}
}
 
Example #11
Source File: ConfigSelector.java    From jetcache with Apache License 2.0 5 votes vote down vote up
@Override
    public String[] selectImports(AdviceMode adviceMode) {
        switch (adviceMode) {
            case PROXY:
                return getProxyImports();
            case ASPECTJ:
//                return getAspectJImports();
            default:
                return null;
        }
    }
 
Example #12
Source File: AsyncConfigurationSelector.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 * @return {@link ProxyAsyncConfiguration} or {@code AspectJAsyncConfiguration} for
 * {@code PROXY} and {@code ASPECTJ} values of {@link EnableAsync#mode()}, respectively
 */
@Override
public String[] selectImports(AdviceMode adviceMode) {
	switch (adviceMode) {
		case PROXY:
			return new String[] { ProxyAsyncConfiguration.class.getName() };
		case ASPECTJ:
			return new String[] { ASYNC_EXECUTION_ASPECT_CONFIGURATION_CLASS_NAME };
		default:
			return null;
	}
}
 
Example #13
Source File: CachingConfigurationSelector.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 * @return {@link ProxyCachingConfiguration} or {@code AspectJCacheConfiguration} for
 * {@code PROXY} and {@code ASPECTJ} values of {@link EnableCaching#mode()}, respectively
 */
@Override
public String[] selectImports(AdviceMode adviceMode) {
	switch (adviceMode) {
		case PROXY:
			return getProxyImports();
		case ASPECTJ:
			return getAspectJImports();
		default:
			return null;
	}
}
 
Example #14
Source File: TransactionManagementConfigurationSelector.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 * @return {@link ProxyTransactionManagementConfiguration} or
 * {@code AspectJTransactionManagementConfiguration} for {@code PROXY} and
 * {@code ASPECTJ} values of {@link EnableTransactionManagement#mode()}, respectively
 */
@Override
protected String[] selectImports(AdviceMode adviceMode) {
	switch (adviceMode) {
		case PROXY:
			return new String[] {AutoProxyRegistrar.class.getName(), ProxyTransactionManagementConfiguration.class.getName()};
		case ASPECTJ:
			return new String[] {TransactionManagementConfigUtils.TRANSACTION_ASPECT_CONFIGURATION_CLASS_NAME};
		default:
			return null;
	}
}