/*
 * JBoss, the OpenSource EJB server
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.ejb3.callback;

import java.lang.reflect.Method;

/**
 * @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
 * @version $Revision: 1.1.6.3 $
 */
public class ListenerCallback extends Callback
{
   protected Object listener;

   public ListenerCallback(Method callbackMethod, Object listener)
   {
      super(callbackMethod);
      this.listener = listener;
   }

   public void invoke(Object bean)
   {
      try
      {
         callbackMethod.invoke(listener, new Object[]{bean});
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
   }

}
