/** * Copyright (C) 2003-2007 Funambol * * This program is free software; you can redistribute it and/or modify * it under the terms of the Honest Public License. * * 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 * Honest Public License for more details. * * You should have received a copy of the Honest Public License * along with this program; if not, write to Funambol, * 643 Bair Island Road, Suite 305 - Redwood City, CA 94063, USA */ package br.com.prognus.psync.synclet; import com.funambol.framework.core.SyncML; import com.funambol.framework.core.Sync4jException; import com.funambol.framework.engine.pipeline.InputMessageProcessor; import com.funambol.framework.engine.pipeline.OutputMessageProcessor; import com.funambol.framework.engine.pipeline.MessageProcessingContext; import com.funambol.framework.engine.pipeline.StopProcessingException; /** * This synclet simply throws a StopProcessingException at each call. It can be * useful for debugging purposes. * * @version $Id: StopProcessingSynclet.java,v 1.2 2007-01-11 19:20:19 nichele Exp $ */ public class StopProcessingSynclet implements InputMessageProcessor, OutputMessageProcessor { // ---------------------------------------------------------- Public methods /** * Throws a StopProcessingException. * * @param processingContext the message processing context * @param message the message to be processed * * @throws Sync4jException */ public void preProcessMessage(MessageProcessingContext processingContext, SyncML message) throws Sync4jException { throw new StopProcessingException("Please stop input procesing!"); } /** * Logs the output message and context * * @param processingContext the message processing context * @param message the message to be processed * * @throws Sync4jException */ public void postProcessMessage(MessageProcessingContext processingContext, SyncML message) throws Sync4jException { throw new StopProcessingException("Please stop output procesing!"); } }