KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > web3 > impl > Web3ClientImpl


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

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 JavaDoc;
29 import java.util.Properties JavaDoc;
30 import java.util.Date JavaDoc;
31
32 /**
33  * The standard interface for R3Clients in Web3.
34  *
35  * @author <a HREF="mailto:michael.gerzabek@at.efp.cc">Michael Gerzabek</a>
36  * @since 2.1
37  * @version CVS $Id: Web3ClientImpl.java 30932 2004-07-29 17:35:38Z vgritsenko $
38  */

39 public class Web3ClientImpl extends AbstractLogEnabled
40 implements Web3Client, Disposable, Recyclable, Poolable {
41
42     protected JCO.Client client = null;
43     protected String JavaDoc repository = null;
44         
45     public void initClient(JCO.Client client) {
46         this.client = client;
47         this.repository = "" + (new Date JavaDoc ()).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 JavaDoc message) {
68         this.client.abort (message);
69     }
70     
71     public Object JavaDoc clone() {
72         return null;
73     }
74     
75     public void confirmTID(String JavaDoc tid) {
76         this.client.confirmTID (tid);
77     }
78     
79     public void connect() {
80         this.client.connect ();
81     }
82     
83     public String JavaDoc 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 JavaDoc tid) {
96         this.client.execute (function, tid);
97     }
98     
99     public void execute(JCO.Function function, String JavaDoc tid, String JavaDoc queue_name) {
100         this.client.execute (function, tid, queue_name);
101     }
102     
103     public void execute(JCO.Function function, String JavaDoc tid,
104                         String JavaDoc queue_name, int queue_pos) {
105         this.client.execute (function, tid, queue_name, queue_pos);
106     }
107     
108     public void execute(String JavaDoc name, JCO.ParameterList input,
109                         JCO.ParameterList output) {
110         this.client.execute (name, input, output);
111     }
112     
113     public void execute(String JavaDoc 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 JavaDoc name, JCO.ParameterList input,
119                         JCO.ParameterList tables, String JavaDoc tid) {
120         this.client.execute (name, input, tables, tid);
121     }
122     
123     public void execute(java.lang.String JavaDoc name, JCO.ParameterList input,
124                         JCO.ParameterList tables, String JavaDoc tid,
125                         String JavaDoc queue_name) {
126         this.client.execute (name, input, tables, tid, queue_name);
127     }
128     
129     public void execute(java.lang.String JavaDoc name, JCO.ParameterList input,
130                         JCO.ParameterList tables, String JavaDoc tid,
131                         String JavaDoc 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 JavaDoc getASHost() {
140         return this.client.getASHost ();
141     }
142
143     public JCO.Attributes getAttributes() {
144         return this.client.getAttributes ();
145     }
146     
147     public String JavaDoc getClient() {
148         return this.client.getClient ();
149     }
150     
151     public String JavaDoc getGroup() {
152         return this.client.getGroup ();
153     }
154     
155     public String JavaDoc getGWHost() {
156         return this.client.getGWHost ();
157     }
158
159     public String JavaDoc getGWServ() {
160         return this.client.getGWServ ();
161     }
162     
163     public String JavaDoc getLanguage() {
164         return this.client.getLanguage ();
165     }
166     
167     public String JavaDoc getMSHost() {
168         return this.client.getMSHost ();
169     }
170     
171     public String JavaDoc[][] 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 JavaDoc getSystemID() {
184         return this.client.getSystemID ();
185     }
186     
187     public String JavaDoc getSystemNumber() {
188         return this.client.getSystemNumber ();
189     }
190     
191     public String JavaDoc getTPName() {
192         return this.client.getTPName ();
193     }
194     
195     public boolean getTrace() {
196         return this.client.getTrace ();
197     }
198     
199     public URL JavaDoc getURL() {
200         return this.client.getURL ();
201     }
202     
203     public String JavaDoc 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 JavaDoc key, String JavaDoc 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 JavaDoc getProperties() {
232         return this.client.getProperties ();
233     }
234     
235     public final String JavaDoc getProperty(String JavaDoc 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