001    // Copyright 2004, 2005 The Apache Software Foundation
002    //
003    // Licensed under the Apache License, Version 2.0 (the "License");
004    // you may not use this file except in compliance with the License.
005    // You may obtain a copy of the License at
006    //
007    //     http://www.apache.org/licenses/LICENSE-2.0
008    //
009    // Unless required by applicable law or agreed to in writing, software
010    // distributed under the License is distributed on an "AS IS" BASIS,
011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012    // See the License for the specific language governing permissions and
013    // limitations under the License.
014    
015    package org.apache.hivemind.parse;
016    
017    import org.apache.hivemind.impl.InvokeFactoryServiceConstructor;
018    import org.apache.hivemind.internal.Module;
019    import org.apache.hivemind.internal.ServicePoint;
020    import org.apache.hivemind.internal.ServiceImplementationConstructor;
021    import org.apache.hivemind.util.ToStringBuilder;
022    
023    /**
024     * Descriptor for the <invoke-factory> element.
025     *
026     * @author Howard Lewis Ship
027     */
028    public final class InvokeFactoryDescriptor
029        extends AbstractServiceInvocationDescriptor
030        implements InstanceBuilder
031    {
032        private String _serviceModel;
033    
034        public ServiceImplementationConstructor createConstructor(
035            ServicePoint point,
036            Module contributingModule)
037        {
038            InvokeFactoryServiceConstructor result = new InvokeFactoryServiceConstructor();
039    
040            result.setLocation(getLocation());
041            result.setContributingModule(contributingModule);
042            result.setParameters(getParameters());
043            result.setFactoryServiceId(getFactoryServiceId());
044            result.setServiceExtensionPoint(point);
045    
046            return result;
047        }
048    
049        public String getServiceModel()
050        {
051            return _serviceModel;
052        }
053    
054        public void setServiceModel(String serviceModel)
055        {
056            _serviceModel = serviceModel;
057        }
058    
059        protected void extendDescription(ToStringBuilder builder)
060        {
061            builder.append("serviceModel", _serviceModel);
062        }
063    
064    }