Search in sources :

Example 1 with ObjectTable

use of org.jboss.marshalling.ObjectTable in project wildfly by wildfly.

the class SimpleMarshallingContext method isMarshallable.

@Override
public boolean isMarshallable(Object object) {
    if (object == null)
        return true;
    MarshallingConfiguration configuration = this.repository.getMarshallingConfiguration(this.repository.getCurrentMarshallingVersion());
    try {
        ObjectTable table = configuration.getObjectTable();
        if ((table != null) && table.getObjectWriter(object) != null)
            return true;
        ClassExternalizerFactory factory = configuration.getClassExternalizerFactory();
        if ((factory != null) && (factory.getExternalizer(object.getClass()) != null))
            return true;
        SerializabilityChecker checker = configuration.getSerializabilityChecker();
        return ((checker == null) ? SerializabilityChecker.DEFAULT : checker).isSerializable(object.getClass());
    } catch (IOException e) {
        return false;
    }
}
Also used : ClassExternalizerFactory(org.jboss.marshalling.ClassExternalizerFactory) MarshallingConfiguration(org.jboss.marshalling.MarshallingConfiguration) ObjectTable(org.jboss.marshalling.ObjectTable) IOException(java.io.IOException) SerializabilityChecker(org.jboss.marshalling.SerializabilityChecker)

Aggregations

IOException (java.io.IOException)1 ClassExternalizerFactory (org.jboss.marshalling.ClassExternalizerFactory)1 MarshallingConfiguration (org.jboss.marshalling.MarshallingConfiguration)1 ObjectTable (org.jboss.marshalling.ObjectTable)1 SerializabilityChecker (org.jboss.marshalling.SerializabilityChecker)1