Example usage for org.springframework.aop.framework AdvisedSupport copyConfigurationFrom

List of usage examples for org.springframework.aop.framework AdvisedSupport copyConfigurationFrom

Introduction

In this page you can find the example usage for org.springframework.aop.framework AdvisedSupport copyConfigurationFrom.

Prototype

protected void copyConfigurationFrom(AdvisedSupport other) 

Source Link

Document

Call this method on a new instance created by the no-arg constructor to create an independent copy of the configuration from the given object.

Usage

From source file:org.springframework.aop.framework.AdvisedSupport.java

/**
 * Serializes a copy of the state of this class, ignoring subclass state.
 *//*www. j a  va  2 s .  c  o  m*/
protected Object writeReplace() throws ObjectStreamException {
    if (logger.isDebugEnabled()) {
        logger.debug("Disconnecting " + this);
    }

    // Copy state to avoid dependencies on BeanFactory etc that subclasses may have.
    AdvisedSupport copy = this;

    // If we're in a non-serializable subclass, copy into an AdvisedSupport object.
    if (!getClass().equals(AdvisedSupport.class)) {
        copy = new AdvisedSupport();
        copy.copyConfigurationFrom(this);
    }

    // May return this.
    return copy;
}