Added more methods to Serialization. Updated package names
This commit is contained in:
parent
f009f1223f
commit
b96ac4be89
@ -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 {}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* 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.
|
||||
@ -13,7 +13,7 @@
|
||||
* 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;
|
||||
|
@ -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}.
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user