001 // Copyright 2005 The Apache Software Foundation 002 // 003 // Licensed under the Apache License, Version 2.0 (the "License"); 004 // you may not use this file except in compliance with the License. 005 // You may obtain a copy of the License at 006 // 007 // http://www.apache.org/licenses/LICENSE-2.0 008 // 009 // Unless required by applicable law or agreed to in writing, software 010 // distributed under the License is distributed on an "AS IS" BASIS, 011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 012 // See the License for the specific language governing permissions and 013 // limitations under the License. 014 015 package org.apache.tapestry.event; 016 017 import java.util.Collection; 018 import java.util.EventObject; 019 020 import org.apache.hivemind.util.Defense; 021 import org.apache.tapestry.describe.DescriptionReceiver; 022 023 /** 024 * Event object used by {@link org.apache.tapestry.event.ReportStatusListener}; the event 025 * implements {@link org.apache.tapestry.describe.DescriptionReceiver}; classes (typically, 026 * HiveMind service implementations) that implement the listener interface will "describe" 027 * themselves to the event. 028 * 029 * @author Howard M. Lewis Ship 030 * @since 4.0 031 */ 032 public class ReportStatusEvent extends EventObject implements DescriptionReceiver 033 { 034 private final DescriptionReceiver _receiver; 035 036 public ReportStatusEvent(Object source, DescriptionReceiver receiver) 037 { 038 super(source); 039 040 Defense.notNull(receiver, "receiver"); 041 042 _receiver = receiver; 043 } 044 045 public void array(String key, Object[] values) 046 { 047 _receiver.array(key, values); 048 } 049 050 public void collection(String key, Collection values) 051 { 052 _receiver.collection(key, values); 053 } 054 055 public void describeAlternate(Object alternate) 056 { 057 _receiver.describeAlternate(alternate); 058 } 059 060 public void property(String key, boolean value) 061 { 062 _receiver.property(key, value); 063 } 064 065 public void property(String key, byte value) 066 { 067 _receiver.property(key, value); 068 } 069 070 public void property(String key, char value) 071 { 072 _receiver.property(key, value); 073 } 074 075 public void property(String key, double value) 076 { 077 _receiver.property(key, value); 078 } 079 080 public void property(String key, float value) 081 { 082 _receiver.property(key, value); 083 } 084 085 public void property(String key, int value) 086 { 087 _receiver.property(key, value); 088 } 089 090 public void property(String key, long value) 091 { 092 _receiver.property(key, value); 093 } 094 095 public void property(String key, Object value) 096 { 097 _receiver.property(key, value); 098 } 099 100 public void property(String key, short value) 101 { 102 _receiver.property(key, value); 103 } 104 105 public void section(String section) 106 { 107 _receiver.section(section); 108 } 109 110 public void title(String title) 111 { 112 _receiver.title(title); 113 } 114 }