org.springframework.context.annotation.AutoProxyRegistrar Java Examples

The following examples show how to use org.springframework.context.annotation.AutoProxyRegistrar. 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: CachingConfigurationSelector.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Return the imports to use if the {@link AdviceMode} is set to {@link AdviceMode#PROXY}.
 * <p>Take care of adding the necessary JSR-107 import if it is available.
 */
private String[] getProxyImports() {
	List<String> result = new ArrayList<>(3);
	result.add(AutoProxyRegistrar.class.getName());
	result.add(ProxyCachingConfiguration.class.getName());
	if (jsr107Present && jcacheImplPresent) {
		result.add(PROXY_JCACHE_CONFIGURATION_CLASS);
	}
	return StringUtils.toStringArray(result);
}
 
Example #2
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 #3
Source File: CachingConfigurationSelector.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Return the imports to use if the {@link AdviceMode} is set to {@link AdviceMode#PROXY}.
 * <p>Take care of adding the necessary JSR-107 import if it is available.
 */
private String[] getProxyImports() {
	List<String> result = new ArrayList<>(3);
	result.add(AutoProxyRegistrar.class.getName());
	result.add(ProxyCachingConfiguration.class.getName());
	if (jsr107Present && jcacheImplPresent) {
		result.add(PROXY_JCACHE_CONFIGURATION_CLASS);
	}
	return StringUtils.toStringArray(result);
}
 
Example #4
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 #5
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 #6
Source File: CachingConfigurationSelector.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the imports to use if the {@link AdviceMode} is set to {@link AdviceMode#PROXY}.
 * <p>Take care of adding the necessary JSR-107 import if it is available.
 */
private String[] getProxyImports() {
	List<String> result = new ArrayList<String>();
	result.add(AutoProxyRegistrar.class.getName());
	result.add(ProxyCachingConfiguration.class.getName());
	if (jsr107Present && jcacheImplPresent) {
		result.add(PROXY_JCACHE_CONFIGURATION_CLASS);
	}
	return result.toArray(new String[result.size()]);
}
 
Example #7
Source File: ConfigSelector.java    From jetcache with Apache License 2.0 5 votes vote down vote up
/**
 * Return the imports to use if the {@link AdviceMode} is set to {@link AdviceMode#PROXY}.
 * <p>Take care of adding the necessary JSR-107 import if it is available.
 */
private String[] getProxyImports() {
    List<String> result = new ArrayList<String>();
    result.add(AutoProxyRegistrar.class.getName());
    result.add(JetCacheProxyConfiguration.class.getName());
    return result.toArray(new String[result.size()]);
}
 
Example #8
Source File: CachingConfigurationSelector.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Return the imports to use if the {@link AdviceMode} is set to {@link AdviceMode#PROXY}.
 * <p>Take care of adding the necessary JSR-107 import if it is available.
 */
private String[] getProxyImports() {
	List<String> result = new ArrayList<String>();
	result.add(AutoProxyRegistrar.class.getName());
	result.add(ProxyCachingConfiguration.class.getName());
	if (jsr107Present && jCacheImplPresent) {
		result.add(PROXY_JCACHE_CONFIGURATION_CLASS);
	}
	return result.toArray(new String[result.size()]);
}
 
Example #9
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;
	}
}
 
Example #10
Source File: SchedulerLockConfigurationSelector.java    From ShedLock with Apache License 2.0 5 votes vote down vote up
@Override
public String[] selectImports(@NonNull AnnotationMetadata metadata) {
    AnnotationAttributes attributes = AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(EnableSchedulerLock.class.getName(), false));
    InterceptMode mode = attributes.getEnum("interceptMode");
    if (mode == PROXY_METHOD) {
        return new String[]{AutoProxyRegistrar.class.getName(), MethodProxyLockConfiguration.class.getName()};
    } else if (mode == PROXY_SCHEDULER) {
        return new String[]{AutoProxyRegistrar.class.getName(), SchedulerProxyLockConfiguration.class.getName(), RegisterDefaultTaskSchedulerPostProcessor.class.getName()};
    } else {
        throw new UnsupportedOperationException("Unknown mode " + mode);
    }

}
 
Example #11
Source File: LimiterConfigurationSelector.java    From Limiter with Apache License 2.0 4 votes vote down vote up
private String[] getProxyImports() {
    List<String> result = new ArrayList<>();
    result.add(AutoProxyRegistrar.class.getName());
    result.add(ProxyLimiterConfiguration.class.getName());
    return StringUtils.toStringArray(result);
}