/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.aspects.versioned;

import org.jboss.aop.joinpoint.ConstructorInvocation;

/**
 *
 *  @author <a href="mailto:bill@jboss.org">Bill Burke</a>
 *  @version $Revision: 1.2.2.3 $
 */
public class VersionedConstructorInterceptor implements org.jboss.aop.advice.Interceptor
{
   public String getName() { return "VersionedConstructorInterceptor"; }

   public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable
   {
      if (!(invocation instanceof ConstructorInvocation)) return invocation.invokeNext();

      Object response = invocation.invokeNext();
      return Versioned.makeVersioned(response);
   }
   
}
