/**
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 2008 Bull S.A.S.
 * Contact: jonas-team@ow2.org
 *
 * This 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 any later version.
 *
 * This 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 library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.ow2.jonas.ws.cxf.client.factory;

import org.ow2.jonas.ws.jaxws.client.naming.factory.ServiceObjectFactory;

import javax.xml.ws.Service;
import javax.naming.Reference;

/**
 * CXF specialized JNDI ObjectFactory.
 * @author Guillaume Sauthier
 */
public class CXFServiceObjectFactory extends ServiceObjectFactory {

    /**
     * Prepare the service before returning it to the client.
     * This is basically a hook for WS provider specific tasks to do.
     * Like setup HandlerChains, ...
     * Warning, Exceptions handling is like what is done for JNDI
     * ObjectFactory: if an Exception is thrown, no other ObjectFactories
     * are tried and the object will never been build, even if other registered
     * factories may have been able to build an Object from the Reference.
     * So throw Exception with care.
     * @param service Service to be customized
     * @param ref the Reference used for object creation
     * @throws Exception if preparation cannot be performed.
     */
    protected void prepareService(final Service service, final Reference ref) throws Exception {

        // TODO Manage HandlerChains here (resolver/builder ?)
    }
}
