RemoteServerTransport(final Channel channel, final int version, final MessageTracker messageTracker, final Context localContext) { this.channel = channel; this.version = version; this.messageTracker = messageTracker; this.localContext = localContext; this.configuration = new MarshallingConfiguration(); configuration.setVersion(version == 2 ? 4 : 2); configuration.setClassResolver(new ContextClassResolver()); }
RemoteClientTransport(final Channel channel, final int version, final MarshallingConfiguration configuration) { configuration.setClassResolver(new ContextClassResolver()); this.channel = channel; this.configuration = configuration; this.version = version; tracker = new InvocationTracker(channel, version == 1 ? IntUnaryOperator.identity() : RemoteClientTransport::defaultFunction); }
/** * 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.setClassResolver(classResolver); return marshallerFactory.createUnmarshaller(marshallingConfiguration); }
/** * 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.setClassResolver(classResolver); return marshallerFactory.createUnmarshaller(marshallingConfiguration); }
@Override public synchronized void start(StartContext startContext) throws StartException { final RiverMarshallerFactory factory = new RiverMarshallerFactory(); final MarshallingConfiguration configuration = new MarshallingConfiguration(); configuration.setClassResolver(ModularClassResolver.getInstance(moduleLoaderInjectedValue.getValue())); this.configuration = configuration; this.factory = factory; }
@Override public void start(final StartContext context) throws StartException { factory = new RiverMarshallerFactory(); configuration = new MarshallingConfiguration(); configuration.setClassResolver(ModularClassResolver.getInstance(moduleLoader.getValue())); managedReference = dataSourceInjectedValue.getValue().getReference(); dataSource = (DataSource) managedReference.getInstance(); final InputStream stream = DatabaseTimerPersistence.class.getClassLoader().getResourceAsStream("timer-sql.properties"); sql = new Properties(); try { sql.load(stream); } catch (IOException e) { throw new StartException(e); } finally { safeClose(stream); } extractDialects(); investigateDialect(); checkDatabase(); if (refreshInterval > 0) { refreshTask = new RefreshTask(); timerInjectedValue.getValue().schedule(refreshTask, refreshInterval, refreshInterval); } }
private void doStart() { final RiverMarshallerFactory factory = new RiverMarshallerFactory(); final MarshallingConfiguration configuration = new MarshallingConfiguration(); configuration.setClassResolver(ModularClassResolver.getInstance(moduleLoader.getValue())); configuration.setVersion(3); this.configuration = configuration; this.factory = factory; if (pathRelativeTo != null) { callbackHandle = pathManager.getValue().registerCallback(pathRelativeTo, PathManager.ReloadServerCallback.create(), PathManager.Event.UPDATED, PathManager.Event.REMOVED); } baseDir = new File(pathManager.getValue().resolveRelativePathEntry(path, pathRelativeTo)); if (!baseDir.exists()) { if (createIfNotExists) { if (!baseDir.mkdirs()) { throw EJB3_TIMER_LOGGER.failToCreateTimerFileStoreDir(baseDir); } } else { throw EJB3_TIMER_LOGGER.timerFileStoreDirNotExist(baseDir); } } if (!baseDir.isDirectory()) { throw EJB3_TIMER_LOGGER.invalidTimerFileStoreDir(baseDir); } }
@Override public MarshallingConfiguration apply(MarshallingConfigurationContext context) { MarshallingConfiguration config = new MarshallingConfiguration(); config.setClassResolver(ModularClassResolver.getInstance(context.getModuleLoader())); config.setClassTable(new DynamicClassTable(context.getModule().getClassLoader())); return config; } },
public HotRodMarshaller(Module module) { super(); super.baseCfg.setClassResolver(ModularClassResolver.getInstance(module.getModuleLoader())); super.baseCfg.setClassTable(new DynamicClassTable(module.getClassLoader())); super.baseCfg.setObjectTable(new ExternalizerObjectTable(module.getClassLoader())); } }
@Override public MarshallingConfiguration apply(MarshallingConfigurationContext context) { MarshallingConfiguration config = new MarshallingConfiguration(); config.setClassResolver(ModularClassResolver.getInstance(context.getModuleLoader())); config.setClassTable(new DynamicClassTable(context.getModule().getClassLoader())); config.setObjectTable(new ExternalizerObjectTable(context.getModule().getClassLoader())); return config; } },
@SuppressWarnings("deprecation") @Override public MarshallingConfiguration apply(MarshallingConfigurationContext context) { Module module = context.getModule(); ModuleDeployment deployment = context.getDeployment(); MarshallingConfiguration config = new MarshallingConfiguration(); config.setClassResolver(ModularClassResolver.getInstance(module.getModuleLoader())); config.setSerializabilityChecker(new StatefulSessionBeanSerializabilityChecker(deployment)); config.setClassTable(new StatefulSessionBeanClassTable()); config.setObjectTable(new EJBClientContextIdentifierObjectTable()); return config; } },
void handleInvocationRequest(final int invId, final InputStream input) throws IOException, ClassNotFoundException { final MarshallingConfiguration configuration = EJBServerChannel.this.configuration.clone(); final ServerClassResolver classResolver = new ServerClassResolver(); configuration.setClassResolver(classResolver); final Unmarshaller unmarshaller;
@Override public MarshallingConfiguration apply(MarshallingConfigurationContext context) { Module module = context.getModule(); ModuleDeployment deployment = context.getDeployment(); MarshallingConfiguration config = new MarshallingConfiguration(); config.setClassResolver(ModularClassResolver.getInstance(module.getModuleLoader())); config.setSerializabilityChecker(new StatefulSessionBeanSerializabilityChecker(deployment)); config.setClassTable(new StatefulSessionBeanClassTable()); config.setObjectResolver(new EJBClientContextIdentifierResolver()); config.setObjectTable(new ExternalizerObjectTable(module.getClassLoader())); return config; } },
final RiverMarshallerFactory factory = new RiverMarshallerFactory(); final MarshallingConfiguration configuration = new MarshallingConfiguration(); configuration.setClassResolver(ModularClassResolver.getInstance(serviceModuleLoaderInjectedValue.getValue())); this.configuration = configuration; this.factory = factory;
public GenericJBossMarshaller() { super(); baseCfg.setClassResolver( new DefaultContextClassResolver(this.getClass().getClassLoader())); }
RemoteClientTransport(final Channel channel, final int version, final MarshallingConfiguration configuration) { configuration.setClassResolver(new ContextClassResolver()); this.channel = channel; this.configuration = configuration; this.version = version; tracker = new InvocationTracker(channel, version == 1 ? IntUnaryOperator.identity() : RemoteClientTransport::defaultFunction); }
LegacyJBossMarshaller(StreamingMarshaller parent, Map<Integer, ? extends AdvancedExternalizer<?>> externalizerMap) { baseCfg.setClassExternalizerFactory(new SerializeWithExtFactory()); baseCfg.setObjectTable(new ExternalizerTable(parent, externalizerMap)); baseCfg.setClassResolver(new DefaultContextClassResolver(GlobalConfigurationBuilder.class.getClassLoader())); } }
@Override public synchronized void start(StartContext startContext) throws StartException { final RiverMarshallerFactory factory = new RiverMarshallerFactory(); final MarshallingConfiguration configuration = new MarshallingConfiguration(); configuration.setClassResolver(ModularClassResolver.getInstance(moduleLoaderInjectedValue.getValue())); this.configuration = configuration; this.factory = factory; }
@BeforeClass public void setUp() throws Exception { factory = (MarshallerFactory) Thread.currentThread().getContextClassLoader().loadClass("org.jboss.marshalling.river.RiverMarshallerFactory").newInstance(); MarshallingConfiguration configuration = new MarshallingConfiguration(); configuration.setClassResolver(new ContextClassResolver()); marshaller = factory.createMarshaller(configuration); unmarshaller = factory.createUnmarshaller(configuration); }
@Override public MarshallingConfiguration apply(Module module) { ModuleLoader loader = module.getModuleLoader(); MarshallingConfiguration config = new MarshallingConfiguration(); config.setClassResolver(ModularClassResolver.getInstance(loader)); config.setClassTable(new DynamicClassTable(module.getClassLoader())); config.setObjectTable(new ExternalizerObjectTable(module.getClassLoader())); return config; } },