001 // Copyright 2008 Waterken Inc. under the terms of the MIT X license 002 // found at http://www.opensource.org/licenses/mit-license.html 003 package org.ref_send.promise; 004 005 import java.io.Serializable; 006 import java.lang.reflect.Method; 007 008 /** 009 * A log interface. 010 */ 011 public class 012 Log implements Serializable { 013 static private final long serialVersionUID = 1L; 014 015 /** 016 * Logs a comment. 017 * @param text comment text 018 */ 019 public void comment(String text) {} 020 021 /** 022 * Logs an exception. 023 * @param reason problem reason 024 */ 025 public void problem(Exception reason) {} 026 027 /** 028 * Logs receipt of a message. 029 * @param message message identifier 030 * @param concrete concrete type of invocation target 031 * @param method declaration of invoked method 032 */ 033 public void got(String message, Class<?> concrete, Method method) {} 034 035 /** 036 * Logs a message send. 037 * @param message sent message identifier 038 */ 039 public void sent(String message) {} 040 041 /** 042 * Logs sending of a return value. 043 * @param message return message identifier 044 */ 045 public void returned(String message) { sent(message); } 046 047 /** 048 * Logs a conditional message send. 049 * @param pipelined Is the message processed at the callee's site? 050 * @param message message identifier 051 * @param condition condition identifier 052 */ 053 public void sentIf(boolean pipelined, 054 String message, String condition) { sent(message); } 055 056 /** 057 * Logs resolution of a promise. 058 * @param condition condition identifier 059 */ 060 public void resolved(String condition) {} 061 062 /** 063 * Logs fulfillment of a promise. 064 * @param condition condition identifier 065 */ 066 public void fulfilled(String condition) { resolved(condition); } 067 068 /** 069 * Logs rejection of a promise. 070 * @param condition condition identifier 071 */ 072 public void rejected(String condition, Exception reason) { 073 resolved(condition); 074 } 075 076 /** 077 * Logs progress towards fulfillment of a promise. 078 * @param condition condition identifier 079 */ 080 public void progressed(String condition) { resolved(condition); } 081 }