Package org.jboss.util.loading.ContextClassLoaderSwitcher

Examples of org.jboss.util.loading.ContextClassLoaderSwitcher.SwitchContext.reset()


            }
            finally
            {
               if (tclSwitchContext != null)
               {
                  tclSwitchContext.reset();
               }
            }


            // Send bytecodes/resource data in response (assumes HTTP/1.0 or later)
View Full Code Here


        SwitchContext context = classLoaderSwitcher.getSwitchContext(this.getClass().getClassLoader());
        try {
            MarshalledValueInputStream mvis = new MarshalledValueInputStream(bais);
            return mvis.readObject();
        } finally {
            context.reset();
        }
    }

    /**
     * Serializes an object into a byte buffer. The object has to implement interface Serializable or Externalizable
View Full Code Here

        SwitchContext context = classLoaderSwitcher.getSwitchContext(this.getClass().getClassLoader());
        try {
            MarshalledValueInputStream mvis = new MarshalledValueInputStream(bais);
            return mvis.readObject();
        } finally {
            context.reset();
        }
    }

    /**
     * Serializes a response object into a byte buffer, optimized for response marshalling. The object has to implement
View Full Code Here

            try {
                retval = CoreGroupCommunicationService.this.objectFromByteBufferResponseInternal(payload);

                return retval;
            } finally {
                context.reset();
            }
        }

        @Override
        public byte[] objectToByteBuffer(Object obj) throws Exception {
View Full Code Here

            } catch (Exception e) {
                this.log.warn("Partition " + CoreGroupCommunicationService.this.getGroupName()
                        + " failed extracting message body from request bytes", e);
                return null;
            } finally {
                context.reset();
            }

            if (body == null || !(body instanceof MethodCall)) {
                this.log.warn("Partition " + CoreGroupCommunicationService.this.getGroupName()
                        + " message does not contain a MethodCall object!");
View Full Code Here

            SwitchContext switchContext = CoreGroupCommunicationService.this.classLoaderSwitcher.getSwitchContext(cl);
            try {
                MarshalledValueInputStream mvis = new MarshalledValueInputStream(is);
                this.state = (Serializable) mvis.readObject();
            } finally {
                switchContext.reset();
            }
        }

        private ClassLoader getStateTransferClassLoader() {
            ClassLoader cl = classloader == null ? null : classloader.get();
View Full Code Here

    public <K, V> Cache<K, V> getCache() {
        SwitchContext context = this.switcher.getSwitchContext(this.getClass().getClassLoader());
        try {
            return this.container.getCache(this.defaultCache);
        } finally {
            context.reset();
        }
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

    public <K, V> Cache<K, V> getCache(String cacheName) {
        SwitchContext context = this.switcher.getSwitchContext(this.getClass().getClassLoader());
        try {
            return this.container.getCache(this.getCacheName(cacheName));
        } finally {
            context.reset();
        }
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

            InputStream input = url.openStream();
            SwitchContext context = this.switcher.getSwitchContext(InfinispanConfiguration.class.getClassLoader());
            try {
                return InfinispanConfiguration.newInfinispanConfiguration(input);
            } finally {
                context.reset();
                try {
                    input.close();
                } catch (IOException e) {
                    log.warn(e.getMessage(), e);
                }
View Full Code Here

            }

            this.container = new DefaultCacheContainer(manager, this.defaultCache);
            this.container.start();
        } finally {
            switchContext.reset();
        }
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.