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}; 025 * the event implements {@link org.apache.tapestry.describe.DescriptionReceiver}; 026 * classes (typically, HiveMind service implementations) that implement the 027 * listener interface will "describe" themselves to the event. 028 * 029 * @author Howard M. Lewis Ship 030 * @since 4.0 031 */ 032 public class ReportStatusEvent extends EventObject implements 033 DescriptionReceiver 034 { 035 036 /** 037 * serialVersionUID. 038 */ 039 private static final long serialVersionUID = 7546818328708861783L; 040 041 private final DescriptionReceiver _receiver; 042 043 public ReportStatusEvent(Object source, DescriptionReceiver receiver) 044 { 045 super(source); 046 047 Defense.notNull(receiver, "receiver"); 048 049 _receiver = receiver; 050 } 051 052 public void array(String key, Object[] values) 053 { 054 _receiver.array(key, values); 055 } 056 057 public void collection(String key, Collection values) 058 { 059 _receiver.collection(key, values); 060 } 061 062 public void describeAlternate(Object alternate) 063 { 064 _receiver.describeAlternate(alternate); 065 } 066 067 public void property(String key, boolean value) 068 { 069 _receiver.property(key, value); 070 } 071 072 public void property(String key, byte value) 073 { 074 _receiver.property(key, value); 075 } 076 077 public void property(String key, char value) 078 { 079 _receiver.property(key, value); 080 } 081 082 public void property(String key, double value) 083 { 084 _receiver.property(key, value); 085 } 086 087 public void property(String key, float value) 088 { 089 _receiver.property(key, value); 090 } 091 092 public void property(String key, int value) 093 { 094 _receiver.property(key, value); 095 } 096 097 public void property(String key, long value) 098 { 099 _receiver.property(key, value); 100 } 101 102 public void property(String key, Object value) 103 { 104 _receiver.property(key, value); 105 } 106 107 public void property(String key, short value) 108 { 109 _receiver.property(key, value); 110 } 111 112 public void section(String section) 113 { 114 _receiver.section(section); 115 } 116 117 public void title(String title) 118 { 119 _receiver.title(title); 120 } 121 }