package votorola.a.web.wap; // Copyright 2011-2012, Michael Allan. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Votorola Software"), to deal in the Votorola Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Votorola Software, and to permit persons to whom the Votorola Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Votorola Software. THE VOTOROLA SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE VOTOROLA SOFTWARE OR THE USE OR OTHER DEALINGS IN THE VOTOROLA SOFTWARE. import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import votorola.g.lang.*; import votorola.g.web.*; /** An independent component within a composite request, incorporating a responder. */ public abstract @ThreadRestricted("constructor") class Call { /** The class initializer. This method is called once prior to first construction. * The implementation in the base class is empty and does nothing. */ public static @ThreadSafe void init( final WAP wap ) throws ServletException {} /** Constructs a Call. Each concrete subclass provides a constructor with the same * profile as this, except with public rather than protected access. In addition, * the subclass may provide a class initializer with the same profile as {@linkplain * #init(WAP) init}(wap). * * @see #prefix() * @see #req() */ protected Call( String _prefix, Requesting _req, ResponseConfiguration _resConfig ) throws HTTPRequestException { prefix = _prefix; req = _req; } // - C a l l -------------------------------------------------------------------------- /** The prefix assigned to this call. */ public final String prefix() { return prefix; } private final String prefix; /** The request context. */ public final Requesting req() { return req; } private final Requesting req; /** Responds to the call. */ public abstract void respond( final Responding res ) throws IOException; }