All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ow2.petals.se.xslt.XsltSe Maven / Gradle / Ivy

There is a newer version: 2.10.0
Show newest version
/**
 * Copyright (c) 2008-2012 EBM WebSourcing, 2012-2016 Linagora
 * 
 * This program/library 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 2.1 of the License, or (at your
 * option) any later version.
 * 
 * This program/library 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 Lesser General Public License
 * for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program/library; If not, see http://www.gnu.org/licenses/
 * for the GNU Lesser General Public License version 2.1.
 */
package org.ow2.petals.se.xslt;

import java.util.concurrent.ConcurrentHashMap;

import org.ow2.petals.component.framework.se.AbstractServiceEngine;
import org.ow2.petals.component.framework.se.ServiceEngineServiceUnitManager;
import org.ow2.petals.se.xslt.model.XsltConfigurationHandler;

/**
 * The component class of the XSLT service engine.
 * @author Roland Naudin - EBM WebSourcing
 * @author Vincent Zurczak - EBM WebSourcing
 */
public class XsltSe extends AbstractServiceEngine {

	/**
	 * This map is used to get the XSLT configuration associated with an end-point name.
	 */
	private final ConcurrentHashMap endpointNameToXsltConfigurationHandler =
		new ConcurrentHashMap ();

	@Override
    protected ServiceEngineServiceUnitManager createServiceUnitManager() {
		return new XsltSuManager(this);
	}


	/**
	 * @param endpointName the end-point name
	 * @param xsltConfigurationHandler the XSLT configuration handler
	 * @return the previous XSLT configuration handler that was registered for this end-point name
	 * @see java.util.concurrent.ConcurrentHashMap#put(java.lang.Object, java.lang.Object)
	 */
	public XsltConfigurationHandler registerXsltConfigurationHandler(
			String endpointName,
			XsltConfigurationHandler xsltConfigurationHandler ) {

		return this.endpointNameToXsltConfigurationHandler.put( endpointName, xsltConfigurationHandler );
	}


	/**
	 * @param endpointName the end-point name
	 * @return the XSLT configuration handler that was registered for this end-point name
	 * @see java.util.concurrent.ConcurrentHashMap#remove(java.lang.Object)
	 */
	public XsltConfigurationHandler removeXsltConfigurationHandler( String endpointName ) {
		return this.endpointNameToXsltConfigurationHandler.remove( endpointName );
	}


	/**
	 * @param endpointName the end-point name
	 * @return the XSLT configuration handler associated with this end-point name
	 * @see java.util.Map#get(java.lang.Object)
	 */
	public XsltConfigurationHandler getXsltConfigurationHandler( String endpointName ) {
		return this.endpointNameToXsltConfigurationHandler.get( endpointName );
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy