<commit_before>/*
 * Copyright 2015 Adaptris Ltd.
 * 
 * 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.adaptris.core.services.exception;

import static com.adaptris.core.CoreConstants.OBJ_METADATA_EXCEPTION;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import com.adaptris.annotation.AdapterComponent;
import com.adaptris.annotation.AdvancedConfig;
import com.adaptris.annotation.ComponentProfile;
import com.adaptris.annotation.DisplayOrder;
import com.adaptris.core.AdaptrisMessage;
import com.adaptris.core.CoreException;
import com.adaptris.core.ServiceException;
import com.adaptris.core.ServiceImp;
import com.adaptris.core.util.Args;
import com.adaptris.core.util.DocumentBuilderFactoryBuilder;
import com.adaptris.core.util.ExceptionHelper;
import com.adaptris.util.text.xml.DocumentMerge;
import com.thoughtworks.xstream.annotations.XStreamAlias;

/**
 * Service that takes an exception in object metadata and serializes that into the AdaptrisMessage payload.
 * 
 * <p>
 * In some scenarios (e.g. handling request reply scenarios), rather than directly handling the message exception in the adapter, it
 * may be required to report back to the back-end application that an exception has occured along with the problem document.
 * </p>
 * 
 * @config exception-report-service
 * 
 * @see ExceptionSerializer
 * @author lchan
 * @see com.adaptris.core.CoreConstants#OBJ_METADATA_EXCEPTION
 */
@XStreamAlias("exception-report-service")
@AdapterComponent
@ComponentProfile(summary = "Generate an XML report based on the current exception", tag = "service,error-handling")<commit_msg>Removed XML from the description because there are different exception-serializers.<commit_after>/*
 * Copyright 2015 Adaptris Ltd.
 * 
 * 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.adaptris.core.services.exception;

import static com.adaptris.core.CoreConstants.OBJ_METADATA_EXCEPTION;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import com.adaptris.annotation.AdapterComponent;
import com.adaptris.annotation.AdvancedConfig;
import com.adaptris.annotation.ComponentProfile;
import com.adaptris.annotation.DisplayOrder;
import com.adaptris.core.AdaptrisMessage;
import com.adaptris.core.CoreException;
import com.adaptris.core.ServiceException;
import com.adaptris.core.ServiceImp;
import com.adaptris.core.util.Args;
import com.adaptris.core.util.DocumentBuilderFactoryBuilder;
import com.adaptris.core.util.ExceptionHelper;
import com.adaptris.util.text.xml.DocumentMerge;
import com.thoughtworks.xstream.annotations.XStreamAlias;

/**
 * Service that takes an exception in object metadata and serializes that into the AdaptrisMessage payload.
 * 
 * <p>
 * In some scenarios (e.g. handling request reply scenarios), rather than directly handling the message exception in the adapter, it
 * may be required to report back to the back-end application that an exception has occured along with the problem document.
 * </p>
 * 
 * @config exception-report-service
 * 
 * @see ExceptionSerializer
 * @author lchan
 * @see com.adaptris.core.CoreConstants#OBJ_METADATA_EXCEPTION
 */
@XStreamAlias("exception-report-service")
@AdapterComponent
@ComponentProfile(summary = "Generate a report based on the current exception", tag = "service,error-handling")
{'fraction_non_alphanumeric': 0.08350539114475797, 'fraction_numerical': 0.003670566643725625, 'mean_word_length': 5.047156726768377, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3024924', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1136, 'n_words': 399}