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

import org.jboss.aop.Advisor;
import org.jboss.aop.InstanceAdvisor;
import org.jboss.aop.advice.AspectFactory;
import org.jboss.aop.joinpoint.Joinpoint;
import org.jboss.aspects.remoting.ReplicantsManagerInterceptor;
import org.jboss.ejb3.SessionContainer;

/**
 * Comment
 *
 * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
 * @version $Revision: 1.1.6.3 $
 */
public class ReplicantsManagerInterceptorFactory implements AspectFactory
{
   public Object createPerVM()
   {
      throw new RuntimeException("IMPROPER USAGE");
   }

   public Object createPerClass(Advisor advisor)
   {
      SessionContainer container = (SessionContainer) advisor;
      return new ReplicantsManagerInterceptor(container.getClusterFamilies());
   }

   public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
   {
      throw new RuntimeException("IMPROPER USAGE");
   }

   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
   {
      throw new RuntimeException("IMPROPER USAGE");
   }

   public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
   {
      throw new RuntimeException("IMPROPER USAGE");
   }

   public String getName()
   {
      return this.getClass().getName();
   }
}
