类org.springframework.context.annotation.AdviceMode源码实例Demo

下面列出了怎么用org.springframework.context.annotation.AdviceMode的API类实例代码及写法,或者点击链接到github查看源代码。

/**
 * 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;
	}
}
 
/**
 * 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;
	}
}
 
/**
 * 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;
	}
}
 
/**
 * 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;
	}
}
 
/**
 * 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;
	}
}
 
/**
 * 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;
	}
}
 
源代码7 项目: Limiter   文件: LimiterConfigurationSelector.java
@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;
    }
}
 
源代码8 项目: lams   文件: AsyncConfigurationSelector.java
/**
 * {@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;
	}
}
 
/**
 * {@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;
	}
}
 
源代码10 项目: lams   文件: CachingConfigurationSelector.java
/**
 * {@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;
	}
}
 
源代码11 项目: jetcache   文件: ConfigSelector.java
@Override
    public String[] selectImports(AdviceMode adviceMode) {
        switch (adviceMode) {
            case PROXY:
                return getProxyImports();
            case ASPECTJ:
//                return getAspectJImports();
            default:
                return null;
        }
    }
 
/**
 * {@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;
	}
}
 
/**
 * {@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;
	}
}
 
/**
 * {@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;
	}
}
 
 同包方法