-/*\r
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.openflowjava.protocol.api.extensibility;\r
-\r
-\r
-/**\r
- * Stores and handles serializers \r
- * @author michal.polkorab\r
- *\r
- */\r
-public interface SerializerRegistry {\r
-\r
- /**\r
- * Serializer registry provisioning\r
- */\r
- public void init();\r
-\r
- /**\r
- * @param msgTypeKey lookup key\r
- * @return serializer or NullPointerException if no serializer was found\r
- */\r
- public <KEY_TYPE, SERIALIZER_TYPE extends OFGeneralSerializer> SERIALIZER_TYPE \r
- getSerializer(MessageTypeKey<KEY_TYPE> msgTypeKey);\r
-\r
- /**\r
- * Registers serializer under key\r
- * @param msgTypeKey lookup key\r
- * @param serializer serializer implementation\r
- */\r
- public <KEY_TYPE> void\r
- registerSerializer(MessageTypeKey<KEY_TYPE> msgTypeKey, OFGeneralSerializer serializer);\r
-}\r
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+
+
+
+/**
+ * Stores and handles serializers
+ * @author michal.polkorab
+ *
+ */
+public interface SerializerRegistry {
+
+ /**
+ * Serializer registry provisioning
+ */
+ public void init();
+
+ /**
+ * @param msgTypeKey lookup key
+ * @return serializer or NullPointerException if no serializer was found
+ */
+ <KEYTYPE, SERIALIZERTYPE extends OFGeneralSerializer> SERIALIZERTYPE
+ getSerializer(MessageTypeKey<KEYTYPE> msgTypeKey);
+
+ /**
+ * Registers serializer
+ * Throws IllegalStateException when there is
+ * a serializer already registered under given key.
+ *
+ * If the serializer implements {@link SerializerRegistryInjector} interface,
+ * the serializer is injected with SerializerRegistry instance.
+ *
+ * @param key used for serializer lookup
+ * @param serializer serializer implementation
+ */
+ <KEYTYPE> void registerSerializer(MessageTypeKey<KEYTYPE> key,
+ OFGeneralSerializer serializer);
+
+ /**
+ * Unregisters serializer
+ * @param key used for serializer lookup
+ * @param serializer serializer implementation
+ * @return true if serializer was removed,
+ * false if no serializer was found under specified key
+ */
+ <KEYTYPE> boolean unregisterSerializer(MessageTypeKey<KEYTYPE> key);
+}