Fixed build according to license texts and one missed method while exchanging DataOutput / -Input with Source / Target
git-svn-id: https://svn.apache.org/repos/asf/directmemory/lightning/trunk@1405131 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lightning-core/src/main/java/org/apache/directmemory/lightning/internal/generator/AbstractGeneratedMarshaller.java b/lightning-core/src/main/java/org/apache/directmemory/lightning/internal/generator/AbstractGeneratedMarshaller.java
index 85eb4eb..b026ac5 100644
--- a/lightning-core/src/main/java/org/apache/directmemory/lightning/internal/generator/AbstractGeneratedMarshaller.java
+++ b/lightning-core/src/main/java/org/apache/directmemory/lightning/internal/generator/AbstractGeneratedMarshaller.java
@@ -18,7 +18,6 @@
*/
package org.apache.directmemory.lightning.internal.generator;
-import java.io.DataOutput;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
@@ -110,7 +109,7 @@
SerializationContext serializationContext )
throws IOException;
- protected boolean isAlreadyMarshalled( Object value, Class<?> type, DataOutput dataOutput,
+ protected boolean isAlreadyMarshalled( Object value, Class<?> type, Target target,
SerializationContext serializationContext )
throws IOException
{
@@ -128,11 +127,11 @@
if ( referenceId == -1 )
{
referenceId = cacheObjectForMarshall( value, serializationContext );
- dataOutput.writeLong( referenceId );
+ target.writeLong( referenceId );
return false;
}
- dataOutput.writeLong( referenceId );
+ target.writeLong( referenceId );
return true;
}
diff --git a/lightning-core/src/main/java/org/apache/directmemory/lightning/io/ByteBufferSource.java b/lightning-core/src/main/java/org/apache/directmemory/lightning/io/ByteBufferSource.java
index df90490..9306208 100644
--- a/lightning-core/src/main/java/org/apache/directmemory/lightning/io/ByteBufferSource.java
+++ b/lightning-core/src/main/java/org/apache/directmemory/lightning/io/ByteBufferSource.java
@@ -1,3 +1,21 @@
+/*
+ * 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.directmemory.lightning.io;
import java.io.IOException;
diff --git a/lightning-core/src/main/java/org/apache/directmemory/lightning/io/ByteBufferTarget.java b/lightning-core/src/main/java/org/apache/directmemory/lightning/io/ByteBufferTarget.java
index d325ebf..3927b30 100644
--- a/lightning-core/src/main/java/org/apache/directmemory/lightning/io/ByteBufferTarget.java
+++ b/lightning-core/src/main/java/org/apache/directmemory/lightning/io/ByteBufferTarget.java
@@ -1,3 +1,21 @@
+/*
+ * 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.directmemory.lightning.io;
import java.io.IOException;
diff --git a/lightning-core/src/main/java/org/apache/directmemory/lightning/io/OutputStreamTarget.java b/lightning-core/src/main/java/org/apache/directmemory/lightning/io/OutputStreamTarget.java
index 76ef67a..0e670a7 100644
--- a/lightning-core/src/main/java/org/apache/directmemory/lightning/io/OutputStreamTarget.java
+++ b/lightning-core/src/main/java/org/apache/directmemory/lightning/io/OutputStreamTarget.java
@@ -1,3 +1,21 @@
+/*
+ * 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.directmemory.lightning.io;
import java.io.IOException;
diff --git a/lightning-core/src/main/java/org/apache/directmemory/lightning/io/SerializerInputStream.java b/lightning-core/src/main/java/org/apache/directmemory/lightning/io/SerializerInputStream.java
index 4354c44..fd37ec8 100644
--- a/lightning-core/src/main/java/org/apache/directmemory/lightning/io/SerializerInputStream.java
+++ b/lightning-core/src/main/java/org/apache/directmemory/lightning/io/SerializerInputStream.java
@@ -1,3 +1,21 @@
+/*
+ * 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.directmemory.lightning.io;
import java.io.IOException;
diff --git a/lightning-core/src/main/java/org/apache/directmemory/lightning/io/SerializerOutputStream.java b/lightning-core/src/main/java/org/apache/directmemory/lightning/io/SerializerOutputStream.java
index eac2473..98af28e 100644
--- a/lightning-core/src/main/java/org/apache/directmemory/lightning/io/SerializerOutputStream.java
+++ b/lightning-core/src/main/java/org/apache/directmemory/lightning/io/SerializerOutputStream.java
@@ -1,3 +1,21 @@
+/*
+ * 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.directmemory.lightning.io;
import java.io.IOException;
diff --git a/lightning-maven-integration-test/src/test/resources/generated.java.out b/lightning-maven-integration-test/src/test/resources/generated.java.out
index 47a9847..9b9d824 100644
--- a/lightning-maven-integration-test/src/test/resources/generated.java.out
+++ b/lightning-maven-integration-test/src/test/resources/generated.java.out
@@ -1,12 +1,12 @@
package org.apache.directmemory.lightning.maven.integration;
-import java.io.DataInput;
-import java.io.DataOutput;
import java.io.IOException;
import java.util.List;
import java.util.Map;
+import org.apache.directmemory.lightning.Source;
+import org.apache.directmemory.lightning.Target;
import org.apache.directmemory.lightning.Marshaller;
import org.apache.directmemory.lightning.SerializationContext;
import org.apache.directmemory.lightning.instantiator.ObjectInstantiatorFactory;
@@ -51,30 +51,30 @@
ACCESSOR_FOO_LIGHTNING = (ValuePropertyAccessor) getPropertyAccessor("foo");
}
- public void marshall(Object value, PropertyDescriptor propertyDescriptor, DataOutput dataOutput, SerializationContext serializationContext) throws IOException {
- if (isAlreadyMarshalled(value, propertyDescriptor.getType(), dataOutput, serializationContext)) {
+ public void marshall(Object value, PropertyDescriptor propertyDescriptor, Target target, SerializationContext serializationContext) throws IOException {
+ if (isAlreadyMarshalled(value, propertyDescriptor.getType(), target, serializationContext)) {
return;
}
ValuePropertyAccessor barPropertyAccessor = this.ACCESSOR_BAR_LIGHTNING;
PropertyDescriptor barPropertyDescriptor = this.DESCRIPTOR_BAR_LIGHTNING;
- this.MARSHALLER_BAR_LIGHTNING.marshall(Integer.valueOf(barPropertyAccessor.readInt(value)), barPropertyDescriptor, dataOutput, serializationContext);
+ this.MARSHALLER_BAR_LIGHTNING.marshall(Integer.valueOf(barPropertyAccessor.readInt(value)), barPropertyDescriptor, target, serializationContext);
ValuePropertyAccessor fooPropertyAccessor = this.ACCESSOR_FOO_LIGHTNING;
PropertyDescriptor fooPropertyDescriptor = this.DESCRIPTOR_FOO_LIGHTNING;
- this.MARSHALLER_FOO_LIGHTNING.marshall(fooPropertyAccessor.readObject(value), fooPropertyDescriptor, dataOutput, serializationContext);
+ this.MARSHALLER_FOO_LIGHTNING.marshall(fooPropertyAccessor.readObject(value), fooPropertyDescriptor, target, serializationContext);
}
- public <V> V unmarshall(V instance, PropertyDescriptor propertyDescriptor, DataInput dataInput, SerializationContext serializationContext) throws IOException {
+ public <V> V unmarshall(V instance, PropertyDescriptor propertyDescriptor, Source source, SerializationContext serializationContext) throws IOException {
ValuePropertyAccessor barPropertyAccessor = this.ACCESSOR_BAR_LIGHTNING;
PropertyDescriptor barPropertyDescriptor = this.DESCRIPTOR_BAR_LIGHTNING;
- Object barValue = this.MARSHALLER_BAR_LIGHTNING.unmarshall(barPropertyDescriptor, dataInput, serializationContext);
+ Object barValue = this.MARSHALLER_BAR_LIGHTNING.unmarshall(barPropertyDescriptor, source, serializationContext);
barPropertyAccessor.writeInt(instance, ((Integer) barValue).intValue());
ValuePropertyAccessor fooPropertyAccessor = this.ACCESSOR_FOO_LIGHTNING;
PropertyDescriptor fooPropertyDescriptor = this.DESCRIPTOR_FOO_LIGHTNING;
- Object fooValue = this.MARSHALLER_FOO_LIGHTNING.unmarshall(fooPropertyDescriptor, dataInput, serializationContext);
+ Object fooValue = this.MARSHALLER_FOO_LIGHTNING.unmarshall(fooPropertyDescriptor, source, serializationContext);
fooPropertyAccessor.writeObject(instance, fooValue);
return instance;
diff --git a/lightning-maven-plugin/src/main/resources/marshaller.vm b/lightning-maven-plugin/src/main/resources/marshaller.vm
index b5a60de..4178960 100644
--- a/lightning-maven-plugin/src/main/resources/marshaller.vm
+++ b/lightning-maven-plugin/src/main/resources/marshaller.vm
@@ -18,12 +18,12 @@
*#
package ${packageName};
-import java.io.DataInput;
-import java.io.DataOutput;
import java.io.IOException;
import java.util.List;
import java.util.Map;
+import org.apache.directmemory.lightning.Source;
+import org.apache.directmemory.lightning.Target;
import org.apache.directmemory.lightning.Marshaller;
import org.apache.directmemory.lightning.SerializationContext;
import org.apache.directmemory.lightning.instantiator.ObjectInstantiatorFactory;
@@ -61,24 +61,24 @@
#end
}
- public void marshall(Object value, PropertyDescriptor propertyDescriptor, DataOutput dataOutput, SerializationContext serializationContext) throws IOException {
- if (isAlreadyMarshalled(value, propertyDescriptor.getType(), dataOutput, serializationContext)) {
+ public void marshall(Object value, PropertyDescriptor propertyDescriptor, Target target, SerializationContext serializationContext) throws IOException {
+ if (isAlreadyMarshalled(value, propertyDescriptor.getType(), target, serializationContext)) {
return;
}
#foreach( $property in ${properties} )
ValuePropertyAccessor ${property.propertyName}PropertyAccessor = this.${support.toFinalFieldName("accessor", $property)};
PropertyDescriptor ${property.propertyName}PropertyDescriptor = this.${support.toFinalFieldName("descriptor", $property)};
- this.${support.toFinalFieldName("marshaller", $property)}.marshall(${support.generateReader($property)}, ${property.propertyName}PropertyDescriptor, dataOutput, serializationContext);
+ this.${support.toFinalFieldName("marshaller", $property)}.marshall(${support.generateReader($property)}, ${property.propertyName}PropertyDescriptor, target, serializationContext);
#end
}
- public <V> V unmarshall(V instance, PropertyDescriptor propertyDescriptor, DataInput dataInput, SerializationContext serializationContext) throws IOException {
+ public <V> V unmarshall(V instance, PropertyDescriptor propertyDescriptor, Source source, SerializationContext serializationContext) throws IOException {
#foreach( $property in ${properties} )
ValuePropertyAccessor ${property.propertyName}PropertyAccessor = this.${support.toFinalFieldName("accessor", $property)};
PropertyDescriptor ${property.propertyName}PropertyDescriptor = this.${support.toFinalFieldName("descriptor", $property)};
- Object ${property.propertyName}Value = this.${support.toFinalFieldName("marshaller", $property)}.unmarshall(${property.propertyName}PropertyDescriptor, dataInput, serializationContext);
+ Object ${property.propertyName}Value = this.${support.toFinalFieldName("marshaller", $property)}.unmarshall(${property.propertyName}PropertyDescriptor, source, serializationContext);
${support.generateWriter($property, "instance")}
#end
diff --git a/pom.xml b/pom.xml
index d04bac0..0a00ed0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -253,6 +253,8 @@
<exclude>.repository/**</exclude>
<exclude>src/test/resources/generated.java.out</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
+ <exclude>.git/**</exclude>
+ <exclude>sys$command</exclude>
</excludes>
</configuration>
</execution>