/**
 *    Copyright 2014 Renren.com
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package com.renren.Wario;

import java.io.IOException;
import java.util.Comparator;

import com.renren.Wario.zookeeper.ZookeeperClient;
import com.renren.Wario.zookeeper.ZookeeperClientFactory;

public abstract class IAlertPlugin implements Runnable, Comparator<IAlertPlugin>, Comparable<IAlertPlugin> {
	protected final String serviceName;
	protected final String zookeeperName;
	protected ISmsSender smsSender = null;
	protected IMailSender mailSender = null;
	protected ZookeeperClient zookeeperClient;
	
	public IAlertPlugin(String serviceName, String zookeeperName, ISmsSender smsSender, IMailSender mailSender) throws IOException {
		this.serviceName = serviceName;
		this.zookeeperName = zookeeperName;
		this.smsSender = smsSender;
		this.mailSender = mailSender;
		zookeeperClient = ZookeeperClientFactory.getFactory().getInstance(zookeeperName);
	}

	public abstract String toHtml();

	/**
	 * @return the serviceName
	 */
	public String getServiceName() {
		return serviceName;
	}

	/**
	 * @return the zookeeperName
	 */
	public String getZookeeperName() {
		return zookeeperName;
	}

	@Override
	public boolean equals(Object o) {
		return (this.compareTo((IAlertPlugin) o) == 0);
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	@Override
	public int compareTo(IAlertPlugin o) {
		return this.getServiceName().compareTo(o.getServiceName());
	}

	/* (non-Javadoc)
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	@Override
	public int compare(IAlertPlugin o1, IAlertPlugin o2) {
		return o1.compareTo(o2);
	}

	
}

@@ -748,16 +748,22 @@
 erClient
+Config
 ;%0Aimport
@@ -796,29 +796,29 @@
 r.ZookeeperC
-lient
+onfig
 Factory;%0A%0Apu
@@ -1108,16 +1108,22 @@
 erClient
+Config
  zookeep
@@ -1428,21 +1428,21 @@
 okeeperC
-lient
+onfig
 Factory.

修改IAlertPlugin.java