KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > coldcore > coloradoftp > command > impl > CommandWrapper


1 package com.coldcore.coloradoftp.command.impl;
2
3 import com.coldcore.coloradoftp.command.Command;
4 import com.coldcore.coloradoftp.command.Reply;
5 import com.coldcore.coloradoftp.connection.ControlConnection;
6
7 /**
8  * Command wrapper.
9  * This class is for extensions wishing to operate on existing command
10  * and stay independent of future interface changes.
11  */

12 public class CommandWrapper implements Command {
13
14   protected Command command;
15
16
17   public CommandWrapper(Command command) {
18     super();
19     this.command = command;
20     if (command == null) throw new IllegalArgumentException JavaDoc("Invalid command");
21   }
22
23
24   public boolean processInInterruptState() {
25     return command.processInInterruptState();
26   }
27
28
29   public boolean canClearInterruptState() {
30     return command.canClearInterruptState();
31   }
32
33
34   public String JavaDoc getName() {
35     return command.getName();
36   }
37
38
39   public void setName(String JavaDoc name) {
40     command.setName(name);
41   }
42
43
44   public String JavaDoc getParameter() {
45     return command.getParameter();
46   }
47
48
49   public void setParameter(String JavaDoc parameter) {
50     command.setParameter(parameter);
51   }
52
53
54   public Reply execute() {
55     return command.execute();
56   }
57
58
59   public Reply executeOnParent(Command parent) {
60     return command.executeOnParent(parent);
61   }
62
63
64   public void setConnection(ControlConnection connection) {
65     command.setConnection(connection);
66   }
67
68
69   public ControlConnection getConnection() {
70     return command.getConnection();
71   }
72 }
73
Popular Tags