use of org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers in project camunda-bpm-platform by camunda.
the class SpinBpmPlatformPlugin method initializeVariableSerializers.
protected void initializeVariableSerializers(AbstractProcessApplication abstractProcessApplication) {
VariableSerializers paVariableSerializers = abstractProcessApplication.getVariableSerializers();
if (paVariableSerializers == null) {
paVariableSerializers = new DefaultVariableSerializers();
abstractProcessApplication.setVariableSerializers(paVariableSerializers);
}
for (TypedValueSerializer<?> serializer : lookupSpinSerializers(abstractProcessApplication.getProcessApplicationClassloader())) {
paVariableSerializers.addSerializer(serializer);
}
}
use of org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers in project camunda-bpm-platform by camunda.
the class SpinProcessEnginePluginTest method testPluginDoesNotRegisterXmlSerializerIfNotPresentInClasspath.
public void testPluginDoesNotRegisterXmlSerializerIfNotPresentInClasspath() throws IOException {
ClassLoader mockClassloader = Mockito.mock(ClassLoader.class);
Mockito.when(mockClassloader.getResources(Mockito.anyString())).thenReturn(Collections.enumeration(Collections.<URL>emptyList()));
DataFormats.loadDataFormats(mockClassloader);
ProcessEngineConfigurationImpl mockConfig = Mockito.mock(ProcessEngineConfigurationImpl.class);
DefaultVariableSerializers serializers = new DefaultVariableSerializers();
Mockito.when(mockConfig.getVariableSerializers()).thenReturn(serializers);
new SpinProcessEnginePlugin().registerSerializers(mockConfig);
assertTrue(serializers.getSerializerByName(XmlValueType.TYPE_NAME) == null);
}
use of org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers in project camunda-bpm-platform by camunda.
the class SpinProcessEnginePluginTest method testPluginDoesNotRegisterJsonSerializerIfNotPresentInClasspath.
public void testPluginDoesNotRegisterJsonSerializerIfNotPresentInClasspath() throws IOException {
ClassLoader mockClassloader = Mockito.mock(ClassLoader.class);
Mockito.when(mockClassloader.getResources(Mockito.anyString())).thenReturn(Collections.enumeration(Collections.<URL>emptyList()));
DataFormats.loadDataFormats(mockClassloader);
ProcessEngineConfigurationImpl mockConfig = Mockito.mock(ProcessEngineConfigurationImpl.class);
DefaultVariableSerializers serializers = new DefaultVariableSerializers();
Mockito.when(mockConfig.getVariableSerializers()).thenReturn(serializers);
new SpinProcessEnginePlugin().registerSerializers(mockConfig);
assertTrue(serializers.getSerializerByName(JsonValueType.TYPE_NAME) == null);
}
use of org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers in project camunda-bpm-platform by camunda.
the class ProcessEngineConfigurationImpl method initSerialization.
protected void initSerialization() {
if (variableSerializers == null) {
variableSerializers = new DefaultVariableSerializers();
if (customPreVariableSerializers != null) {
for (TypedValueSerializer<?> customVariableType : customPreVariableSerializers) {
variableSerializers.addSerializer(customVariableType);
}
}
// register built-in serializers
variableSerializers.addSerializer(new NullValueSerializer());
variableSerializers.addSerializer(new StringValueSerializer());
variableSerializers.addSerializer(new BooleanValueSerializer());
variableSerializers.addSerializer(new ShortValueSerializer());
variableSerializers.addSerializer(new IntegerValueSerializer());
variableSerializers.addSerializer(new LongValueSerlializer());
variableSerializers.addSerializer(new DateValueSerializer());
variableSerializers.addSerializer(new DoubleValueSerializer());
variableSerializers.addSerializer(new ByteArrayValueSerializer());
variableSerializers.addSerializer(new JavaObjectSerializer());
variableSerializers.addSerializer(new FileValueSerializer());
if (customPostVariableSerializers != null) {
for (TypedValueSerializer<?> customVariableType : customPostVariableSerializers) {
variableSerializers.addSerializer(customVariableType);
}
}
}
}
Aggregations