Refine search
@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; } },
/** * 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(); // TODO - Do we need an Object and Class table? marshallingConfiguration.setVersion(2); // TODO - Will need classloading server side to be in context of bean being called. return marshallerFactory.createMarshaller(marshallingConfiguration); }
private MarshallingConfiguration createMarshallingConfig(URI uri) { final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setObjectResolver(new HttpProtocolV1ObjectResolver(uri)); marshallingConfiguration.setObjectTable(HttpProtocolV1ObjectTable.INSTANCE); marshallingConfiguration.setVersion(2); return marshallingConfiguration; }
static MarshallingConfiguration createMarshallingConf() { MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setVersion(2); return 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 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; }
@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; }
final ReceivedTransaction txConfig; try { final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setObjectTable(HttpProtocolV1ObjectTable.INSTANCE); marshallingConfiguration.setVersion(2); Unmarshaller unmarshaller = HttpServerHelper.RIVER_MARSHALLER_FACTORY.createUnmarshaller(marshallingConfiguration); final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setObjectTable(HttpProtocolV1ObjectTable.INSTANCE); marshallingConfiguration.setVersion(2);
/** * 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); } }
private static MarshallingConfiguration createMarshallingConfig(URI uri) { final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setVersion(2); if (helper != null) { marshallingConfiguration.setObjectResolver(helper.getObjectResolver(uri)); } return marshallingConfiguration; }
@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 protected final Object doOperation(HttpServerExchange exchange, String name) throws NamingException { ContentType contentType = ContentType.parse(exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE)); if (contentType == null || !contentType.getType().equals("application/x-wf-jndi-jbmar-value") || contentType.getVersion() != 1) { exchange.setStatusCode(StatusCodes.BAD_REQUEST); exchange.endExchange(); return null; } final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setVersion(2); try (InputStream inputStream = exchange.getInputStream()) { Unmarshaller unmarshaller = MARSHALLER_FACTORY.createUnmarshaller(marshallingConfiguration); unmarshaller.start(new InputStreamByteInput(inputStream)); Object object = unmarshaller.readObject(); unmarshaller.finish(); doOperation(name, object); } catch (Exception e) { NamingException nm = new NamingException(e.getMessage()); nm.initCause(e); throw nm; } return null; }
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); } }
/** * 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); }
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()); }
MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setSerializedCreator(new SunReflectiveCreator()); marshallingConfiguration.setExternalizerCreator(new ReflectiveCreator()); marshallingConfiguration.setClassResolver(new ClassLoaderAwareClassResolver(ModularClassResolver.getInstance(componentConfiguration.getModuleLoader()), componentConfiguration.getModuleClassLoader())); marshallingConfiguration.setSerializabilityChecker(new StatefulSessionBeanSerializabilityChecker(componentConfiguration.getComponentClass())); marshallingConfiguration.setClassTable(new StatefulSessionBeanClassTable()); marshallingConfiguration.setObjectTable(new EJBClientContextIdentifierObjectTable()); this.marshallingConfigurations = Collections.singletonMap(CURRENT_MARSHALLING_VERSION, marshallingConfiguration); this.serializableInterceptorContextKeys = componentConfiguration.getInterceptorContextKeys();
@Override protected void setState(InputStream is) throws IOException, ClassNotFoundException { MarshallingConfiguration config = new MarshallingConfiguration(); config.setClassResolver(new SimpleClassResolver(getStateTransferClassLoader())); Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller(config); unmarshaller.start(Marshalling.createByteInput(is)); this.state = unmarshaller.readObject(Serializable.class); unmarshaller.close(); }
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; final SecurityIdentity identity; if (version >= 3) { unmarshaller = marshallerFactory.createUnmarshaller(configuration); unmarshaller.start(Marshalling.createByteInput(input)); identifier = unmarshaller.readObject(EJBIdentifier.class); unmarshaller = marshallerFactory.createUnmarshaller(configuration); unmarshaller.start(Marshalling.createByteInput(data)); String appName = unmarshaller.readObject(String.class);
/** * {@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)); }
public AbstractJBossMarshaller() { // Class resolver now set when marshaller/unmarshaller will be created baseCfg = new MarshallingConfiguration(); baseCfg.setExceptionListener(new DebuggingExceptionListener()); baseCfg.setClassExternalizerFactory(new SerializeWithExtFactory()); baseCfg.setInstanceCount(DEF_INSTANCE_COUNT); baseCfg.setClassCount(DEF_CLASS_COUNT); baseCfg.setVersion(3); }