01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. 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: package org.apache.cocoon.components.thread;
18:
19: import EDU.oswego.cs.dl.util.concurrent.Channel;
20:
21: /**
22: * Wrapper around a Channel implementation for constructor convenience
23: *
24: * @author <a href="mailto:giacomo.at.apache.org">Giacomo Pati</a>
25: * @version $Id: ChannelWrapper.java 56702 2004-11-05 22:52:05Z giacomo $
26: */
27: public class ChannelWrapper implements Channel {
28: //~ Instance fields --------------------------------------------------------
29:
30: /** The wrapped Channel */
31: private Channel m_channel;
32:
33: //~ Methods ----------------------------------------------------------------
34:
35: /**
36: * DOCUMENT ME!
37: *
38: * @param channel DOCUMENT ME!
39: */
40: public void setChannel(final Channel channel) {
41: m_channel = channel;
42: }
43:
44: /**
45: * @see EDU.oswego.cs.dl.util.concurrent.Puttable#offer(java.lang.Object,
46: * long)
47: */
48: public boolean offer(final Object obj, final long timeout)
49: throws InterruptedException {
50: return m_channel.offer(obj, timeout);
51: }
52:
53: /**
54: * @see EDU.oswego.cs.dl.util.concurrent.Channel#peek()
55: */
56: public Object peek() {
57: return m_channel.peek();
58: }
59:
60: /**
61: * @see EDU.oswego.cs.dl.util.concurrent.Takable#poll(long)
62: */
63: public Object poll(final long timeout) throws InterruptedException {
64: return m_channel.poll(timeout);
65: }
66:
67: /**
68: * @see EDU.oswego.cs.dl.util.concurrent.Puttable#put(java.lang.Object)
69: */
70: public void put(final Object obj) throws InterruptedException {
71: m_channel.put(obj);
72: }
73:
74: /**
75: * @see EDU.oswego.cs.dl.util.concurrent.Takable#take()
76: */
77: public Object take() throws InterruptedException {
78: return m_channel.take();
79: }
80: }
|