hammant 2003/01/09 16:33:32 Modified: sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty PhoenixLogSink.java SevakServletHolder.java SevakWebApplicationContext.java Log: Some comments and corrections of mthod usage (suggests from Greg W). Revision Changes Path 1.2 +41 -8 jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty/PhoenixLogSink.java Index: PhoenixLogSink.java =================================================================== RCS file: /home/cvs/jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty/PhoenixLogSink.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PhoenixLogSink.java 1 Oct 2002 19:58:47 -0000 1.1 +++ PhoenixLogSink.java 10 Jan 2003 00:33:32 -0000 1.2 @@ -23,15 +23,48 @@ */ public class PhoenixLogSink extends AbstractLogEnabled implements LogSink { + + /** + * Stop (unimpled) + * @throws InterruptedException + */ + public void stop() throws InterruptedException + { + } + + /** + * Is this started (always) + * @return + */ + public boolean isStarted() + { + return true; + } + + /** + * Set Options (un implemented) + * @param s the options + */ public void setOptions(String s) { } + /** + * Get Option (unimplemented) + * @return the options + */ public String getOptions() { return ""; } + /** + * Log something + * @param type the type of message + * @param message the message + * @param frame the frame + * @param time the time + */ public void log(String type, Object message, Frame frame, long time) { if (type.equals(Log.DEBUG)) @@ -56,21 +89,21 @@ } } + /** + * Log a message + * @param message the Message + */ public void log(String message) { getLogger().info(message); } + /** + * Start a logger (unimpled) + * @throws Exception + */ public void start() throws Exception { } - public void stop() throws InterruptedException - { - } - - public boolean isStarted() - { - return true; - } } 1.2 +14 -0 jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty/SevakServletHolder.java Index: SevakServletHolder.java =================================================================== RCS file: /home/cvs/jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty/SevakServletHolder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SevakServletHolder.java 9 Jan 2003 07:42:49 -0000 1.1 +++ SevakServletHolder.java 10 Jan 2003 00:33:32 -0000 1.2 @@ -26,6 +26,14 @@ { private ServiceManager m_serviceManager; + /** + * Construct a Servlet Holder + * @param serviceManager the service manager + * @param handler the handler + * @param name the name + * @param className the class name + * @param forcedPath the forced path + */ public SevakServletHolder(ServiceManager serviceManager, SevakWebApplicationHandler handler, String name, String className, String forcedPath) { // this constructor public or protected... @@ -33,6 +41,12 @@ m_serviceManager = serviceManager; } + /** + * Create a new instance + * @return the instance + * @throws InstantiationException if a prob + * @throws IllegalAccessException if a prob + */ public synchronized Object newInstance() throws InstantiationException, IllegalAccessException { if(_class == null) throw new InstantiationException("No class for " + this); 1.3 +3 -24 jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty/SevakWebApplicationContext.java Index: SevakWebApplicationContext.java =================================================================== RCS file: /home/cvs/jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty/SevakWebApplicationContext.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SevakWebApplicationContext.java 9 Jan 2003 07:42:49 -0000 1.2 +++ SevakWebApplicationContext.java 10 Jan 2003 00:33:32 -0000 1.3 @@ -40,8 +40,10 @@ m_sarRoot = sarRoot; m_phoenixLib = new File(sarRoot.getParentFile().getParentFile(),"lib"); m_serviceManager = serviceManager; - } + addHandler(0, new SevakWebApplicationHandler(m_serviceManager)); + + } /** * Make a classpath for Jasper to use during compilation. This is minimalist @@ -55,29 +57,6 @@ classpath += new File(m_sarRoot, "jsplibs" + File.separator + "javax.servlet.jar") + File.pathSeparator; classpath += new File(m_phoenixLib, "tools.jar"); return classpath; - } - - public synchronized ServletHandler getServletHandler() { -// super.getServletHandler(); - -// ServletHandler shandler = (ServletHandler)getHandler(org.mortbay.jetty.servlet.ServletHandler.class); -// if(shandler == null) { -// shandler = new SevakServletHandler(serviceManager); -// addHandler(shandler); -// } -// return shandler; - - if(_webAppHandler == null) { - _webAppHandler = (WebApplicationHandler)getHandler(SevakWebApplicationHandler.class); - if(_webAppHandler == null) { - if(getHandler(org.mortbay.jetty.servlet.ServletHandler.class) != null) - throw new IllegalStateException("Cannot have ServletHandler in WebApplicationContext"); - _webAppHandler = new SevakWebApplicationHandler(m_serviceManager); - addHandler(_webAppHandler); - } - } - return _webAppHandler; - } }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>