/*
 * 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;

import org.jboss.logging.Logger;

/**
 * @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
 * @version $Revision: 1.1.6.3 $
 */
public class BeanCallback extends Callback
{
   private static final Logger log = Logger.getLogger(BeanCallback.class);
   
   public BeanCallback(Method callbackMethod)
   {
      super(callbackMethod);
   }

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

   public String toString()
   {
      StringBuffer sb = new StringBuffer(100);
      sb.append("[BeanCallback:");
      sb.append("method=").append(callbackMethod.getName());
      sb.append("]");
      return sb.toString();
   } 
}
