001 package org.shiftone.jrat.core.spi; 002 003 004 import org.shiftone.jrat.core.MethodKey; 005 006 007 /** 008 * @author jeff@shiftone.org (Jeff Drost) 009 */ 010 public interface MethodHandlerFactory { 011 012 /** 013 * Method createMethodHandler 014 * <li>this method on a handler will never be called more than once with 015 * the same methodKey (caching need only be done at one layer)</li> 016 * <li>if there is an error, or some reason not to column a handler - this 017 * method should log a message and return null (this allows chain handler to 018 * not log to several silent handlers)</li> 019 */ 020 MethodHandler createMethodHandler(MethodKey methodKey) throws Exception; 021 022 023 /** 024 * It is recommended that handler factories that require shutdown 025 * notification implement the ShutdownListener interface and call 026 * context.addShutdownListener(this) in their startup method. 027 * 028 * @see org.shiftone.jrat.core.shutdown.ShutdownListener 029 */ 030 void startup(RuntimeContext context) throws Exception; 031 }