|
Spring Framework example source code file (Advised.java)
The Spring Framework Advised.java source code
/*
* Copyright 2002-2007 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.aop.framework;
import org.aopalliance.aop.Advice;
import org.springframework.aop.Advisor;
import org.springframework.aop.TargetClassAware;
import org.springframework.aop.TargetSource;
/**
* Interface to be implemented by classes that hold the configuration
* of a factory of AOP proxies. This configuration includes the
* Interceptors and other advice, and Advisors, and the proxied interfaces.
*
* <p>Any AOP proxy obtained from Spring can be cast to this interface to
* allow manipulation of its AOP advice.
*
* @author Rod Johnson
* @author Juergen Hoeller
* @since 13.03.2003
* @see org.springframework.aop.framework.AdvisedSupport
*/
public interface Advised extends TargetClassAware {
/**
* Return whether the Advised configuration is frozen,
* in which case no advice changes can be made.
*/
boolean isFrozen();
/**
* Are we proxying the full target class instead of specified interfaces?
*/
boolean isProxyTargetClass();
/**
* Return the interfaces proxied by the AOP proxy. Will not
* include the target class, which may also be proxied.
*/
Class[] getProxiedInterfaces();
/**
* Determine whether the given interface is proxied.
* @param intf the interface to check
*/
boolean isInterfaceProxied(Class intf);
/**
* Change the TargetSource used by this Advised object.
* Only works if the configuration isn't frozen.
* @param targetSource new TargetSource to use
*/
void setTargetSource(TargetSource targetSource);
/**
* Return the TargetSource used by this Advised object.
*/
TargetSource getTargetSource();
/**
* Set whether the proxy should be exposed by the AOP framework as a
* ThreadLocal for retrieval via the AopContext class. This is useful
* if an advised object needs to call another advised method on itself.
* (If it uses <code>this, the invocation will not be advised).
* <p>Default is "false", for optimal performance.
*/
void setExposeProxy(boolean exposeProxy);
/**
* Return whether the factory should expose the proxy as a ThreadLocal.
* This can be necessary if a target object needs to invoke a method on itself
* benefitting from advice. (If it invokes a method on <code>this no advice
* will apply.) Getting the proxy is analogous to an EJB calling getEJBObject().
* @see AopContext
*/
boolean isExposeProxy();
/**
* Set whether this proxy configuration is pre-filtered so that it only
* contains applicable advisors (matching this proxy's target class).
* <p>Default is "false". Set this to "true" if the advisors have been
* pre-filtered already, meaning that the ClassFilter check can be skipped
* when building the actual advisor chain for proxy invocations.
* @see org.springframework.aop.ClassFilter
*/
void setPreFiltered(boolean preFiltered);
/**
* Return whether this proxy configuration is pre-filtered so that it only
* contains applicable advisors (matching this proxy's target class).
*/
boolean isPreFiltered();
/**
* Return the advisors applying to this proxy.
* @return a list of Advisors applying to this proxy (never <code>null)
*/
Advisor[] getAdvisors();
/**
* Add an advisor at the end of the advisor chain.
* <p>The Advisor may be an {@link org.springframework.aop.IntroductionAdvisor},
* in which new interfaces will be available when a proxy is next obtained
* from the relevant factory.
* @param advisor the advisor to add to the end of the chain
* @throws AopConfigException in case of invalid advice
*/
void addAdvisor(Advisor advisor) throws AopConfigException;
/**
* Add an Advisor at the specified position in the chain.
* @param advisor the advisor to add at the specified position in the chain
* @param pos position in chain (0 is head). Must be valid.
* @throws AopConfigException in case of invalid advice
*/
void addAdvisor(int pos, Advisor advisor) throws AopConfigException;
/**
* Remove the given advisor.
* @param advisor the advisor to remove
* @return <code>true if the advisor was removed;
Other Spring Framework examples (source code examples)Here is a short list of links related to this Spring Framework Advised.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.