Package org.rioproject.associations

Examples of org.rioproject.associations.AssociationProxy


                /*
                 * Check for null strategyClass. If null, FailOver is default
                 */
                strategyClass = (strategyClass==null? FailOver.class.getName() : strategyClass);
                try {
                    AssociationProxy associationProxy =
                        (AssociationProxy)AssociationProxyFactory.createProxy(proxyClass,
                                                                              strategyClass,
                                                                              association,
                                                                              getCallerClassLoader());
                    logger.debug("Association [{}], is DISCOVERED, inject dependency", association.getName());
View Full Code Here


        final ClassLoader currentCL = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(loader);

            Class aProxyClass = loader.loadClass(proxyClassName);
            AssociationProxy aProxy = (AssociationProxy)aProxyClass.newInstance();

            List<Class> list = loadAssociatedInterfaces(association.getAssociationDescriptor(), loader);
            aProxy.setProxyInterfaces(list.toArray(new Class[list.size()]));
            list.add(AssociationProxy.class);

            if(strategyClassName!=null) {
                ServiceSelectionStrategy strategy =
                    (ServiceSelectionStrategy)loader.loadClass(strategyClassName).newInstance();
                strategy.setAssociation(association);
                aProxy.setServiceSelectionStrategy(strategy);
            }

            Class[] interfaces = list.toArray(new Class[list.size()]);
            proxy = Proxy.newProxyInstance(loader, interfaces, aProxy.getInvocationHandler(association));
        } finally {
            Thread.currentThread().setContextClassLoader(currentCL);
        }
        return proxy;
    }
View Full Code Here

TOP

Related Classes of org.rioproject.associations.AssociationProxy

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.