Skip to content

Instantly share code, notes, and snippets.

@clebertsuconic
Created June 2, 2017 18:27
Show Gist options
  • Save clebertsuconic/1b51bb81035db09a8c4177e3d04ac4ae to your computer and use it in GitHub Desktop.
Save clebertsuconic/1b51bb81035db09a8c4177e3d04ac4ae to your computer and use it in GitHub Desktop.
/**
* 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.activemq.artemis.jms;
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
public interface SerializationProvider {
SerializationProvider setBlackList(String list);
SerializationProvider setWhiteList(String list);
String getBlackList();
String getWhiteList();
Object readObject(ActiveMQBuffer buffer);
SerializationProvider writeObject(Object obj, ActiveMQBuffer buffer);
}
@michaelandrepearce
Copy link

Whitelist/black list should probably sit in the implementation this is specific to Java serialisation, like wise would need a way to configure say Avro serdes impl with a schema reg url, so maybe configure(properties) would be better?

@michaelandrepearce
Copy link

michaelandrepearce commented Jun 2, 2017

e.g.
https://gist.github.com/michaelandrepearce/130b42ecd82b47a58997ccd798fbb609

also i added the java provider as example/default impl (including as discussed in IRC it keeping the leading 4bytes , also as in the sample i send, id suggest keeping the api to non artemis specifics, especially if we're looking to make it usable in qpid. Also it should be closable, and it to be created on construction per connection, and closed on connection destruction IMO (as we don't close the CF, but it may have bits needing closing after use, e.g. schema reg client)

Config in CF i think should take Class name as string this way makes it configurable on url, jndi etc, where all props have to be set by string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment