001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.cocoon.components.web3.impl;
018:
019: import java.net.URL;
020: import java.util.Date;
021: import java.util.Properties;
022:
023: import org.apache.avalon.excalibur.pool.Poolable;
024: import org.apache.avalon.excalibur.pool.Recyclable;
025: import org.apache.avalon.framework.activity.Disposable;
026: import org.apache.avalon.framework.logger.AbstractLogEnabled;
027:
028: import org.apache.cocoon.components.web3.Web3Client;
029:
030: import com.sap.mw.jco.IRepository;
031: import com.sap.mw.jco.JCO;
032:
033: /**
034: * TBD
035: *
036: * @author <a href="mailto:michael.gerzabek@at.efp.cc">Michael Gerzabek</a>
037: * @since 2.1
038: * @version CVS $Id: Web3ClientImpl.java 524407 2007-03-31 10:59:28Z joerg $
039: */
040: public class Web3ClientImpl extends AbstractLogEnabled implements
041: Web3Client, Disposable, Recyclable, Poolable {
042:
043: protected JCO.Client client;
044: protected String repository;
045:
046: public void initClient(JCO.Client client) {
047: this .client = client;
048: this .repository = "" + (new Date()).getTime();
049: }
050:
051: public void releaseClient() {
052: JCO.releaseClient(this .client);
053: this .client = null;
054: this .repository = null;
055: }
056:
057: public void recycle() {
058: }
059:
060: public void dispose() {
061: }
062:
063: public IRepository getRepository() {
064: if (null != this .repository) {
065: return new JCO.Repository(this .repository, this .client);
066: }
067: return null;
068: }
069:
070: public void abort(String message) {
071: this .client.abort(message);
072: }
073:
074: public Object clone() {
075: return null;
076: }
077:
078: public void confirmTID(String tid) {
079: this .client.confirmTID(tid);
080: }
081:
082: public void connect() {
083: this .client.connect();
084: }
085:
086: public String createTID() {
087: return this .client.createTID();
088: }
089:
090: public void disconnect() {
091: this .client.disconnect();
092: }
093:
094: public void execute(JCO.Function function) {
095: this .client.execute(function);
096: }
097:
098: public void execute(JCO.Function function, String tid) {
099: this .client.execute(function, tid);
100: }
101:
102: public void execute(JCO.Function function, String tid,
103: String queue_name) {
104: this .client.execute(function, tid, queue_name);
105: }
106:
107: public void execute(JCO.Function function, String tid,
108: String queue_name, int queue_pos) {
109: this .client.execute(function, tid, queue_name, queue_pos);
110: }
111:
112: public void execute(String name, JCO.ParameterList input,
113: JCO.ParameterList output) {
114: this .client.execute(name, input, output);
115: }
116:
117: public void execute(String name, JCO.ParameterList input,
118: JCO.ParameterList output, JCO.ParameterList tables) {
119: this .client.execute(name, input, output, tables);
120: }
121:
122: public void execute(String name, JCO.ParameterList input,
123: JCO.ParameterList tables, String tid) {
124: this .client.execute(name, input, tables, tid);
125: }
126:
127: public void execute(java.lang.String name, JCO.ParameterList input,
128: JCO.ParameterList tables, String tid, String queue_name) {
129: this .client.execute(name, input, tables, tid, queue_name);
130: }
131:
132: public void execute(java.lang.String name, JCO.ParameterList input,
133: JCO.ParameterList tables, String tid, String queue_name,
134: int queue_pos) {
135: this .client.execute(name, input, tables, tid, queue_name,
136: queue_pos);
137: }
138:
139: public boolean getAbapDebug() {
140: return this .client.getAbapDebug();
141: }
142:
143: public String getASHost() {
144: return this .client.getASHost();
145: }
146:
147: public JCO.Attributes getAttributes() {
148: return this .client.getAttributes();
149: }
150:
151: public String getClient() {
152: return this .client.getClient();
153: }
154:
155: public String getGroup() {
156: return this .client.getGroup();
157: }
158:
159: public String getGWHost() {
160: return this .client.getGWHost();
161: }
162:
163: public String getGWServ() {
164: return this .client.getGWServ();
165: }
166:
167: public String getLanguage() {
168: return this .client.getLanguage();
169: }
170:
171: public String getMSHost() {
172: return this .client.getMSHost();
173: }
174:
175: public String[][] getPropertyInfo() {
176: return this .client.getPropertyInfo();
177: }
178:
179: public int getSapGui() {
180: return this .client.getSapGui();
181: }
182:
183: public byte getState() {
184: return this .client.getState();
185: }
186:
187: public String getSystemID() {
188: return this .client.getSystemID();
189: }
190:
191: public String getSystemNumber() {
192: return this .client.getSystemNumber();
193: }
194:
195: public String getTPName() {
196: return this .client.getTPName();
197: }
198:
199: public boolean getTrace() {
200: return this .client.getTrace();
201: }
202:
203: public URL getURL() {
204: return this .client.getURL();
205: }
206:
207: public String getUser() {
208: return this .client.getUser();
209: }
210:
211: public boolean isAlive() {
212: return this .client.isAlive();
213: }
214:
215: public void ping() {
216: this .client.ping();
217: }
218:
219: public void setAbapDebug(boolean debug) {
220: this .client.setAbapDebug(debug);
221: }
222:
223: public void setProperty(String key, String value) {
224: this .client.setProperty(key, value);
225: }
226:
227: public void setSapGui(int use_sapgui) {
228: this .client.setSapGui(use_sapgui);
229: }
230:
231: public void setTrace(boolean trace) {
232: this .client.setTrace(trace);
233: }
234:
235: public final Properties getProperties() {
236: return this .client.getProperties();
237: }
238:
239: public final String getProperty(String key) {
240: return this .client.getProperty(key);
241: }
242:
243: public boolean isValid() {
244: return this .client.isValid();
245: }
246:
247: public void setThroughput(JCO.Throughput throughput) {
248: this.client.setThroughput(throughput);
249: }
250:
251: }
|