Repository: camel Updated Branches: refs/heads/master 64e738852 -> 7cd23b0a3
http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java ---------------------------------------------------------------------- diff --git a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java new file mode 100644 index 0000000..5e08c16 --- /dev/null +++ b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java @@ -0,0 +1,735 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.camel.dataformat.thrift.generated; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +/** + * Structs are the basic complex data structures. They are comprised of fields + * which each have an integer identifier, a type, a symbolic name, and an + * optional default value. + * + * Fields can be declared "optional", which ensures they will not be included + * in the serialized output if they aren't set. Note that this requires some + * manual management in some languages. + */ +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-05-30") +public class Work implements org.apache.thrift.TBase<Work, Work._Fields>, java.io.Serializable, Cloneable, Comparable<Work> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Work"); + + private static final org.apache.thrift.protocol.TField NUM1_FIELD_DESC = new org.apache.thrift.protocol.TField("num1", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField NUM2_FIELD_DESC = new org.apache.thrift.protocol.TField("num2", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField OP_FIELD_DESC = new org.apache.thrift.protocol.TField("op", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new WorkStandardSchemeFactory()); + schemes.put(TupleScheme.class, new WorkTupleSchemeFactory()); + } + + public int num1; // required + public int num2; // required + /** + * + * @see Operation + */ + public Operation op; // required + public String comment; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NUM1((short)1, "num1"), + NUM2((short)2, "num2"), + /** + * + * @see Operation + */ + OP((short)3, "op"), + COMMENT((short)4, "comment"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NUM1 + return NUM1; + case 2: // NUM2 + return NUM2; + case 3: // OP + return OP; + case 4: // COMMENT + return COMMENT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __NUM1_ISSET_ID = 0; + private static final int __NUM2_ISSET_ID = 1; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.COMMENT}; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NUM1, new org.apache.thrift.meta_data.FieldMetaData("num1", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.NUM2, new org.apache.thrift.meta_data.FieldMetaData("num2", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.OP, new org.apache.thrift.meta_data.FieldMetaData("op", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Operation.class))); + tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Work.class, metaDataMap); + } + + public Work() { + this.num1 = 0; + + } + + public Work( + int num1, + int num2, + Operation op) + { + this(); + this.num1 = num1; + setNum1IsSet(true); + this.num2 = num2; + setNum2IsSet(true); + this.op = op; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public Work(Work other) { + __isset_bitfield = other.__isset_bitfield; + this.num1 = other.num1; + this.num2 = other.num2; + if (other.isSetOp()) { + this.op = other.op; + } + if (other.isSetComment()) { + this.comment = other.comment; + } + } + + public Work deepCopy() { + return new Work(this); + } + + @Override + public void clear() { + this.num1 = 0; + + setNum2IsSet(false); + this.num2 = 0; + this.op = null; + this.comment = null; + } + + public int getNum1() { + return this.num1; + } + + public Work setNum1(int num1) { + this.num1 = num1; + setNum1IsSet(true); + return this; + } + + public void unsetNum1() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM1_ISSET_ID); + } + + /** Returns true if field num1 is set (has been assigned a value) and false otherwise */ + public boolean isSetNum1() { + return EncodingUtils.testBit(__isset_bitfield, __NUM1_ISSET_ID); + } + + public void setNum1IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM1_ISSET_ID, value); + } + + public int getNum2() { + return this.num2; + } + + public Work setNum2(int num2) { + this.num2 = num2; + setNum2IsSet(true); + return this; + } + + public void unsetNum2() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM2_ISSET_ID); + } + + /** Returns true if field num2 is set (has been assigned a value) and false otherwise */ + public boolean isSetNum2() { + return EncodingUtils.testBit(__isset_bitfield, __NUM2_ISSET_ID); + } + + public void setNum2IsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM2_ISSET_ID, value); + } + + /** + * + * @see Operation + */ + public Operation getOp() { + return this.op; + } + + /** + * + * @see Operation + */ + public Work setOp(Operation op) { + this.op = op; + return this; + } + + public void unsetOp() { + this.op = null; + } + + /** Returns true if field op is set (has been assigned a value) and false otherwise */ + public boolean isSetOp() { + return this.op != null; + } + + public void setOpIsSet(boolean value) { + if (!value) { + this.op = null; + } + } + + public String getComment() { + return this.comment; + } + + public Work setComment(String comment) { + this.comment = comment; + return this; + } + + public void unsetComment() { + this.comment = null; + } + + /** Returns true if field comment is set (has been assigned a value) and false otherwise */ + public boolean isSetComment() { + return this.comment != null; + } + + public void setCommentIsSet(boolean value) { + if (!value) { + this.comment = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NUM1: + if (value == null) { + unsetNum1(); + } else { + setNum1((Integer)value); + } + break; + + case NUM2: + if (value == null) { + unsetNum2(); + } else { + setNum2((Integer)value); + } + break; + + case OP: + if (value == null) { + unsetOp(); + } else { + setOp((Operation)value); + } + break; + + case COMMENT: + if (value == null) { + unsetComment(); + } else { + setComment((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NUM1: + return getNum1(); + + case NUM2: + return getNum2(); + + case OP: + return getOp(); + + case COMMENT: + return getComment(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case NUM1: + return isSetNum1(); + case NUM2: + return isSetNum2(); + case OP: + return isSetOp(); + case COMMENT: + return isSetComment(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Work) + return this.equals((Work)that); + return false; + } + + public boolean equals(Work that) { + if (that == null) + return false; + + boolean this_present_num1 = true; + boolean that_present_num1 = true; + if (this_present_num1 || that_present_num1) { + if (!(this_present_num1 && that_present_num1)) + return false; + if (this.num1 != that.num1) + return false; + } + + boolean this_present_num2 = true; + boolean that_present_num2 = true; + if (this_present_num2 || that_present_num2) { + if (!(this_present_num2 && that_present_num2)) + return false; + if (this.num2 != that.num2) + return false; + } + + boolean this_present_op = true && this.isSetOp(); + boolean that_present_op = true && that.isSetOp(); + if (this_present_op || that_present_op) { + if (!(this_present_op && that_present_op)) + return false; + if (!this.op.equals(that.op)) + return false; + } + + boolean this_present_comment = true && this.isSetComment(); + boolean that_present_comment = true && that.isSetComment(); + if (this_present_comment || that_present_comment) { + if (!(this_present_comment && that_present_comment)) + return false; + if (!this.comment.equals(that.comment)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List<Object> list = new ArrayList<Object>(); + + boolean present_num1 = true; + list.add(present_num1); + if (present_num1) + list.add(num1); + + boolean present_num2 = true; + list.add(present_num2); + if (present_num2) + list.add(num2); + + boolean present_op = true && (isSetOp()); + list.add(present_op); + if (present_op) + list.add(op.getValue()); + + boolean present_comment = true && (isSetComment()); + list.add(present_comment); + if (present_comment) + list.add(comment); + + return list.hashCode(); + } + + @Override + public int compareTo(Work other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetNum1()).compareTo(other.isSetNum1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNum1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num1, other.num1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNum2()).compareTo(other.isSetNum2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNum2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num2, other.num2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOp()).compareTo(other.isSetOp()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOp()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.op, other.op); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetComment()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.comment, other.comment); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Work("); + boolean first = true; + + sb.append("num1:"); + sb.append(this.num1); + first = false; + if (!first) sb.append(", "); + sb.append("num2:"); + sb.append(this.num2); + first = false; + if (!first) sb.append(", "); + sb.append("op:"); + if (this.op == null) { + sb.append("null"); + } else { + sb.append(this.op); + } + first = false; + if (isSetComment()) { + if (!first) sb.append(", "); + sb.append("comment:"); + if (this.comment == null) { + sb.append("null"); + } else { + sb.append(this.comment); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class WorkStandardSchemeFactory implements SchemeFactory { + public WorkStandardScheme getScheme() { + return new WorkStandardScheme(); + } + } + + private static class WorkStandardScheme extends StandardScheme<Work> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Work struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NUM1 + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.num1 = iprot.readI32(); + struct.setNum1IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NUM2 + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.num2 = iprot.readI32(); + struct.setNum2IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // OP + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.op = org.apache.camel.dataformat.thrift.generated.Operation.findByValue(iprot.readI32()); + struct.setOpIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // COMMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.comment = iprot.readString(); + struct.setCommentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, Work struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(NUM1_FIELD_DESC); + oprot.writeI32(struct.num1); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(NUM2_FIELD_DESC); + oprot.writeI32(struct.num2); + oprot.writeFieldEnd(); + if (struct.op != null) { + oprot.writeFieldBegin(OP_FIELD_DESC); + oprot.writeI32(struct.op.getValue()); + oprot.writeFieldEnd(); + } + if (struct.comment != null) { + if (struct.isSetComment()) { + oprot.writeFieldBegin(COMMENT_FIELD_DESC); + oprot.writeString(struct.comment); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class WorkTupleSchemeFactory implements SchemeFactory { + public WorkTupleScheme getScheme() { + return new WorkTupleScheme(); + } + } + + private static class WorkTupleScheme extends TupleScheme<Work> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Work struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetNum1()) { + optionals.set(0); + } + if (struct.isSetNum2()) { + optionals.set(1); + } + if (struct.isSetOp()) { + optionals.set(2); + } + if (struct.isSetComment()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetNum1()) { + oprot.writeI32(struct.num1); + } + if (struct.isSetNum2()) { + oprot.writeI32(struct.num2); + } + if (struct.isSetOp()) { + oprot.writeI32(struct.op.getValue()); + } + if (struct.isSetComment()) { + oprot.writeString(struct.comment); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Work struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.num1 = iprot.readI32(); + struct.setNum1IsSet(true); + } + if (incoming.get(1)) { + struct.num2 = iprot.readI32(); + struct.setNum2IsSet(true); + } + if (incoming.get(2)) { + struct.op = org.apache.camel.dataformat.thrift.generated.Operation.findByValue(iprot.readI32()); + struct.setOpIsSet(true); + } + if (incoming.get(3)) { + struct.comment = iprot.readString(); + struct.setCommentIsSet(true); + } + } + } + +} + http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/components/camel-thrift/src/test/resources/log4j2.properties ---------------------------------------------------------------------- diff --git a/components/camel-thrift/src/test/resources/log4j2.properties b/components/camel-thrift/src/test/resources/log4j2.properties new file mode 100644 index 0000000..e4e64cb --- /dev/null +++ b/components/camel-thrift/src/test/resources/log4j2.properties @@ -0,0 +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. +## --------------------------------------------------------------------------- + +appender.file.type = File +appender.file.name = file +appender.file.fileName = target/camel-thrift-test.log +appender.file.layout.type = PatternLayout +appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n +appender.out.type = Console +appender.out.name = out +appender.out.layout.type = PatternLayout +appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n +rootLogger.level = INFO +rootLogger.appenderRef.file.ref = file http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/components/camel-thrift/src/test/resources/org/apache/camel/dataformat/thrift/springDataFormat.xml ---------------------------------------------------------------------- diff --git a/components/camel-thrift/src/test/resources/org/apache/camel/dataformat/thrift/springDataFormat.xml b/components/camel-thrift/src/test/resources/org/apache/camel/dataformat/thrift/springDataFormat.xml new file mode 100644 index 0000000..aa371ed --- /dev/null +++ b/components/camel-thrift/src/test/resources/org/apache/camel/dataformat/thrift/springDataFormat.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> + <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> + <dataFormats> + <thrift id="thrift1" instanceClass="org.apache.camel.dataformat.thrift.generated.Work"/> + </dataFormats> + <route id="_route1"> + <from id="_from1" uri="direct:in"/> + <marshal id="_marshal1"> + <thrift instanceClass="org.apache.camel.dataformat.thrift.generated.Work"/> + </marshal> + </route> + <route id="_route2"> + <from id="_from2" uri="direct:back"/> + <unmarshal id="_unmarshal2"> + <thrift instanceClass="org.apache.camel.dataformat.thrift.generated.Work"/> + </unmarshal> + <to id="_to1" uri="mock:reverse"/> + </route> + <route id="_route3"> + <from id="_from3" uri="direct:marshal"/> + <marshal id="_marshal3" ref="thrift1"/> + </route> + <route id="_route4"> + <from id="_from4" uri="direct:unmarshalA"/> + <unmarshal id="_unmarshal4" ref="thrift1"/> + <to id="_to2" uri="mock:reverse"/> + </route> + <route id="_route5"> + <from id="_from5" uri="direct:unmarshalB"/> + <unmarshal id="_unmarshal5" ref="thrift1"/> + <to id="_to3" uri="mock:reverse"/> + </route> + </camelContext> + <bean class="org.apache.camel.dataformat.thrift.ThriftDataFormat" id="thrift2"> + <property name="instanceClass" value="org.apache.camel.dataformat.thrift.generated.Work"/> + </bean> +</beans> http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/components/camel-thrift/src/test/thrift/readme.txt ---------------------------------------------------------------------- diff --git a/components/camel-thrift/src/test/thrift/readme.txt b/components/camel-thrift/src/test/thrift/readme.txt new file mode 100644 index 0000000..8211f43 --- /dev/null +++ b/components/camel-thrift/src/test/thrift/readme.txt @@ -0,0 +1,5 @@ +Examples taken from the Apache Thrift java tutorial https://thrift.apache.org/tutorial/java + +Thrift tutorial java files generation + cd src/test/thrift + thrift -r --gen java -out ../java/ ./tutorial-dataformat.thrift \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/components/camel-thrift/src/test/thrift/tutorial-dataformat.thrift ---------------------------------------------------------------------- diff --git a/components/camel-thrift/src/test/thrift/tutorial-dataformat.thrift b/components/camel-thrift/src/test/thrift/tutorial-dataformat.thrift new file mode 100644 index 0000000..8100882 --- /dev/null +++ b/components/camel-thrift/src/test/thrift/tutorial-dataformat.thrift @@ -0,0 +1,84 @@ +/** + * 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. + */ + +# Thrift Tutorial +# Mark Slee (mcs...@facebook.com) +# +# This file aims to teach you how to use Thrift, in a .thrift file. The +# first thing to notice is that .thrift files support standard shell comments. +# This lets you make your thrift file executable and include your Thrift build +# step on the top line. And you can place comments like this anywhere you like. +# + +/** + * The first thing to know about are types. The available types in Thrift are: + * + * bool Boolean, one byte + * i8 (byte) Signed 8-bit integer + * i16 Signed 16-bit integer + * i32 Signed 32-bit integer + * i64 Signed 64-bit integer + * double 64-bit floating point value + * string String + * binary Blob (byte array) + * map<t1,t2> Map from one type to another + * list<t1> Ordered list of one type + * set<t1> Set of unique elements of one type + * + * Did you also notice that Thrift supports C style comments? + */ + +// Just in case you were wondering... yes. We support simple C comments too. + +/** + * Thrift files can namespace, package, or prefix their output in various + * target languages. + */ +namespace java org.apache.camel.dataformat.thrift.generated + +/** + * Thrift lets you do typedefs to get pretty names for your types. Standard + * C style here. + */ +typedef i32 MyInteger + +/** + * You can define enums, which are just 32 bit integers. Values are optional + * and start at 1 if not supplied, C style again. + */ +enum Operation { + ADD = 1, + SUBTRACT = 2, + MULTIPLY = 3, + DIVIDE = 4 +} + +/** + * Structs are the basic complex data structures. They are comprised of fields + * which each have an integer identifier, a type, a symbolic name, and an + * optional default value. + * + * Fields can be declared "optional", which ensures they will not be included + * in the serialized output if they aren't set. Note that this requires some + * manual management in some languages. + */ +struct Work { + 1: i32 num1 = 0, + 2: i32 num2, + 3: Operation op, + 4: optional string comment, +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/components/pom.xml ---------------------------------------------------------------------- diff --git a/components/pom.xml b/components/pom.xml index 403e873..d8e42f0 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -282,6 +282,7 @@ <module>camel-tarfile</module> <module>camel-telegram</module> <module>camel-tika</module> + <module>camel-thrift</module> <module>camel-twilio</module> <module>camel-twitter</module> <module>camel-undertow</module> http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/platforms/karaf/features/src/main/resources/config.properties ---------------------------------------------------------------------- diff --git a/platforms/karaf/features/src/main/resources/config.properties b/platforms/karaf/features/src/main/resources/config.properties old mode 100755 new mode 100644 http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/platforms/karaf/features/src/main/resources/features.xml ---------------------------------------------------------------------- diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml index 8bf840e..677fd9a 100644 --- a/platforms/karaf/features/src/main/resources/features.xml +++ b/platforms/karaf/features/src/main/resources/features.xml @@ -1947,6 +1947,12 @@ <bundle>mvn:org.apache.camel/camel-test/${project.version}</bundle> <bundle>mvn:org.apache.camel/camel-test-spring/${project.version}</bundle> </feature> + <feature name='camel-thrift' version='${project.version}' resolver='(obr)' start-level='50'> + <feature version='${project.version}'>camel-core</feature> + <bundle dependency='true'>mvn:org.apache.thrift/libthrift/${libthrift-version}</bundle> + <bundle dependency='true'>mvn:commons-io/commons-io/${commons-io-version}</bundle> + <bundle>mvn:org.apache.camel/camel-thrift/${project.version}</bundle> + </feature> <feature name='camel-tika' version='${project.version}' resolver='(obr)' start-level='50'> <bundle dependency='true'>mvn:org.apache.tika/tika-core/${tika-version}</bundle> <bundle dependency='true'>mvn:org.apache.tika/tika-bundle/${tika-version}</bundle> http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/platforms/spring-boot/components-starter/camel-thrift-starter/pom.xml ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-thrift-starter/pom.xml b/platforms/spring-boot/components-starter/camel-thrift-starter/pom.xml new file mode 100644 index 0000000..5b82d17 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-thrift-starter/pom.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel</groupId> + <artifactId>components-starter</artifactId> + <version>2.20.0-SNAPSHOT</version> + </parent> + <artifactId>camel-thrift-starter</artifactId> + <packaging>jar</packaging> + <name>Spring-Boot Starter :: Camel :: Thrift</name> + <description>Spring-Boot Starter for Camel Apache Thrift data format and RPC support</description> + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter</artifactId> + <version>${spring-boot-version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-thrift</artifactId> + <version>${project.version}</version> + <!--START OF GENERATED CODE--> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + <!--END OF GENERATED CODE--> + </dependency> + <!--START OF GENERATED CODE--> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-core-starter</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-boot-starter</artifactId> + </dependency> + <!--END OF GENERATED CODE--> + </dependencies> +</project> http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/java/org/apache/camel/dataformat/thrift/springboot/ThriftDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/java/org/apache/camel/dataformat/thrift/springboot/ThriftDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/java/org/apache/camel/dataformat/thrift/springboot/ThriftDataFormatAutoConfiguration.java new file mode 100644 index 0000000..53bee6e --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/java/org/apache/camel/dataformat/thrift/springboot/ThriftDataFormatAutoConfiguration.java @@ -0,0 +1,129 @@ +/** + * 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.camel.dataformat.thrift.springboot; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.dataformat.thrift.ThriftDataFormat; +import org.apache.camel.spi.DataFormat; +import org.apache.camel.spi.DataFormatCustomizer; +import org.apache.camel.spi.DataFormatFactory; +import org.apache.camel.spi.HasId; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.DataFormatConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.GroupCondition; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.apache.camel.util.IntrospectionSupport; +import org.apache.camel.util.ObjectHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") +@Configuration +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + ThriftDataFormatAutoConfiguration.GroupConditions.class}) +@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") +@EnableConfigurationProperties({DataFormatConfigurationProperties.class, + ThriftDataFormatConfiguration.class}) +public class ThriftDataFormatAutoConfiguration { + + private static final Logger LOGGER = LoggerFactory + .getLogger(ThriftDataFormatAutoConfiguration.class); + @Autowired + private ApplicationContext applicationContext; + @Autowired + private CamelContext camelContext; + @Autowired + private ThriftDataFormatConfiguration configuration; + @Autowired(required = false) + private List<DataFormatCustomizer<ThriftDataFormat>> customizers; + + static class GroupConditions extends GroupCondition { + public GroupConditions() { + super("camel.dataformat", "camel.dataformat.thrift"); + } + } + + @Bean(name = "thrift-dataformat-factory") + @ConditionalOnMissingBean(ThriftDataFormat.class) + public DataFormatFactory configureThriftDataFormatFactory() + throws Exception { + return new DataFormatFactory() { + @Override + public DataFormat newInstance() { + ThriftDataFormat dataformat = new ThriftDataFormat(); + if (CamelContextAware.class + .isAssignableFrom(ThriftDataFormat.class)) { + CamelContextAware contextAware = CamelContextAware.class + .cast(dataformat); + if (contextAware != null) { + contextAware.setCamelContext(camelContext); + } + } + try { + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, + parameters, null, false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), dataformat, + parameters); + } catch (Exception e) { + throw new RuntimeCamelException(e); + } + if (ObjectHelper.isNotEmpty(customizers)) { + for (DataFormatCustomizer<ThriftDataFormat> customizer : customizers) { + boolean useCustomizer = (customizer instanceof HasId) + ? HierarchicalPropertiesEvaluator.evaluate( + applicationContext.getEnvironment(), + "camel.dataformat.customizer", + "camel.dataformat.thrift.customizer", + ((HasId) customizer).getId()) + : HierarchicalPropertiesEvaluator.evaluate( + applicationContext.getEnvironment(), + "camel.dataformat.customizer", + "camel.dataformat.thrift.customizer"); + if (useCustomizer) { + LOGGER.debug( + "Configure dataformat {}, with customizer {}", + dataformat, customizer); + customizer.customize(dataformat); + } + } + } + return dataformat; + } + }; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/java/org/apache/camel/dataformat/thrift/springboot/ThriftDataFormatConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/java/org/apache/camel/dataformat/thrift/springboot/ThriftDataFormatConfiguration.java b/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/java/org/apache/camel/dataformat/thrift/springboot/ThriftDataFormatConfiguration.java new file mode 100644 index 0000000..72005ed --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/java/org/apache/camel/dataformat/thrift/springboot/ThriftDataFormatConfiguration.java @@ -0,0 +1,76 @@ +/** + * 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.camel.dataformat.thrift.springboot; + +import javax.annotation.Generated; +import org.apache.camel.spring.boot.DataFormatConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Camel Apache Thrift data format and RPC support + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") +@ConfigurationProperties(prefix = "camel.dataformat.thrift") +public class ThriftDataFormatConfiguration + extends + DataFormatConfigurationPropertiesCommon { + + /** + * Name of class to use when unarmshalling + */ + private String instanceClass; + /** + * Defines a content type format in which thrift message will be + * serialized/deserialized from(to) the Java been. The format can either be + * native or json for either native binary thrift json or simple json fields + * representation. The default value is binary. + */ + private String contentTypeFormat = "binary"; + /** + * Whether the data format should set the Content-Type header with the type + * from the data format if the data format is capable of doing so. For + * example application/xml for data formats marshalling to XML or + * application/json for data formats marshalling to JSon etc. + */ + private Boolean contentTypeHeader = false; + + public String getInstanceClass() { + return instanceClass; + } + + public void setInstanceClass(String instanceClass) { + this.instanceClass = instanceClass; + } + + public String getContentTypeFormat() { + return contentTypeFormat; + } + + public void setContentTypeFormat(String contentTypeFormat) { + this.contentTypeFormat = contentTypeFormat; + } + + public Boolean getContentTypeHeader() { + return contentTypeHeader; + } + + public void setContentTypeHeader(Boolean contentTypeHeader) { + this.contentTypeHeader = contentTypeHeader; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/LICENSE.txt ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/LICENSE.txt b/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/LICENSE.txt new file mode 100644 index 0000000..6b0b127 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/LICENSE.txt @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. + http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/NOTICE.txt ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/NOTICE.txt b/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/NOTICE.txt new file mode 100644 index 0000000..2e215bf --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/NOTICE.txt @@ -0,0 +1,11 @@ + ========================================================================= + == NOTICE file corresponding to the section 4 d of == + == the Apache License, Version 2.0, == + == in this case for the Apache Camel distribution. == + ========================================================================= + + This product includes software developed by + The Apache Software Foundation (http://www.apache.org/). + + Please read the different LICENSE files present in the licenses directory of + this distribution. http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/spring.factories b/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..fc26916 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.dataformat.thrift.springboot.ThriftDataFormatAutoConfiguration http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/spring.provides ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/spring.provides b/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/spring.provides new file mode 100644 index 0000000..5eb6b29 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-thrift-starter/src/main/resources/META-INF/spring.provides @@ -0,0 +1,17 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- +provides: camel-thrift http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/platforms/spring-boot/components-starter/pom.xml ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/pom.xml b/platforms/spring-boot/components-starter/pom.xml index 42e8bad..896a55a 100644 --- a/platforms/spring-boot/components-starter/pom.xml +++ b/platforms/spring-boot/components-starter/pom.xml @@ -294,6 +294,7 @@ <module>camel-tagsoup-starter</module> <module>camel-tarfile-starter</module> <module>camel-telegram-starter</module> + <module>camel-thrift-starter</module> <module>camel-tika-starter</module> <module>camel-twilio-starter</module> <module>camel-twitter-starter</module>