r647 - in trunk: . wikitty-api wikitty-api/src/main/java/org/nuiton/wikitty wikitty-api/src/main/java/org/nuiton/wikitty/services
Author: bpoussin Date: 2010-12-22 18:58:52 +0100 (Wed, 22 Dec 2010) New Revision: 647 Url: http://nuiton.org/repositories/revision/wikitty/647 Log: suppression de toute trace de jgroups Removed: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/JGroupsNotifierTransporter.java Modified: trunk/pom.xml trunk/wikitty-api/pom.xml trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyConfig.java Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-12-22 17:50:50 UTC (rev 646) +++ trunk/pom.xml 2010-12-22 17:58:52 UTC (rev 647) @@ -213,13 +213,6 @@ <!-- Cache --> <dependency> - <groupId>org.jgroups</groupId> - <artifactId>jgroups</artifactId> - <version>2.10.0.GA</version> - <scope>compile</scope> - </dependency> - - <dependency> <groupId>jivesoftware</groupId> <artifactId>smack</artifactId> <version>3.1.0</version> Modified: trunk/wikitty-api/pom.xml =================================================================== --- trunk/wikitty-api/pom.xml 2010-12-22 17:50:50 UTC (rev 646) +++ trunk/wikitty-api/pom.xml 2010-12-22 17:58:52 UTC (rev 647) @@ -117,11 +117,6 @@ <!-- Cache --> <dependency> - <groupId>org.jgroups</groupId> - <artifactId>jgroups</artifactId> - </dependency> - - <dependency> <groupId>jivesoftware</groupId> <artifactId>smack</artifactId> </dependency> Modified: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyConfig.java =================================================================== --- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyConfig.java 2010-12-22 17:50:50 UTC (rev 646) +++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/WikittyConfig.java 2010-12-22 17:58:52 UTC (rev 647) @@ -288,11 +288,6 @@ _("Indique si le service d'event ecoute sur le reseau les evenements"), "false", Boolean.class, false, false), - WIKITTY_EVENT_TRANSPORTER_JGROUP_CHANNELNAME( - "wikitty.service.event.transporter.jgroups.channelname", - _("channel name for jgroups transporter"), - null, String.class, false, false), - WIKITTY_EVENT_TRANSPORTER_XMPP_SERVER( "wikitty.service.event.transporter.xmpp.server", _("XMPP server to use for XMPP transporter"), Deleted: trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/JGroupsNotifierTransporter.java =================================================================== --- trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/JGroupsNotifierTransporter.java 2010-12-22 17:50:50 UTC (rev 646) +++ trunk/wikitty-api/src/main/java/org/nuiton/wikitty/services/JGroupsNotifierTransporter.java 2010-12-22 17:58:52 UTC (rev 647) @@ -1,148 +0,0 @@ -/* - * #%L - * Wikitty :: api - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -package org.nuiton.wikitty.services; - -import org.apache.commons.lang.StringUtils; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.jgroups.Channel; -import org.jgroups.ChannelException; -import org.jgroups.JChannel; -import org.jgroups.Message; -import org.jgroups.ReceiverAdapter; -import org.nuiton.util.ApplicationConfig; -import org.nuiton.wikitty.WikittyConfig; -import org.nuiton.wikitty.WikittyException; - -/** - * JGroups notifier. - * - * @deprecated not maintened because this implementation doesn't work. You must - * use XMPPNotifierTransporter - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ - */ -@Deprecated -public class JGroupsNotifierTransporter extends ReceiverAdapter - implements WikittyServiceNotifier.RemoteNotifierTransporter { - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(JGroupsNotifierTransporter.class); - - /** Notifier service reference reference. */ - protected WikittyServiceNotifier ws; - - - /** JGroup channel. */ - protected JChannel channel; - - public JGroupsNotifierTransporter(ApplicationConfig config) { - // can be null according to default constructor - if (config != null) { - // add notifier as listener - String jgroupChannel = config.getOption(WikittyConfig.WikittyOption.WIKITTY_EVENT_TRANSPORTER_JGROUP_CHANNELNAME.getKey()); - if (!StringUtils.isBlank(jgroupChannel)) { - initChannel(jgroupChannel); - } else { - throw new IllegalArgumentException("Can't use propagate cache without a valid jgroups channel name !!!"); - } - } - } - - public WikittyServiceNotifier getWikittyServiceNotifier() { - return ws; - } - - @Override - public void setWikittyServiceNotifier(WikittyServiceNotifier ws) { - this.ws = ws; - } - - /** - * Init jgroup channel. - * - * @param channelName channel name - */ - protected void initChannel(String channelName) { - if (log.isDebugEnabled()) { - log.debug("Init jgroup communication channel..."); - } - - try { - // use default udp.xml in classpath - channel = new JChannel(); - channel.setReceiver(this); - - // don't receive messages sent by myself - channel.setOpt(Channel.LOCAL, false); - - channel.connect(channelName); - - if (log.isInfoEnabled()) { - log.info("JGroup communication channel initialized to " - + channel.getAddressAsString() + " (" - + channel.getClusterName() + ")"); - log.info("Channel view: " + channel.getView()); - } - } catch (ChannelException eee) { - throw new WikittyException("Can't initialize jgroup channel", eee); - } - } - - /** - * Send a jgroup message to all other channel member. - * - * @param event message to send - */ - @Override - public void sendMessage(WikittyEvent event) throws Exception { - Message msg = new Message(null, null, event); - channel.send(msg); - } - - /* - * @see org.jgroups.ReceiverAdapter#receive(org.jgroups.Message) - */ - @Override - public void receive(Message msg) { - - Object message = msg.getObject(); - - if (log.isInfoEnabled()) { - log.info("Receive message : " + message); - } - - if (message instanceof WikittyEvent) { - WikittyEvent event = (WikittyEvent)message; - ws.processRemoteEvent(event); - } - } - -}
participants (1)
-
bpoussin@users.nuiton.org