Java Code Examples for org.springframework.context.annotation.AutoProxyRegistrar

The following examples show how to use org.springframework.context.annotation.AutoProxyRegistrar. These examples are extracted from open source projects. 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
/**
 * 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
/**
 * 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
/**
 * 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
/**
 * 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
/**
 * {@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
/**
 * 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 Project: jetcache   Source File: ConfigSelector.java    License: 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
/**
 * 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
/**
 * {@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
@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 Project: Limiter   Source File: LimiterConfigurationSelector.java    License: 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);
}