01: package org.apache.ojb.broker.prevayler.demo;
02:
03: /* Copyright 2003-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: import org.apache.ojb.broker.PersistenceBroker;
19:
20: import java.io.BufferedReader;
21: import java.io.InputStreamReader;
22:
23: /**
24: * Insert the type's description here.
25: * Creation date: (04.03.2001 11:31:41)
26: * @author Thomas Mahler
27: */
28: public abstract class AbstractUseCase implements UseCase {
29: protected PersistenceBroker broker;
30:
31: /**
32: * AbstractUseCase constructor comment.
33: */
34: public AbstractUseCase(PersistenceBroker broker) {
35: this .broker = broker;
36: }
37:
38: /** perform this use case*/
39: public abstract void apply();
40:
41: /** get descriptive information on use case*/
42: public abstract String getDescription();
43:
44: /**
45: * read a single line from stdin and return as String
46: */
47: protected String readLineWithMessage(String message) {
48: System.out.print(message + " ");
49: try {
50: BufferedReader rin = new BufferedReader(
51: new InputStreamReader(System.in));
52: return rin.readLine();
53: } catch (Exception e) {
54: return "";
55: }
56: }
57: }
|