You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/10/13 08:04:13 UTC

[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1902: LevelDB native support #1839

JiriOndrusek commented on a change in pull request #1902:
URL: https://github.com/apache/camel-quarkus/pull/1902#discussion_r503747129



##########
File path: extensions/leveldb/runtime/src/main/java/org/apache/camel/quarkus/component/leveldb/ObjectCodecSubstitute.java
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.quarkus.component.leveldb;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.oracle.svm.core.annotate.Inject;
+import com.oracle.svm.core.annotate.Substitute;
+import com.oracle.svm.core.annotate.TargetClass;
+import org.apache.camel.support.DefaultExchangeHolder;
+import org.fusesource.hawtbuf.codec.ObjectCodec;
+
+/**
+ * This os workaround for serialization of DefaultExchangeHolder.
+ * Once serialization is implemented in graalVM (see https://github.com/oracle/graal/issues/460), this substitution
+ * could
+ * be removed.
+ */
+@TargetClass(value = ObjectCodec.class)
+final class ObjectCodecSubstitute {
+
+    @Inject
+    private ObjectMapper objectMapper;

Review comment:
       To be honest, there should not be @inject annotation. As you can see below, I'm initializing property if is null. I'll fix it to better annotation (I really don't know why Inject is there - I remeber trying some annotations, but I don't remember inject amongs them) 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org