Package com.alibaba.otter.manager.biz.common.exceptions

Examples of com.alibaba.otter.manager.biz.common.exceptions.ManagerException


    public NodeMBeanServiceImpl(){
        try {
            objectName = new ObjectName(MBEAN_NAME);
        } catch (Exception e) {
            throw new ManagerException(e);
        }

        GenericMapMaker mapMaker = null;
        mapMaker = new MapMaker().expireAfterAccess(5, TimeUnit.MINUTES)
            .softValues()
            .evictionListener(new MapEvictionListener<Long, MBeanServerConnection>() {

                public void onEviction(Long nid, MBeanServerConnection mbeanServer) {
                    // do nothing
                }
            });

        mbeanServers = mapMaker.makeComputingMap(new Function<Long, MBeanServerConnection>() {

            public MBeanServerConnection apply(Long nid) {
                Node node = nodeService.findById(nid);
                String ip = node.getIp();
                if (node.getParameters().getUseExternalIp()) {
                    ip = node.getParameters().getExternalIp();
                }

                int port = node.getPort().intValue() + 1;
                Integer mbeanPort = node.getParameters().getMbeanPort();
                if (mbeanPort != null && mbeanPort != 0) {// 做个兼容处理,<=4.2.2版本没有mbeanPort设置
                    port = mbeanPort;
                }

                try {
                    JMXServiceURL serviceURL = new JMXServiceURL(MessageFormat.format(SERVICE_URL,
                        ip,
                        String.valueOf(port)));
                    JMXConnector cntor = JMXConnectorFactory.connect(serviceURL, null);
                    MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
                    return mbsc;
                } catch (Exception e) {
                    throw new ManagerException(e);
                }
            }

        });
    }
View Full Code Here


                "setProfile",
                new Object[] { profile },
                new String[] { "java.lang.Boolean" });
        } catch (Exception e) {
            mbeanServers.remove(nid);
            throw new ManagerException(e);
        }
    }
View Full Code Here

                "setThreadPoolSize",
                new Object[] { size },
                new String[] { "java.lang.Integer" });
        } catch (Exception e) {
            mbeanServers.remove(nid);
            throw new ManagerException(e);
        }
    }
View Full Code Here

    private Object getAttribute(Long nid, String attribute) {
        try {
            return mbeanServers.get(nid).getAttribute(objectName, attribute);
        } catch (Exception e) {
            mbeanServers.remove(nid);
            throw new ManagerException(e);
        }
    }
View Full Code Here

                method,
                new Object[] { pipelineId },
                new String[] { "java.lang.Long" });
        } catch (Exception e) {
            mbeanServers.remove(nid);
            throw new ManagerException(e);
        }
    }
View Full Code Here

                    arbitrateManageService.pipelineEvent().init(pipelineDo.getChannelId(), pipelineDo.getId());
                } catch (RepeatConfigureException rce) {
                    throw rce;
                } catch (Exception e) {
                    logger.error("ERROR ## create pipeline has an exception!");
                    throw new ManagerException(e);
                }
            }
        });

    }
View Full Code Here

            }

            pipelineNodeRelationDao.insertBatch(pipelineNodeRelationDos);
        } catch (Exception e) {
            logger.error("ERROR ## modify the pipeline(" + pipeline.getId() + ") has an exception!");
            throw new ManagerException(e);
        }
    }
View Full Code Here

                pipelineNodeRelationDao.deleteByPipelineId(pipelineId);
                arbitrateManageService.pipelineEvent().destory(pipelineDO.getChannelId(), pipelineId);
            }
        } catch (Exception e) {
            logger.error("ERROR ## remove the pipeline(" + pipelineId + ") has an exception!");
            throw new ManagerException(e);
        }
    }
View Full Code Here

        if (pipeline.size() != 1) {
            String exceptionCause = "query pipeline by pipelineId:" + pipelineId + " but return " + pipeline.size()
                                    + " pipeline!";
            logger.error("ERROR ## " + exceptionCause);
            throw new ManagerException(exceptionCause);
        }
        return pipeline.get(0);
    }
View Full Code Here

                return pipelines;
            }
            pipelines = doToModel(pipelineDos);
        } catch (Exception e) {
            logger.error("ERROR ## query pipelines by channelIds:" + channelId.toString() + " has an exception!");
            throw new ManagerException(e);
        }
        return pipelines;
    }
View Full Code Here

TOP

Related Classes of com.alibaba.otter.manager.biz.common.exceptions.ManagerException

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.