Package org.jboss.marshalling

Examples of org.jboss.marshalling.SimpleClassResolver


                throw new SkipException("object tables not supported");
            }
            final ObjectResolver objectResolver = config.getObjectResolver();
            this.objectResolver = objectResolver == null ? Marshalling.nullObjectResolver() : objectResolver;
            final ClassResolver classResolver = config.getClassResolver();
            this.classResolver = classResolver == null ? new SimpleClassResolver(getClass().getClassLoader()) : classResolver;
            enableResolveObject(true);
            //noinspection ThisEscapedInObjectConstruction
            unmarshaller = new ObjectInputStreamUnmarshaller(this);
        }
View Full Code Here


                throw new SkipException("externalizers not supported");
            }
            final ObjectResolver objectResolver = config.getObjectResolver();
            this.objectResolver = objectResolver == null ? Marshalling.nullObjectResolver() : objectResolver;
            final ClassResolver classResolver = config.getClassResolver();
            this.classResolver = classResolver == null ? new SimpleClassResolver(getClass().getClassLoader()) : classResolver;
            enableReplaceObject(true);
            //noinspection ThisEscapedInObjectConstruction
            marshaller = new ObjectOutputStreamMarshaller(this);
        }
View Full Code Here

        final AsyncFuture<ServiceContainer> containerFuture;
        try {
            Module.registerURLStreamHandlerFactoryModule(Module.getBootModuleLoader().loadModule(ModuleIdentifier.create("org.jboss.vfs")));
            final MarshallingConfiguration configuration = new MarshallingConfiguration();
            configuration.setVersion(2);
            configuration.setClassResolver(new SimpleClassResolver(DomainServerMain.class.getClassLoader()));
            unmarshaller = factory.createUnmarshaller(configuration);
            byteInput = Marshalling.createByteInput(initialInput);
            unmarshaller.start(byteInput);
            final ServerTask task = unmarshaller.readObject(ServerTask.class);
            unmarshaller.finish();
View Full Code Here

        final AsyncFuture<ServiceContainer> containerFuture;
        try {
            Module.registerURLStreamHandlerFactoryModule(Module.getBootModuleLoader().loadModule(ModuleIdentifier.create("org.jboss.vfs")));
            final MarshallingConfiguration configuration = new MarshallingConfiguration();
            configuration.setVersion(2);
            configuration.setClassResolver(new SimpleClassResolver(DomainServerMain.class.getClassLoader()));
            unmarshaller = factory.createUnmarshaller(configuration);
            byteInput = Marshalling.createByteInput(initialInput);
            unmarshaller.start(byteInput);
            final ServerTask task = unmarshaller.readObject(ServerTask.class);
            unmarshaller.finish();
View Full Code Here

        }

        @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();
        }
View Full Code Here

        this.resolvers.put(objName, resolver);
    }

    @Override
    public void registerRPCHandler(String serviceName, Object handler, ClassLoader classLoader) {
        this.registerRPCHandler(serviceName, handler, new SimpleClassResolver(classLoader));
    }
View Full Code Here

            return new Buffer(CoreGroupCommunicationService.this.objectToByteBufferResponseInternal(obj));
        }

        @Override
        public Object objectFromBuffer(byte[] buf, int offset, int length) throws Exception {
            Object retval = CoreGroupCommunicationService.this.objectFromByteBufferResponseInternal(new SimpleClassResolver(HAServiceResponse.class.getClassLoader()), buf, offset, length);
            // HAServiceResponse is only received when a scoped classloader is required for unmarshalling
            if (!(retval instanceof HAServiceResponse)) {
                return retval;
            }

            String serviceName = ((HAServiceResponse) retval).getServiceName();
            byte[] payload = ((HAServiceResponse) retval).getPayload();

            ClassResolver resolver = CoreGroupCommunicationService.this.resolvers.get(serviceName);
            if (resolver == null) {
                resolver = new SimpleClassResolver(CoreGroupCommunicationService.class.getClassLoader());
            }
            return CoreGroupCommunicationService.this.objectFromByteBufferResponseInternal(resolver, payload, offset, length);
        }
View Full Code Here

            }

            // If client registered the service with a classloader, override the thread classloader here
            ClassResolver resolver = CoreGroupCommunicationService.this.resolvers.get(service);
            if (resolver == null) {
                resolver = new SimpleClassResolver(CoreGroupCommunicationService.class.getClassLoader());
            }
            try {
                body = CoreGroupCommunicationService.this.objectFromByteBufferInternal(resolver, request_bytes, 0, request_bytes.length);
            } catch (Exception e) {
                CoreGroupCommunicationService.this.log.partitionFailedExtractingMessageBody(e, CoreGroupCommunicationService.this.getGroupName());
View Full Code Here

     */
    Object objectFromByteBufferInternal(ClassLoader loader, byte[] buffer, int offset, int length) throws Exception {
        if (buffer == null) return null;
        MarshallingConfiguration config = new MarshallingConfiguration();
        if (loader != null) {
            config.setClassResolver(new SimpleClassResolver(loader));
        }
        Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller(config);
        unmarshaller.start(Marshalling.createByteInput(new ByteArrayInputStream(buffer, offset, length)));
        try {
            return unmarshaller.readObject();
View Full Code Here

            return null;
        }

        MarshallingConfiguration config = new MarshallingConfiguration();
        if (loader != null) {
            config.setClassResolver(new SimpleClassResolver(loader));
        }
        Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller(config);
        unmarshaller.start(Marshalling.createByteInput(new ByteArrayInputStream(buffer, offset, length)));
        // read past the null/serializable byte
        unmarshaller.read();
View Full Code Here

TOP

Related Classes of org.jboss.marshalling.SimpleClassResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.