From cac2c5761e2ebe8b14a3c03dd2ee756c1e14441b Mon Sep 17 00:00:00 2001 From: Jens Geyer Date: Mon, 25 Mar 2013 01:22:09 +0200 Subject: [PATCH] THRIFT-563 Support for Multiplexing Services on any Transport, Protocol and Server Patch: Rob Slifka Fixes broken build due to previous patch --- .../apache/thrift/TMultiplexedProcessor.java | 19 +++++++++++++ .../thrift/protocol/TMultiplexedProtocol.java | 19 +++++++++++++ .../thrift/protocol/TProtocolDecorator.java | 27 ++++++++++++++++--- 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/lib/java/src/org/apache/thrift/TMultiplexedProcessor.java b/lib/java/src/org/apache/thrift/TMultiplexedProcessor.java index 8547cf0c..dad61553 100644 --- a/lib/java/src/org/apache/thrift/TMultiplexedProcessor.java +++ b/lib/java/src/org/apache/thrift/TMultiplexedProcessor.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.apache.thrift; import org.apache.thrift.protocol.*; diff --git a/lib/java/src/org/apache/thrift/protocol/TMultiplexedProtocol.java b/lib/java/src/org/apache/thrift/protocol/TMultiplexedProtocol.java index 4b5e6718..35352749 100644 --- a/lib/java/src/org/apache/thrift/protocol/TMultiplexedProtocol.java +++ b/lib/java/src/org/apache/thrift/protocol/TMultiplexedProtocol.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.apache.thrift.protocol; import org.apache.thrift.TException; diff --git a/lib/java/src/org/apache/thrift/protocol/TProtocolDecorator.java b/lib/java/src/org/apache/thrift/protocol/TProtocolDecorator.java index 6190d135..2d29cd23 100644 --- a/lib/java/src/org/apache/thrift/protocol/TProtocolDecorator.java +++ b/lib/java/src/org/apache/thrift/protocol/TProtocolDecorator.java @@ -1,7 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.apache.thrift.protocol; import org.apache.thrift.TException; +import java.nio.ByteBuffer; + /** * TProtocolDecorator forwards all requests to an enclosed * TProtocol instance, providing a way to author concise @@ -106,8 +127,8 @@ public abstract class TProtocolDecorator extends TProtocol { concreteProtocol.writeString(s); } - public void writeBinary(byte[] bytes) throws TException { - concreteProtocol.writeBinary(bytes); + public void writeBinary(ByteBuffer buf) throws TException { + concreteProtocol.writeBinary(buf); } public TMessage readMessageBegin() throws TException { @@ -186,7 +207,7 @@ public abstract class TProtocolDecorator extends TProtocol { return concreteProtocol.readString(); } - public byte[] readBinary() throws TException { + public ByteBuffer readBinary() throws TException { return concreteProtocol.readBinary(); } } -- 2.17.1