Added more methods to Serialization. Updated package names

This commit is contained in:
nathan 2018-01-22 15:14:15 +01:00
parent f009f1223f
commit b96ac4be89
8 changed files with 23 additions and 47 deletions

View File

@ -1,29 +0,0 @@
/*
* Copyright 2010 dorkbox, llc
*
* 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.
*/
package dorkbox.util.serialization;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Used to identify fields that kryo should ignore when configured with the FieldAnnotationAwareSerializer
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public
@interface IgnoreSerialization {}

View File

@ -1,19 +1,19 @@
/*
* Copyright 2010 dorkbox, llc
* Copyright 2018 dorkbox, llc.
*
* 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
* 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
* 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.
* 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 dorkbox.util;
package dorkbox.util.serialization;
import java.io.IOException;

View File

@ -37,8 +37,6 @@ import com.esotericsoftware.kryo.Serializer;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import dorkbox.util.SerializationManager;
/**
* A kryo {@link Serializer} for unmodifiable {@link Collection}s and {@link Map}s
* created via {@link Collections}.

View File

@ -25,7 +25,7 @@ import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import com.esotericsoftware.minlog.Log;
import dorkbox.util.SerializationManager;
import dorkbox.util.serialization.SerializationManager;
import io.netty.buffer.ByteBuf;
class DefaultStorageSerializationManager implements SerializationManager {
@ -41,6 +41,13 @@ class DefaultStorageSerializationManager implements SerializationManager {
return this;
}
@Override
public
SerializationManager register(final Class<?> clazz, final int id) {
kryo.register(clazz, id);
return this;
}
@Override
public
SerializationManager register(final Class<?> clazz, final Serializer<?> serializer) {

View File

@ -26,7 +26,7 @@ import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import org.slf4j.Logger;
import dorkbox.util.DelayTimer;
import dorkbox.util.SerializationManager;
import dorkbox.util.serialization.SerializationManager;
/**

View File

@ -25,7 +25,7 @@ import java.nio.channels.FileLock;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import dorkbox.util.SerializationManager;
import dorkbox.util.serialization.SerializationManager;
public
class Metadata {

View File

@ -38,7 +38,7 @@ import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import dorkbox.util.OS;
import dorkbox.util.SerializationManager;
import dorkbox.util.serialization.SerializationManager;
// a note on file locking between c and java

View File

@ -26,7 +26,7 @@ import org.slf4j.helpers.NOPLogger;
import dorkbox.util.FileUtil;
import dorkbox.util.OS;
import dorkbox.util.SerializationManager;
import dorkbox.util.serialization.SerializationManager;
public
class StorageSystem {