<commit_before>/**
 * 
 */
package org.wings.adapter;

import org.wings.IntegrationFrame;
import org.wings.Resource;
import org.wings.conf.Integration;
import org.wings.resource.DynamicResource;
import org.wings.resource.ReloadResource;

/**
 * <code>AbstractIntegrationAdapter</code>.
 * 
 * <pre>
 * Date: Jul 25, 2008
 * Time: 6:36:21 PM
 * </pre>
 *
 * @author <a href="mailto:<EMAIL>"><NAME>uml;dle</a>
 * @version $Id
 */
public abstract class AbstractIntegrationAdapter implements IntegrationAdapter {

	protected IntegrationFrame frame;
	
	protected Integration integration;
	
	private DynamicResource defaultResource;
	
	/**
	 * @param frame
	 * @param integration
	 */
	public AbstractIntegrationAdapter(IntegrationFrame frame, Integration integration) {
		this.frame = frame;
		this.integration = integration;
		
		defaultResource = frame.getDynamicResource(ReloadResource.class);
	}

	/* (non-Javadoc)
	 * @see org.wings.adapter.IntegrationAdapter#setFrame(org.wings.SFrame)
	 */
	public void setFrame(IntegrationFrame frame) {
		this.frame = frame;
	}

	/* (non-Javadoc)
	 * @see org.wings.adapter.IntegrationAdapter#setIntegration(org.wings.conf.Integration)
	 */
	public void setIntegration(Integration integration) {
		this.integration = integration;
	}

	/* (non-Javadoc)
	 * @see org.wings.session.ResourceMapper#mapResource(java.lang.String)
	 */
	public Resource mapResource(String url) {
		try {
			navigate(url);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		return defaultResource;
	}
	
	/**
	 * @param url
	 */
	protected abstract void navigate(String url) throws Exception;
}<commit_msg>wings-integration: minor fix<commit_after>/**
 *
 */
package org.wings.adapter;

import org.wings.IntegrationFrame;
import org.wings.Resource;
import org.wings.conf.Integration;
import org.wings.resource.DynamicResource;
import org.wings.resource.ReloadResource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * <code>AbstractIntegrationAdapter</code>.
 *
 * <pre>
 * Date: Jul 25, 2008
 * Time: 6:36:21 PM
 * </pre>
 *
 * @author <a href="mailto:<EMAIL>"><NAME>uml;dle</a>
 * @version $Id
 */
public abstract class AbstractIntegrationAdapter implements IntegrationAdapter {

    private final transient static Log LOG = LogFactory.getLog(AbstractIntegrationAdapter.class);

    protected IntegrationFrame frame;

	protected Integration integration;

	private DynamicResource defaultResource;

	/**
	 * @param frame
	 * @param integration
	 */
	public AbstractIntegrationAdapter(IntegrationFrame frame, Integration integration) {
		this.frame = frame;
		this.integration = integration;

		defaultResource = frame.getDynamicResource(ReloadResource.class);
	}

	/* (non-Javadoc)
	 * @see org.wings.adapter.IntegrationAdapter#setFrame(org.wings.SFrame)
	 */
	public void setFrame(IntegrationFrame frame) {
		this.frame = frame;
	}

	/* (non-Javadoc)
	 * @see org.wings.adapter.IntegrationAdapter#setIntegration(org.wings.conf.Integration)
	 */
	public void setIntegration(Integration integration) {
		this.integration = integration;
	}

	/* (non-Javadoc)
	 * @see org.wings.session.ResourceMapper#mapResource(java.lang.String)
	 */
	public Resource mapResource(String url) {
		try {
			navigate(url);
		} catch (Exception e) {
            LOG.error("Cannot resolve \"" + url+ "\"");
		}
		return defaultResource;
	}

	/**
	 * @param url
	 */
	protected abstract void navigate(String url) throws Exception;
}
{'fraction_non_alphanumeric': 0.12442396313364056, 'fraction_numerical': 0.006336405529953917, 'mean_word_length': 4.392857142857143, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6650158', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1058, 'n_words': 215}