001 /* 002 * Copyright 2007-2008 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.rice.kcb.deliverer.impl; 017 018 import java.util.HashMap; 019 import java.util.LinkedHashMap; 020 021 import org.kuali.rice.kcb.bo.MessageDelivery; 022 import org.kuali.rice.kcb.deliverer.MessageDeliverer; 023 import org.kuali.rice.kcb.exception.ErrorList; 024 import org.kuali.rice.kcb.exception.MessageDeliveryException; 025 import org.kuali.rice.kcb.exception.MessageDismissalException; 026 027 /** 028 * A message deliverer that just throws runtime exceptions 029 * 030 * @author Kuali Rice Team (rice.collab@kuali.org) 031 */ 032 public class BrokenMessageDeliverer implements MessageDeliverer { 033 034 /** 035 * @see org.kuali.rice.kcb.deliverer.MessageDeliverer#deliver(org.kuali.rice.kcb.bo.MessageDelivery) 036 */ 037 public void deliver(MessageDelivery messageDelivery) throws MessageDeliveryException { 038 throw new RuntimeException("Intentional exception on deliver"); 039 } 040 041 /** 042 * @see org.kuali.rice.kcb.deliverer.MessageDeliverer#dismiss(org.kuali.rice.kcb.bo.MessageDelivery, java.lang.String, java.lang.String) 043 */ 044 public void dismiss(MessageDelivery messageDelivery, String user, String cause) throws MessageDismissalException { 045 throw new RuntimeException("Intentional exception on dismiss"); 046 } 047 048 /** 049 * @see org.kuali.rice.kcb.deliverer.MessageDeliverer#getDescription() 050 */ 051 public String getDescription() { 052 // TODO arh14 - THIS METHOD NEEDS JAVADOCS 053 return null; 054 } 055 056 /** 057 * @see org.kuali.rice.kcb.deliverer.MessageDeliverer#getName() 058 */ 059 public String getName() { 060 return "BrokenMessageDeliverer"; 061 } 062 063 /** 064 * @see org.kuali.rice.kcb.deliverer.MessageDeliverer#getPreferenceKeys() 065 */ 066 public LinkedHashMap<String, String> getPreferenceKeys() { 067 return new LinkedHashMap<String, String>(0); 068 } 069 070 /** 071 * @see org.kuali.rice.kcb.deliverer.MessageDeliverer#getTitle() 072 */ 073 public String getTitle() { 074 return "Broken Message Deliverer"; 075 } 076 077 /** 078 * @see org.kuali.rice.kcb.deliverer.MessageDeliverer#validatePreferenceValues(java.util.HashMap) 079 */ 080 public void validatePreferenceValues(HashMap<String, String> prefs) throws ErrorList { 081 } 082 }