1 16 package org.apache.cocoon.components.web3.impl; 17 18 import org.apache.cocoon.components.web3.Web3Client; 19 20 import org.apache.avalon.framework.logger.AbstractLogEnabled; 21 import org.apache.avalon.framework.activity.Disposable; 22 import org.apache.avalon.excalibur.pool.Recyclable; 23 import org.apache.avalon.excalibur.pool.Poolable; 24 25 import com.sap.mw.jco.JCO; 26 import com.sap.mw.jco.IRepository; 27 28 import java.net.URL ; 29 import java.util.Properties ; 30 import java.util.Date ; 31 32 39 public class Web3ClientImpl extends AbstractLogEnabled 40 implements Web3Client, Disposable, Recyclable, Poolable { 41 42 protected JCO.Client client = null; 43 protected String repository = null; 44 45 public void initClient(JCO.Client client) { 46 this.client = client; 47 this.repository = "" + (new Date ()).getTime(); 48 } 49 50 public void releaseClient() { 51 JCO.releaseClient(this.client); 52 this.client = null; 53 } 54 55 public void dispose() { 56 this.client = null; 57 this.repository = null; 58 } 59 60 public IRepository getRepository() { 61 if (null != this.repository) { 62 return new JCO.Repository (this.repository, this.client); 63 } 64 return null; 65 } 66 67 public void abort(String message) { 68 this.client.abort (message); 69 } 70 71 public Object clone() { 72 return null; 73 } 74 75 public void confirmTID(String tid) { 76 this.client.confirmTID (tid); 77 } 78 79 public void connect() { 80 this.client.connect (); 81 } 82 83 public String createTID() { 84 return this.client.createTID (); 85 } 86 87 public void disconnect() { 88 this.client.disconnect (); 89 } 90 91 public void execute(JCO.Function function) { 92 this.client.execute (function); 93 } 94 95 public void execute(JCO.Function function, String tid) { 96 this.client.execute (function, tid); 97 } 98 99 public void execute(JCO.Function function, String tid, String queue_name) { 100 this.client.execute (function, tid, queue_name); 101 } 102 103 public void execute(JCO.Function function, String tid, 104 String queue_name, int queue_pos) { 105 this.client.execute (function, tid, queue_name, queue_pos); 106 } 107 108 public void execute(String name, JCO.ParameterList input, 109 JCO.ParameterList output) { 110 this.client.execute (name, input, output); 111 } 112 113 public void execute(String name, JCO.ParameterList input, 114 JCO.ParameterList output, JCO.ParameterList tables) { 115 this.client.execute (name, input, output, tables); 116 } 117 118 public void execute(String name, JCO.ParameterList input, 119 JCO.ParameterList tables, String tid) { 120 this.client.execute (name, input, tables, tid); 121 } 122 123 public void execute(java.lang.String name, JCO.ParameterList input, 124 JCO.ParameterList tables, String tid, 125 String queue_name) { 126 this.client.execute (name, input, tables, tid, queue_name); 127 } 128 129 public void execute(java.lang.String name, JCO.ParameterList input, 130 JCO.ParameterList tables, String tid, 131 String queue_name, int queue_pos) { 132 this.client.execute (name, input, tables, tid, queue_name, queue_pos); 133 } 134 135 public boolean getAbapDebug() { 136 return this.client.getAbapDebug (); 137 } 138 139 public String getASHost() { 140 return this.client.getASHost (); 141 } 142 143 public JCO.Attributes getAttributes() { 144 return this.client.getAttributes (); 145 } 146 147 public String getClient() { 148 return this.client.getClient (); 149 } 150 151 public String getGroup() { 152 return this.client.getGroup (); 153 } 154 155 public String getGWHost() { 156 return this.client.getGWHost (); 157 } 158 159 public String getGWServ() { 160 return this.client.getGWServ (); 161 } 162 163 public String getLanguage() { 164 return this.client.getLanguage (); 165 } 166 167 public String getMSHost() { 168 return this.client.getMSHost (); 169 } 170 171 public String [][] getPropertyInfo() { 172 return this.client.getPropertyInfo (); 173 } 174 175 public int getSapGui() { 176 return this.client.getSapGui (); 177 } 178 179 public byte getState() { 180 return this.client.getState (); 181 } 182 183 public String getSystemID() { 184 return this.client.getSystemID (); 185 } 186 187 public String getSystemNumber() { 188 return this.client.getSystemNumber (); 189 } 190 191 public String getTPName() { 192 return this.client.getTPName (); 193 } 194 195 public boolean getTrace() { 196 return this.client.getTrace (); 197 } 198 199 public URL getURL() { 200 return this.client.getURL (); 201 } 202 203 public String getUser() { 204 return this.client.getUser (); 205 } 206 207 public boolean isAlive() { 208 return this.client.isAlive (); 209 } 210 211 public void ping() { 212 this.client.ping (); 213 } 214 215 public void setAbapDebug(boolean debug) { 216 this.client.setAbapDebug (debug); 217 } 218 219 public void setProperty(String key, String value) { 220 this.client.setProperty (key, value); 221 } 222 223 public void setSapGui(int use_sapgui) { 224 this.client.setSapGui (use_sapgui); 225 } 226 227 public void setTrace(boolean trace) { 228 this.client.setTrace (trace); 229 } 230 231 public final Properties getProperties() { 232 return this.client.getProperties (); 233 } 234 235 public final String getProperty(String key) { 236 return this.client.getProperty (key); 237 } 238 239 public boolean isValid() { 240 return this.client.isValid (); 241 } 242 243 public void setThroughput(JCO.Throughput throughput) { 244 this.client.setThroughput (throughput); 245 } 246 247 public void recycle() { 248 this.client = null; 249 this.repository = null; 250 } 251 252 } 253 | Popular Tags |