Package org.apache.axis2.clustering

Examples of org.apache.axis2.clustering.ClusteringFault


                if (log.isDebugEnabled()) {
                    log.debug("Exit: TribesClusteringAgent::shutdown");
                }

                throw new ClusteringFault(e);
            }
        }
        log.debug("Exit: TribesClusteringAgent::shutdown");
    }
View Full Code Here


                break;
            case ConfigurationClusteringCommand.EXCEPTION:
                listener.handleException(((ExceptionCommand) command).getException());
                break;
            default:
                throw new ClusteringFault("Invalid ConfigurationClusteringCommand " +
                                          command.getClass().getName());
        }
    }
View Full Code Here

                            ClusteringUtils.loadServiceGroup(serviceGroup,
                                                             configContext,
                                                             System.getProperty("axis2.work.dir")); //TODO: Introduce a constant. work dir is a temp dir.
                        } catch (FileNotFoundException ignored) {
                        } catch (Exception e) {
                            throw new ClusteringFault(e);
                        }
                    }
                }

                // Unload all service groups which were not sent by the neighbour,
                // but have been currently loaded
                for (Iterator iter = axisConfig.getServiceGroups(); iter.hasNext();) {
                    AxisServiceGroup serviceGroup = (AxisServiceGroup) iter.next();
                    boolean foundServiceGroup = false;
                    for (int i = 0; i < serviceGroups.length; i++) {
                        String serviceGroupName = serviceGroups[i];
                        if (serviceGroup.getServiceGroupName().equals(serviceGroupName)) {
                            foundServiceGroup = true;
                            break;
                        }
                    }
                    if (!foundServiceGroup) {
                        boolean mustUnloadServiceGroup = true;
                        // Verify that this service was not loaded from within a module
                        // If so, we must not unload such a service
                        for (Iterator serviceIter = serviceGroup.getServices();
                             serviceIter.hasNext();) {
                            AxisService service = (AxisService) serviceIter.next();
                            if (service.isClientSide() ||
                                service.getParameter(AxisModule.MODULE_SERVICE) != null) {
                                mustUnloadServiceGroup = false;
                                break; // Do not unload service groups containing client side services
                            }
                        }
                        if (mustUnloadServiceGroup) {
                            try {
                                axisConfig.removeServiceGroup(serviceGroup.getServiceGroupName());
                            } catch (Exception e) {
                                throw new ClusteringFault(e);
                            }
                        }
                    }
                }
            }
View Full Code Here

                AxisService axisService =
                        configurationContext.getAxisConfiguration().getService(serviceName);
                ServiceContext serviceContext = sgCtx.getServiceContext(axisService);
                propertyUpdater.updateProperties(serviceContext);
            } catch (AxisFault e) {
                throw new ClusteringFault(e);
            }
        } else {
            sgCtx = configurationContext.getServiceGroupContext(serviceGroupContextId);
            AxisService axisService;
            try {
                axisService = configurationContext.getAxisConfiguration().getService(serviceName);
            } catch (AxisFault axisFault) {
                throw new ClusteringFault(axisFault);
            }
            String scope = axisService.getScope();
            if (sgCtx == null) {
                AxisServiceGroup serviceGroup =
                        configurationContext.getAxisConfiguration().getServiceGroup(serviceGroupName);
                if(serviceGroup == null){
                    return;
                }
                sgCtx = new ServiceGroupContext(configurationContext, serviceGroup);
                sgCtx.setId(serviceGroupContextId);
                if (scope.equals(Constants.SCOPE_APPLICATION)) {
                    configurationContext.
                            addServiceGroupContextIntoApplicationScopeTable(sgCtx);
                } else if (scope.equals(Constants.SCOPE_SOAP_SESSION)) {
                    configurationContext.
                            addServiceGroupContextIntoSoapSessionTable(sgCtx);
                }
            }
            try {
                ServiceContext serviceContext = sgCtx.getServiceContext(axisService);
                propertyUpdater.updateProperties(serviceContext);
            } catch (AxisFault axisFault) {
                throw new ClusteringFault(axisFault);
            }
        }
    }
View Full Code Here

            channel.send(new Member[]{channel.getLocalMember(true)},
                         msg,
                         Channel.SEND_OPTIONS_USE_ACK);
            log.debug("Sent " + msg + " to self");
        } catch (ChannelException e) {
            throw new ClusteringFault(e);
        }
    }
View Full Code Here

        try {
            channel.start(Channel.DEFAULT);
            String localHost = TribesUtil.getLocalHost(channel);
            if (localHost.startsWith("127.0.")) {
                channel.stop(Channel.DEFAULT);
                throw new ClusteringFault("Cannot join cluster using IP " + localHost +
                                          ". Please set an IP address other than " +
                                          localHost + " in your /etc/hosts file and retry.");
            }
        } catch (ChannelException e) {
            throw new ClusteringFault("Error starting Tribes channel", e);
        }
        sender.setChannel(channel);

        Member[] members = channel.getMembers();
        log.info("Local Tribes Member " + TribesUtil.getLocalHost(channel));
View Full Code Here

                if (log.isDebugEnabled()) {
                    log.debug("Exit: TribesClusterManager::shutdown");
                }

                throw new ClusteringFault(e);
            }
        }
        log.debug("Exit: TribesClusterManager::shutdown");
    }
View Full Code Here

        try {
            replicateState(msgContext);
        } catch (Exception e) {
            String message = "Could not replicate the state";
            log.error(message, e);
            throw new ClusteringFault(message, e);
        }
    }
View Full Code Here

        try {
            replicateState(abstractContext);
        } catch (Exception e) {
            String message = "Could not replicate the state";
            log.error(message, e);
            throw new ClusteringFault(message, e);
        }
    }
View Full Code Here

        if (clusterManager != null) {
            ContextManager contextManager = clusterManager.getContextManager();
            if (contextManager == null) {
                String msg = "Cannot replicate contexts since " +
                             "ContextManager is not specified in the axis2.xml file.";
                throw new ClusteringFault(msg);
            }
            if (!abstractContext.getPropertyDifferences().isEmpty()) {
                String msgUUID = contextManager.updateContext(abstractContext);
                waitForACKs(contextManager, msgUUID, abstractContext.getRootContext());
            }
        } else {
            String msg = "Cannot replicate contexts since " +
                         "ClusterManager is not specified in the axis2.xml file.";
            throw new ClusteringFault(msg);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.clustering.ClusteringFault

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.