View Javadoc
1 /* 2 * $Id: AIMMessageTag.java,v 1.2 2003/10/02 01:27:16 smulube Exp $ 3 * 4 * ***** BEGIN LICENSE BLOCK ***** 5 * =========================================================================== 6 * Copyright (c) 2003 Sam Mulube 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy 9 * of this software and associated documentation files (the "Software"), to deal 10 * in the Software without restriction, including without limitation the rights 11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 * copies of the Software, and to permit persons to whom the Software is 13 * furnished to do so, subject to the following conditions: 14 * 15 * The above copyright notice and this permission notice shall be included in 16 * all copies or substantial portions of the Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 * SOFTWARE.COPYRIGHT AND PERMISSION NOTICE 25 * =========================================================================== 26 * ***** END LICENSE BLOCK ***** 27 */ 28 package org.zerofun.maven.im.jelly; 29 30 import org.apache.commons.jelly.JellyTagException; 31 import org.apache.commons.jelly.MissingAttributeException; 32 import org.apache.commons.jelly.TagSupport; 33 import org.apache.commons.jelly.XMLOutput; 34 import org.zerofun.maven.im.beans.AIMMessageBean; 35 36 /*** 37 * This class is the proxy which allows the Jelly script to invoke the 38 * functionality of the actual JavaBean class which provides the actual 39 * message sending functionality. 40 * 41 * @author <a href="mailto:sam@mulube.com">Sam Mulube</a> 42 * @version $Revision: 1.2 $ 43 * @see org.zerofun.maven.im.beans.AIMMessageBean 44 * 45 */ 46 public class AIMMessageTag extends TagSupport { 47 48 private AIMMessageBean bean = new AIMMessageBean(); 49 50 /*** 51 * @see org.apache.commons.jelly.Tag#doTag(org.apache.commons.jelly.XMLOutput) 52 */ 53 public void doTag(XMLOutput arg0) 54 throws MissingAttributeException, JellyTagException { 55 execute(); 56 } 57 58 /*** 59 * Invokes the main execute method of the contained bean that performs the 60 * actual message sending functionality. 61 * 62 * @throws JellyTagException 63 */ 64 private void execute() throws JellyTagException { 65 try { 66 bean.execute(); 67 } catch (Exception e) { 68 String message = "AIM message sending failed."; 69 throw new JellyTagException(message, e); 70 } 71 } 72 73 /*** 74 * Set by the <code>${maven.im.aim.from}</code> property. 75 * @param from the from String to set 76 * @see AIMMessageBean#setFrom(String) 77 * 78 */ 79 public void setFrom(String from) { 80 bean.setFrom(from); 81 } 82 83 /*** 84 * Set by the <code>${maven.im.message}</code> property. 85 * @param message the message string to set 86 * @see AIMMessageBean#setMessage(String) 87 */ 88 public void setMessage(String message) { 89 bean.setMessage(message); 90 } 91 92 /*** 93 * Set by the <code>${maven.im.aim.password}</code> property. 94 * @param password the password String to set 95 * @see AIMMessageBean#setPassword(String) 96 */ 97 public void setPassword(String password) { 98 bean.setPassword(password); 99 } 100 101 /*** 102 * Set by the <code>${maven.im.aim.to}</code> property. 103 * @param to the to String to set 104 * @see AIMMessageBean#setTo(String) 105 */ 106 public void setTo(String to) { 107 bean.setTo(to); 108 } 109 110 } 111 112 /* 113 * $Log: AIMMessageTag.java,v $ 114 * Revision 1.2 2003/10/02 01:27:16 smulube 115 * added better comments. 116 * 117 * Revision 1.1 2003/09/26 01:20:09 smulube 118 * tags, and library that provide basic functionality. 119 * 120 */

This page was automatically generated by Maven