Examples of EZBClusteredBeanEvent


Examples of org.ow2.easybeans.api.event.bean.EZBClusteredBeanEvent

    public EventPriority getPriority() {
        return EventPriority.SYNC_LOW;
    }

    public void handle(final IEvent arg0) {
        EZBClusteredBeanEvent clusterEvent = (EZBClusteredBeanEvent) arg0;
        if (EZBClusteredBeanEvent.STARTING.equals(clusterEvent.getState())
                || EZBClusteredBeanEvent.STOPPING.equals(clusterEvent.getState())) {
            for (EZBRef reference : clusterEvent.getReferences()) {
                if (reference instanceof RemoteCallRef) {
                    Factory<?, ?> factory = reference.getFactory();
                    if (factory instanceof SessionFactory) {
                        SessionFactory<?> fact = ((SessionFactory<?>) factory);
                        Object cluster = fact.getBeanInfo().getCluster();
                        Class<?> beanClass = fact.getBeanClass();
                        Class<?> itfClass = null;
                        if (cluster != null || beanClass.isAnnotationPresent(Cluster.class)) {
                            if (EZBClusteredBeanEvent.STARTING.equals(clusterEvent.getState())) {
                                String itfClassname = reference.getItfClassName();
                                logger.info("The bean with the jndi name {0} and the interface name {1} is clustered.",
                                        reference.getJNDIName(), itfClassname);
                                for (Class<?> klass : beanClass.getInterfaces()) {
                                    if (klass.getName().equals(itfClassname)) {
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.