01: //========================================================================
02: // Parts Copyright 2006 Mort Bay Consulting Pty. Ltd.
03: //------------------------------------------------------------------------
04: // Licensed under the Apache License, Version 2.0 (the "License");
05: // you may not use this file except in compliance with the License.
06: // You may obtain a copy of the License at
07: // http://www.apache.org/licenses/LICENSE-2.0
08: // Unless required by applicable law or agreed to in writing, software
09: // distributed under the License is distributed on an "AS IS" BASIS,
10: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11: // See the License for the specific language governing permissions and
12: // limitations under the License.
13: //========================================================================
14:
15: package org.mortbay.jetty.grizzly;
16:
17: import java.nio.ByteBuffer;
18: import com.sun.enterprise.web.connector.grizzly.SelectorThread;
19: import com.sun.enterprise.web.connector.grizzly.XAReadTask;
20: import com.sun.enterprise.web.connector.grizzly.algorithms.NoParsingAlgorithm;
21:
22: /**
23: * @author gregw
24: *
25: */
26: public class JettyStreamAlgorithm extends NoParsingAlgorithm {
27:
28: public JettyStreamAlgorithm() {
29: //System.err.println("JettyStreamAlgorithm");
30: }
31:
32: /**
33: * Do not do anything since Jetty will internally handle the ByteBuffer
34: * lifecycle.
35: */
36: public boolean parse(ByteBuffer byteBuffer) {
37: curLimit = byteBuffer.limit();
38: curPosition = byteBuffer.position();
39: byteBuffer.flip();
40: return true;
41: }
42:
43: public Class getReadTask(SelectorThread selectorThread) {
44: //System.err.println(this+" getReadTask()");
45: return JettyReadTask.class;
46: }
47:
48: }
|