1 package org.apache.ojb.broker.prevayler.demo; 2 3 17 18 import org.apache.ojb.broker.PersistenceBroker; 19 20 import java.io.BufferedReader ; 21 import java.io.InputStreamReader ; 22 23 28 public abstract class AbstractUseCase implements UseCase 29 { 30 protected PersistenceBroker broker; 31 32 35 public AbstractUseCase(PersistenceBroker broker) 36 { 37 this.broker = broker; 38 } 39 40 41 public abstract void apply(); 42 43 44 public abstract String getDescription(); 45 46 49 protected String readLineWithMessage(String message) 50 { 51 System.out.print(message + " "); 52 try 53 { 54 BufferedReader rin = new BufferedReader (new InputStreamReader (System.in)); 55 return rin.readLine(); 56 } 57 catch (Exception e) 58 { 59 return ""; 60 } 61 } 62 } 63 | Popular Tags |