PipeLine implements ICacheEnabled<String,String>, HasStatistics { public void registerPipeLineExit(PipeLineExit exit) { if (pipeLineExits.containsKey(exit.getPath())) { ConfigurationWarnings.add(null, log, getLogPrefix()+"exit named ["+exit.getPath()+"] already exists"); } pipeLineExits.put(exit.getPath(), exit); }  void addPipe(IPipe pipe); IPipe getPipe(String pipeName); IPipe getPipe(int index); List<IPipe> getPipes(); void registerExitHandler(IPipeLineExitHandler exitHandler); void configure(); void configure(IPipe pipe); PipeLineExit findExitByState(String state); int getPipeLineSize(); @Override void iterateOverStatistics(StatisticsKeeperIterationHandler hski, Object data, int action); StatisticsKeeper getPipeStatistics(INamedObject pipe); StatisticsKeeper getPipeWaitingStatistics(IPipe pipe); StatisticsKeeper getPipeSizeStatistics(IPipe pipe); StatisticsKeeper getPipeSizeStatistics(DummyNamedObject dno); PipeLineResult process(String messageId, Message message, IPipeLineSession pipeLineSession); void registerForward(PipeForward forward); void registerPipeLineExit(PipeLineExit exit); void setPipeLineProcessor(PipeLineProcessor pipeLineProcessor); IForwardTarget resolveForward(IPipe pipe, PipeForward forward); void setAdapter(Adapter adapter); Adapter getAdapter(); void setOwner(INamedObject owner); INamedObject getOwner(); @IbisDoc({ "name of the first pipe to execute when a message is to be processed", "" }) void setFirstPipe(String pipeName); void start(); void stop(); @Override String toString(); @IbisDoc({"if set to <code>true, messages will be processed under transaction control. (see below)</code>", "<code>false</code>"}) void setTransacted(boolean transacted); boolean isTransacted(); @IbisDoc({"if the pipelineresult.getstate() equals this value, the transaction is committed, otherwise it is rolled back.", "<code>success</code>"}) void setCommitOnState(String string); String getCommitOnState(); @IbisDoc({"The <code>transactionAttribute</code> declares transactional behavior of pipeline execution. It " + "applies both to database transactions and XA transactions." + "The pipeline uses this to start a new transaction or suspend the current one when required. " + "For developers: it is equal" + "to <a href=\"http://java.sun.com/j2ee/sdk_1.2.1/techdocs/guides/ejb/html/Transaction2.html#10494\">EJB transaction attribute</a>. " + "Possible values for transactionAttribute:" + " <table border=\"1\">" + " <tr><th>transactionAttribute</th><th>callers Transaction</th><th>Pipeline excecuted in Transaction</th></tr>" + " <tr><td colspan=\"1\" rowspan=\"2\">Required</td> <td>none</td><td>T2</td></tr>" + " <tr><td>T1</td> <td>T1</td></tr>" + " <tr><td colspan=\"1\" rowspan=\"2\">RequiresNew</td> <td>none</td><td>T2</td></tr>" + " <tr><td>T1</td> <td>T2</td></tr>" + " <tr><td colspan=\"1\" rowspan=\"2\">Mandatory</td> <td>none</td><td>error</td></tr>" + " <tr><td>T1</td> <td>T1</td></tr>" + " <tr><td colspan=\"1\" rowspan=\"2\">NotSupported</td><td>none</td><td>none</td></tr>" + " <tr><td>T1</td> <td>none</td></tr>" + " <tr><td colspan=\"1\" rowspan=\"2\">Supports</td> <td>none</td><td>none</td></tr>" + " <tr><td>T1</td> <td>T1</td></tr>" + " <tr><td colspan=\"1\" rowspan=\"2\">Never</td> <td>none</td><td>none</td></tr>" + " <tr><td>T1</td> <td>error</td></tr>" + " </table>", "Supports"}) void setTransactionAttribute(String attribute); String getTransactionAttribute(); @IbisDoc({"Like <code>transactionAttribute</code>, but the chosen " + "option is represented with a number. The numbers mean:" + "<table>" + "<tr><td>0</td><td>Required</td></tr>" + "<tr><td>1</td><td>Supports</td></tr>" + "<tr><td>2</td><td>Mandatory</td></tr>" + "<tr><td>3</td><td>RequiresNew</td></tr>" + "<tr><td>4</td><td>NotSupported</td></tr>" + "<tr><td>5</td><td>Never</td></tr>" + "</table>", "1"}) void setTransactionAttributeNum(int i); int getTransactionAttributeNum(); void setLocker(Locker locker); Locker getLocker(); void setInputValidator(IPipe inputValidator); IPipe getInputValidator(); void setOutputValidator(IPipe outputValidator); IPipe getOutputValidator(); void setInputWrapper(IPipe inputWrapper); IPipe getInputWrapper(); void setOutputWrapper(IPipe outputWrapper); IPipe getOutputWrapper(); @IbisDoc({"timeout (in seconds) of transaction started to process a message.", "<code>0</code> (use system default)"}) void setTransactionTimeout(int i); int getTransactionTimeout(); @IbisDoc({"when set <code>true</code> the original message without namespaces (and prefixes) is stored under the session key originalmessagewithoutnamespaces", "false"}) void setStoreOriginalMessageWithoutNamespaces(boolean b); boolean isStoreOriginalMessageWithoutNamespaces(); @IbisDoc({"if messagesizewarn>=0 and the size of the input or result pipe message exceeds the value specified a warning message is logged", "application default (3mb)"}) void setMessageSizeWarn(String s); long getMessageSizeWarnNum(); TransactionDefinition getTxDef(); String getFirstPipe(); Map<String, PipeLineExit> getPipeLineExits(); List<IPipeLineExitHandler> getExitHandlers(); @Override void registerCache(ICacheAdapter<String,String> cache); @Override ICacheAdapter<String,String> getCache(); @IbisDoc({"forces that each pipe in the pipeline is not automatically added to the globalforwards table", "application default"}) void setForceFixedForwarding(boolean b); boolean isForceFixedForwarding(); @IbisDoc({"when specified and <code>null</code> is received as a message the message is changed to the specified value", ""}) void setTransformNullMessage(String s); StatisticsKeeper getRequestSizeStats(); @IbisDoc({"when specified and an empty message is received the specified adapter is run before passing the message (response from specified adapter) to the pipeline", ""}) void setAdapterToRunBeforeOnEmptyInput(String s); String getAdapterToRunBeforeOnEmptyInput(); final static String INPUT_VALIDATOR_NAME; final static String OUTPUT_VALIDATOR_NAME; final static String INPUT_WRAPPER_NAME; final static String OUTPUT_WRAPPER_NAME; }
@Test public void testDuplicateExits() throws ConfigurationException { Adapter adapter = new Adapter(); PipeLine pipeline = new PipeLine(); PipeLineExit exit = new PipeLineExit(); exit.setPath("success"); exit.setState("SUCCESS"); pipeline.registerPipeLineExit(exit); pipeline.registerPipeLineExit(exit); adapter.registerPipeLine(pipeline); String lastWarning = ConfigurationWarnings.getInstance().getLast(); assertThat(lastWarning,StringEndsWith.endsWith("PipeLine exit named [success] already exists")); }