/** * Creates and returns a {@link org.jboss.marshalling.Marshaller} * * @param marshallerFactory The marshaller factory * @return * @throws IOException */ private org.jboss.marshalling.Marshaller getMarshaller(final org.jboss.marshalling.MarshallerFactory marshallerFactory) throws IOException { final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setClassTable(ProtocolV1ClassTable.INSTANCE); marshallingConfiguration.setObjectTable(ProtocolV1ObjectTable.INSTANCE); marshallingConfiguration.setVersion(2); marshallingConfiguration.setSerializedCreator(new SunReflectiveCreator()); return marshallerFactory.createMarshaller(marshallingConfiguration); }
/** * {@inheritDoc} * * @see org.jboss.as.clustering.web.SessionAttributeMarshallerFactory#createMarshaller(org.jboss.as.clustering.web.LocalDistributableSessionManager) */ @Override public SessionAttributeMarshaller createMarshaller(LocalDistributableSessionManager manager) { MarshallingConfiguration configuration = new MarshallingConfiguration(); configuration.setClassResolver(manager.getApplicationClassResolver()); configuration.setSerializedCreator(new SunReflectiveCreator()); configuration.setExternalizerCreator(new ReflectiveCreator()); configuration.setClassTable(this); this.configurations.put(CURRENT_VERSION, configuration); return new SessionAttributeMarshallerImpl(new MarshallingContext(this.factory, this)); }
/** * Creates and returns a {@link Unmarshaller} * * @param marshallerFactory The marshaller factory * @return * @throws IOException */ private Unmarshaller getUnMarshaller(final MarshallerFactory marshallerFactory, final ClassResolver classResolver) throws IOException { final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setVersion(2); marshallingConfiguration.setClassTable(ProtocolV1ClassTable.INSTANCE); marshallingConfiguration.setObjectTable(ProtocolV1ObjectTable.INSTANCE); marshallingConfiguration.setClassResolver(classResolver); marshallingConfiguration.setSerializedCreator(new SunReflectiveCreator()); return marshallerFactory.createUnmarshaller(marshallingConfiguration); } }
/** * {@inheritDoc} * @see org.jboss.msc.service.Service#start(org.jboss.msc.service.StartContext) */ @Override public void start(StartContext context) throws StartException { this.channel = this.channelRef.getValue(); this.marshallingConfig.setClassResolver(ModularClassResolver.getInstance(this.loaderRef.getValue())); this.marshallingConfig.setSerializedCreator(new SunReflectiveCreator()); this.marshallingConfig.setExternalizerCreator(new ReflectiveCreator()); this.marshallingConfig.setClassTable(CoreGroupClassTable.INSTANCE); try { this.start(); } catch (Exception e) { throw new StartException(e); } }
@Override public MarshallingConfiguration getMarshallingConfiguration(int version) { MarshallingConfiguration config = this.passivationManager.getMarshallingConfiguration(version); MarshallingConfiguration result = new MarshallingConfiguration(); result.setBufferSize(config.getBufferSize()); result.setClassCount(config.getClassCount()); result.setClassExternalizerFactory(config.getClassExternalizerFactory()); result.setClassResolver(config.getClassResolver()); result.setClassTable(config.getClassTable()); result.setExceptionListener(config.getExceptionListener()); result.setExternalizerCreator(config.getExternalizerCreator()); result.setInstanceCount(config.getInstanceCount()); result.setObjectResolver(config.getObjectResolver()); result.setObjectTable(config.getObjectTable()); result.setSerializabilityChecker(this.serializabilityChecker); result.setSerializedCreator(config.getSerializedCreator()); result.setStreamHeader(config.getStreamHeader()); result.setVersion(config.getVersion()); return result; }
this.cache = componentDescription.getCache(); MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setSerializedCreator(new SunReflectiveCreator()); marshallingConfiguration.setExternalizerCreator(new ReflectiveCreator()); marshallingConfiguration.setClassResolver(new ClassLoaderAwareClassResolver(ModularClassResolver.getInstance(componentConfiguration.getModuleLoader()), componentConfiguration.getModuleClassLoader()));